Installing WordPress
Download WordPress Zip file.
wget https://wordpress.org/latest.zip
Unzip WordPress Zip file.
sudo unzip latest.zip
Move WordPress folder to Apache web server directory. (Folder name can be changed to something different at this point if desired.)
sudo mv wordpress /var/www/
Set wordpress folder user permission to the www-data user. (If you change the name of the wordpress folder, substitute it in the below command.)
sudo chown -R www-data:www-data /var/www/wordpress
Create WordPress Apache configuration file. (File name can be anything you want. If you’re planning to host more than one site, name them something to associate it with each site.)
sudo nano /etc/apache2/sites-available/wordpress.conf
Add the below code to the newly created configuration file. Replace wordpress in the below with the name that you gave to your WordPress folder if you changed it. Insert your server’s IP address or your desire URL for use with WordPress inplace of [WordPress URL] (removing the open and closed brackets).
<VirtualHost *:80>
DocumentRoot /var/www/wordpress
ServerName [WordPress URL]
<Directory /var/www/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /var/www/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
Enable Nextcloud’s Apache confirguation file.
sudo a2ensite wordpress.conf
Restart Apache.
sudo systemctl restart apache2