How To Install WordPress on Ubuntu: Part 1
In this first part of How To Install WordPress on Ubuntu, I'm going to show some of the things you need to do to prepare your system for the actual WordPress installation. I'll cover the steps of installing WordPress itself in Part 2.
LAMP stands for Linux, Apache, MySQL, php. This is the basic web server setup you need to host a website. Even though you won't be hosting the site out to the internet, you'll need to have LAMP installed and configured to run WordPress on your computer. This tutorial assumes that you already have Ubuntu installed. Then, install LAMP on Ubuntu.
Configure Apache websites
Once you have LAMP installed and configured, you may want to set up your website to run from a directory under your user ID instead of /var/www. This can be done with some basic Apache http server configuration.
Change Apache run user and run group
In order for the WordPress automatic update function to work, the username running WordPress must match the username running Apache. You can change the Apache username by editing some parameters in the /etc/apache2/envvars file. Hit <Alt><F2> on your keyboard and enter the command
In the text editor that comes up, change the following two lines
and replace www-data with your user ID and default group (your default group most likely has the same name as your user ID. For my case, this would be linerd and linerd.) Save the file and restart Apache with
If you get an error like "apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for localhost," you can fix it with this command.
echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
Then reload Apache and the error should be gone.
If you end up having trouble with phpMyAdmin, then you need to add your ID to the www-data group.
Continue on to How To Install WordPress on Ubuntu: Part 2