1. Install wordpress
$ sudo apt install wordpress
2. Open /etc/apache2/sites-available/wordpress.conf and write the following lines:
Alias /blog /usr/share/wordpress <Directory /usr/share/wordpress> Options FollowSymLinks AllowOverride Limit Options FileInfo DirectoryIndex index.php Order allow,deny Allow from all </Directory> <Directory /usr/share/wordpress/wp-content> Options FollowSymLinks Order allow,deny Allow from all </Directory>
3. Enable the new site
$ sudo a2ensite wordpress
3. Restart Apache
$ sudo systemctl restart apache2
4. Open /etc/wordpress/config-localhost.php and write the following lines:
<?php define('DB_NAME', 'wordpress'); define('DB_USER', 'wordpress'); define('DB_PASSWORD', 'yourpasswordhere'); define('DB_HOST', 'localhost'); define('WP_CONTENT_DIR', '/usr/share/wordpress/wp-content'); ?>
Note: insert your own database name, user, password and host values to the above.
5. Complete the installation at http://[INSERT SERVER ADDRESS]/wordpress/