sudo apt update sudo apt install apache2 sudo apt install mysql-server sudo apt install php libapache2-mod-php php-mysql
sudo mysql_secure_installation
sudo mysql -u root -p CREATE DATABASE wordpress; CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
cd /tmp curl -O https://wordpress.org/latest.tar.gz tar xzvf latest.tar.gz sudo cp -a /tmp/wordpress/. /var/www/html
sudo chown -R www-data:www-data /var/www/html sudo chmod -R 755 /var/www/html
sudo nano /etc/apache2/sites-available/wordpress.conf
<VirtualHost *:80> ServerAdmin admin@yourdomain.com DocumentRoot /var/www/html ServerName yourdomain.com <Directory /var/www/html/> AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
sudo a2ensite wordpress sudo a2enmod rewrite sudo systemctl restart apache2
sudo apt install certbot python3-certbot-apache sudo certbot --apache