how to install wordpress on ubuntu
guide
https://pimylifeup.com/raspberry-pi-wordpress/
https://opensource.com/article/18/10/setting-wordpress-raspberry-pi
https://howtoraspberrypi.com/install-wordpress-on-a-raspberry-pi-with-
nginx/
sudo apt-get update
sudo apt-get upgrade
ping 8.8.8.8
nslookup google.com
sudo apache2ctl -S #check it has already been
installed
MYSQL database
sudo service mysql status #to check my sql status and if it is
already installed
apt list --installed | grep mysql #to check if it is installed
sudo apt install mysql-server -y #if not installed
sudo su
mysql_secure_installation #it is a tool that let you chose a
secure password
Enter current password for root (enter for none): Just press the Enter
Set root password? [Y/n]: Y
New password: Enter password chose_mysql_password_for_root_user
Re-enter new password: Repeat password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y
sudo mysql -u root -p
show databases;
#create a database named wordpress
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
#create a separate user name wordpressuser that will operate on that database
with password = felice@!86
GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY
'felice@!86';
SHOW GRANTS FOR 'wordpressuser'@'localhost';
show databases;
FLUSH PRIVILEGES;
EXIT;
PHP
sudo apt-get install php7.2 php7.2-cli php7.2-common -y
sudo apt install php7.2-curl -y
sudo apt install php7.2-gd -y
sudo apt install php7.2-mbstring -y
sudo apt install php7.2-xml -y
sudo apt install php7.2-xmlrpc -y
sudo apt install php7.2-soap -y
sudo apt install php7.2-intl -y
sudo apt install php7.2-zip -y
sudo apt install php7.2-mysql -y
apache
sudo apt install apache2 -y
sudo nano /etc/apache2/sites-available/wordpress.conf
<VirtualHost *:8086>
ServerAdmin [email protected]
DocumentRoot /var/www/html/wordpress/
ServerName wordpress_http
ServerAlias www.example.com
<Directory /var/www/html/wordpress/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo nano /etc/apache2/ports.conf #to say to apache to listen also on the
port used into the new site enables
#add this line
Listen 8086 #do not listen on ports already in use by
nginx
ls -lash /etc/apache2/sites-enabled #to check if the folder
already exist
sudo ln -s /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-
enabled/wordpress.conf
ls -lash /etc/apache2/sites-enabled | grep wordpress.conf
sudo a2ensite wordpress.conf
sudo a2enmod rewrite
sudo apache2ctl configtest
sudo systemctl restart apache2
sudo apache2ctl -S
wordpress
cd /tmp
ls -lash
curl -O https://wordpress.org/latest.tar.gz
ls -lash
tar xzvf latest.tar.gz
ls -lash
#touch /tmp/wordpress/.htaccess
sudo mv wordpress /var/www/html/
sudo rm -rf /tmp/latest.tar.gz
#mkdir /tmp/wordpress/wp-content/upgrade
sudo chown -R www-data:www-data /var/www/html/wordpress/
sudo chmod -R 755 /var/www/html/wordpress/
UFW firewall
sudo ufw status
sudo ufw app list
sudo ufw allow in "Apache Full" #to allow HTTP and HTTPS traffic for Apache
Full profile
sudo ufw app info "Apache Full" #to check apache has http and https
enables
test if it work
open the browser
http://ip:8086
http://192.168.3.53:8086/wp-admin/index.php
http://192.168.3.53:8086/wp-admin/
troubleshooting commands
sudo ufw status #check if the firewall is active
netstat -tulpn | grep LISTEN #to check open ports
sudo tcpdump -n port 8086
sudo a2ensite wordpress.conf
sudo a2enmod rewrite
sudo apache2ctl configtest
sudo systemctl restart apache2
sudo apache2ctl -S
tail -f /var/log/apache2/access.log