GNU/Linux >> Linux Esercitazione >  >> Debian

Come installare Caddy Web Server su Debian 11

Come installare Caddy Web Server su Debian 11

Caddy è un web server open source scritto in Go, noto per l’HTTPS automatico e per una configurazione semplice. È adatto a ospitare siti web e API.

Requisiti

  • Debian 11 Bullseye
  • Utente sudo non root
  • Accesso al terminale

1. Aggiornare il sistema

sudo apt update
sudo apt upgrade
sudo apt install curl debian-keyring debian-archive-keyring apt-transport-https

2. Installare Caddy

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' -o /etc/apt/sources.list.d/caddy-stable.list
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' -o /tmp/caddy-gpg.key
sudo apt-key add /tmp/caddy-gpg.key
sudo apt update
sudo apt install caddy
sudo systemctl stop caddy
sudo systemctl start caddy
sudo systemctl enable caddy
caddy version

3. Abilitare il supporto PHP

sudo apt install php-fpm php-mysql php-curl php-gd php-mbstring php-common php-xml php-xmlrpc
sudo nano /etc/php/7.4/fpm/pool.d/www.conf
user = caddy
group = caddy
listen.owner = caddy
listen.group = caddy
sudo systemctl restart php7.4-fpm

4. Creare un virtual host Caddy

sudo nano /etc/caddy/Caddyfile
caddy.example.com:80 {
    root * /usr/share/caddy/
    encode gzip zstd
    php_fastcgi unix//run/php/php7.4-fpm.sock
}
sudo systemctl restart caddy

5. Testare il server

https://caddy.example.com

Caddy è installato e configurato con supporto PHP.

Debian
  1. Installare Tomcat 8.5 su Debian 9

  2. Come installare Nextcloud su Debian 9

  3. Come installare PostgreSQL 11 / 10 su Debian 9 e Debian 8

  4. Come installare MongoDB 4.4 / 4.2 su Debian 9

  5. Come installare PostgreSQL su Debian 11 e Debian 10

Come installare MariaDB su Debian 11

Come installare Nginx su Debian 11

Come installare Nagios su Debian 10 e Debian 9

Installare LibreNMS su Debian 11 e Debian 10: guida completa

Come installare YClas su Debian 11

Installare Go su Debian 11 Bullseye