48
How to run or host WordPress with Caddy2 server
PHP Version : 8.0
WordPress version : 5.7.2
Caddy version : v2.4.3
To install WordPress, you must required to have PHP and MySQL or mariaDB
This is for Ubuntu/Debian Distro.
sudo apt update
sudo apt install php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
sudo add-apt-repository ppa:ondrej/php;sudo apt update
and now repeat the above stepsudo apt purge apache2*
php -v
If you don't have MYSQL installed refer this blog by digitalocean
/home/illuminate/php_sites
wget https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
wordpress/
by cd wordpress
mysql -u adminusername -p
and now Enter the passworddatabasename
with the database name you want.
CREATE DATABASE databasename;
use databasename;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'username'@'localhost';
flush privileges;
ctrl+d
example.com {
root * /home/illuminate/php_sites/wordpress
php_fastcgi unix//run/php/php8.0-fpm.sock
file_server
encode gzip
@disallowed {
path /xmlrpc.php
path *.sql
path /wp-content/uploads/*.php
}
rewrite @disallowed '/index.php'
}
wp-config.php
file, then copy the configuration from webwp-config.php
file inside the directory where wp-content
, wp-admin
, wp-content
are present, for me its /home/illuminate/php_sites/wordpress
48