Host WordPress with Caddy web server

# Add repository and install through APT
apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf '' | apt-key add -
curl -1sLf '' | tee /etc/apt/sources.list.d/caddy-stable.list
apt update
apt install caddy php-fpm php-mysql php-curl php-gd php-mbstring php-common php-xml php-xmlrpc -y
# Install MariaDB
apt install mariadb-server -y
# Create database
mysql -uroot -p
create database ariw;
grant all on ariw.* to 'ariw'@'localhost' identified by 'LuGueEnd!';
flush privileges;
# Download WordPress
mkdir /ssd/www/ && cd /ssd/www/ && wget && unzip && mv wordpress/* ./ && rmdir wordpress
# Create Caddyfile (/etc/caddy/Caddyfile), {
        tls {
        dns cloudflare yOurCloudFlareTokenHere0D7Fkei-suZR4P7y5kQ0

        root * /ssd/www/
        php_fastcgi unix//run/php/php7.4-fpm.sock

        @disallowed {
        path /xmlrpc.php
        path *.sql
        path /wp-content/uploads/*.php

        rewrite @disallowed '/index.php'


Leave a Reply

Your email address will not be published. Required fields are marked *