WordPress 4.7 was recently released and this brief tutorial is going to show students and new users how to quickly install and configure it on a Ubuntu 16.10 server. As was every version of WordPress the standard configuration process remains the same.
WordPress depends on the LAMP stack to function. The LAMP stack is an acronym for Linux, Apache2, MySQL and PHP. Without LAMP, WordPress won’t function. So, to get started, continue below with installing WordPress.
Step 1: Installing the LAMP Stack
Before you can install and use websites based WordPress your first task will be installing LAMP. We’re assuming you already have Ubuntu server installed and configured. If so, continue below to install and configure the rest of the stack. The other components can be installed using the link below:
How to Install the LAMP Stack on Ubuntu Server
Step 2: Creating WordPress and User
After installing LAMP using the link above, go and create WordPress database and user. WordPress uses database to store its content and the user establishes connection between WordPress content and the database. To do that, run the commands below to logon to the database.
mysql -u root -p
Then run the commands below to create a database called wpdb.
CREATE DATABASE wpdb;
Next run the commands below to create a database user called wpuser and grant the user access to manage the wpdb database
GRANT ALL ON wpdb.* TO 'wpuser'@'locahhost' IDENTIFIED BY 'new_password_here';
Finally, save the changes and exit.
Step 3: Download and Configure WordPress
Now that WordPress database and user are created, go and download WordPress latest content. To do that, run the commands below
cd /tmp/ && wget http://wordpress.org/latest.tar.gz
Next, extract the downloaded content and copy it to Apache2 default root directory on Ubuntu.
tar -xzvf latest.tar.gz
sudo cp -R wordpress/* /var/www/html
Next, remove Apache2 default index.html test file from its root directory. This can cause issues for new users.
sudo rm -rf /var/www/html/index.html
After that, create WordPress configuration file from its sample file by running the commands below.
sudo cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
Then open wp-config.php file and make the following highlighted changes to reference the database and user you created above.
sudo nano /var/www/html/wp-config.php
When the file opens, make the changes and save.
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
/** Database Charset to use in creating database tables. */
/** The Database Collate type. Don't change this if in doubt. */
Step 4: Change WordPress content file permissions
After configuring WordPress settings, you next step will be to change Apache2 directory permissions so WordPress can function properly. To do that, run the below commands
sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/
Finally, restart Apache2 webserver and open your browser and go to the server IP address or hostname.
sudo systemctl restart apache2
Open your browser and go to the server hostname and you should see WordPress default setup page.
Continue with WordPress wizard to setup your new site.
That’s it! This is how to install WordPress 4.7 on Ubuntu 16.10 server.