Prerequisites:
- A server running Debian 11.
- A valid domain name pointed with your server IP.
- A root password is configured on the server.
Install Caddy on Debian 11
apt-get install -y curl debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf ‘https://dl.cloudsmith.io/public/caddy/stable/gpg.key’ | apt-key add –
curl -1sLf ‘https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt’ | tee /etc/apt/sources.list.d/caddy-stable.list
curl -1sLf ‘https://dl.cloudsmith.io/public/caddy/stable/gpg.key’ | sudo gpg –dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
sudo apt update
sudo apt install caddy
sudo setcap ‘cap_net_bind_service=+ep’ /usr/bin/caddy
systemctl start caddy
systemctl enable caddy
Enable PHP Support in Caddy
apt-get install php-fpm php-mysql php-curl php-gd php-mbstring php-common php-xml php-xmlrpc -y
nano /etc/php/7.4/fpm/pool.d/www.conf
user = caddy
group = caddy
listen.owner = caddy
listen.group = caddy
systemctl restart php7.4-fpm
sudo apt install mariadb-server
sudo mysql_secure_installation
nano /etc/caddy/Caddyfile
example.com {
root * /var/www/wordpress
encode gzip zstd
php_fastcgi unix//run/php/php7.4-fpm.sock
tls info@example.com {
protocols tls1.2 tls1.3
}
}
sudo systemctl restart caddy
sudo mysql_secure_installation
mysql -u root -p
CREATE DATABASE dbwordpress;
CREATE USER wpuser@localhost IDENTIFIED BY ‘dbpassword’;
GRANT ALL PRIVILEGES ON dbwordpress.* TO dbuser@localhost ;
FLUSH PRIVILEGES;
exit;
sudo curl -O https://wordpress.org/latest.tar.gz
sudo tar zxf latest.tar.gz /var/www
sudo rm latest.tar.gz
sudo chown -R caddy:caddy wordpress
Not finished, just for test
Leave a Reply