create folder in your directory with domain name
mkdir example.com
cd example.com
Installing Additional PHP Extensions
sudo apt update
sudo apt install php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip
sudo systemctl restart php7.2-fpm
Download wordpress and change into writable directory
curl -LO https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
cd wordpress
mv * ../
cd ..
rm -rf wordpress
cd ..
sudo chown -R www-data:www-data example.com
Configure Nginx
cd /etc/nginx/sites-available
nano example.com
paste below sample configuration
server {
server_name example.com;
index index.html index.php;
root /var/www/example.com;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
then press CTRL + X
and press Y
and enter to save configuration
Now time to add this file in nginx sites-enabled dir. It ln -s creates a link to sites-available directory in sites-enabled directory
cd ../sites-enabled
ln -s ../sites-available example.com
Now finally run below command to test nginx configuration
nginx -t
if not get any error then restart nginx
systemctl restart nginx
Time to setup mysql
mysql
create database example;
Top comments (0)