Install Apache
1) apt install apache2
2) systemctl status apache2
Install Mariadb
1) sudo apt install mariadb-server
2) sudo mysql_secure_installation
Install PHP & Dependancies
sudo apt install php php-mysql
sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
Configure Database
1) mysql -u root -p
2) CREATE DATABASE wordpress_db;
3) CREATE USER ‘wp_user’@’localhost’ IDENTIFIED BY ‘password’;
4) GRANT ALL ON wordpress_db.* TO ‘wp_user’@’localhost’ IDENTIFIED BY ‘password’;
5) FLUSH PRIVILEGES;
6) Exit;
Install WordPress
1) cd /tmp && wget https://wordpress.org/latest.tar.gz
2) tar -xvf latest.tar.gz
3) cp -R wordpress /var/www/html/
4) chown -R www-data:www-data /var/www/html/wordpress/
5) chmod -R 755 /var/www/html/wordpress/
6) mkdir /var/www/html/wordpress/wp-content/uploads
7) chown -R www-data:www-data /var/www/html/wordpress/wp-content/uploads/
Configure virtualhosts
cp
Check apache configuration
sudo apache2ctl configtest
Disable Default site
sudo a2dissite 000-default.conf
Enable New site
sudo a2ensite example.com.conf
Install Certbot
sudo apt install certbot python3-certbot-apache
Install SSL Certificate
sudo certbot –apache
Check Autorenewal of SSL
sudo systemctl status certbot.timer