Configuring WordPress


In this document, we will install WordPress to a server that you already have a server running in Linux, Apache2, Mysql (or MariaDB), and PHP.   If you do not have a server set up yet, you can refer to this document:  https://bryceautomation.com/index.php/configuring-virtual-private-server/ .   We will assume that you have SSH access to your server using your terminal in Linux, or using PUTTY in Windows.

WordPress is a Content Management System (CMS) that allows you to build websites graphically without having to know HTML or PHP programming.   Knowledge of these languages, however would be very helpful if you need to do anything outside of the scope of WordPress.

This document is “as is”   You are responsible for securing your site, taking safety precautions, etc.

The first thing we will do is install Webmin.   Webmin allows us to graphically configure certain features of our server such as the MySQL database, and the Apache web server.

If you need to set up a server from scratch to run your wordpress site, please follow this link first:

Configuring a VPS

Webmin DebianStep 1 — Webmin Download

Go to http://webmin.com, and select the Debian Package

 

 

 

 

Step 2 — Copy the Link Location

Webmin Direct LinkWe want to download the debian package onto the server, and not onto our computer.   We will cancel the popup that prompts us to download the file to our computer, and right click the direct link, and copy the link location (or link address).   We will use this link location to download the file onto our server.

 

Step 3 — Download the file onto our web server

Log into putty as root.   We will type cd /root to enter our root home folder.  then type:  wget:http://downloads.sourceforge.net/project/webadmin/webmin/1.820/webmin_1.820_all.deb?r=http%3A%2F%2Fwebmin.com%2F&ts=1482526185&use_mirror=pilotfiber

That’s wget, then a space, and paste the link you copied from the download page.    This will download the file we need to install webmin.

Step 4 — Rename the file

Let’s rename the file, so it is a bit easier to work with…  Again, assuming this is the only webmin file in this directory.   mv webmin* webmin.deb

Step 5 — Install Webmin

To install webmin, type dpkg -i webmin.deb

Step 6 — Fixing errors

We have some dependency errors that we need to fix.   Type apt-get -f install

Step 7 — Logging into Webmin

Now, in your web browser, you can go to https://learnautomation.com:10000, substituting your own domain name.  You might have to choose “advanced” on the initial page to confirm that you want to enter the site.   Whatever browser, you are using, you will want to get past the security messages, and confirm that you want to enter the site.   Then log in as root with your password for the server.

Step 8 — Select MySQL DatabaseSelect MySQL

Under “Servers”, we will open MySQL Database

 

 

 

Step 9 — Create the databaseMySQL Database

Log in as “root” with your password if asked, and select “Create New Database”

MySQL Name Creation

Now, Name your database, and press the “create” button.

 

 

 

 

 

Step 10 — User PermissionsMySQL User Permissions

Now, we will add a user to our database, so we will select “User Permissions”

 

Create userNow, choose to “Create new User”

 

 

Complete the userUser Permissions permissions as follows.    We don’t need to give this user any privileges right now.  We will make them specific to the database later on.  Be sure to choose “localhost” for the user, though, and set the password for this user.  Here, I’ll just name the user “learnautomation”

Press “Create” to finish creating the user.

Step 11 — Database PermissionsDatabase permissions1

Now, we will associate the new user to the database, so back on the main MySQL page, we will select “Database Permissions“, then “Create New Database Permissions“.

Database permissions2Complete the form similar to the one shown.   Again, here we are mainly concerned with just getting the page running.   You can always research more secure settings.   To give this user all priviledges, click the top priviledge, scroll to the bottom of the priviledge list.   Hold down shift and click the bottom privilege to select all privileges.    Then press “Create“.

 

 

 

Step 12 — Download WordPress

Back in your terminal, or in PUTTY, we will go back to root’s home directory.   Type cd /rootWordpress Download Page

Now, we will go to https://wordpress.org/download/, and right click the download link for the .tar.gz file.  We will copy the link location (or link address).

 

Step 13 — Extract WordPress

Now, back in our terminal, type wget https://wordpress.org/latest.tar.gz  That is wget then space, then paste the link to the .tar.gz file we just copied.

Now, we must extract this file.  type tar xzvf latest.tar.gz   (latest.tar.gz is the name of the file we just downloaded.)   If you are unsure of the name, you can type ls to list the items that are in the directory that you just downloaded to.

Type ls again, and you should see the a wordpress directory within your /root directory.

Step 14 — Moving WordPress to your public_html directory.

Lets go into the WordPress directory.   Type cd wordpress

Now, let’s move the files into your public_html folder with the following command:

cp -R * /var/www/vhosts/learnautomation.com/public_html/  (substitute your own directory that Apache is looking for)

Step 15 — Set Permissions

Now, we need to run a couple commands to set the permissions for the files in your public_html folder

chown -R www-data:www-data /var/www/vhosts/learnautomation.com/public_html

chmod -R 755 /var/www/vhosts/learnautomation.com/public_html

Step 15 — Your site is ready!

In your web browser, go to your domain name, and you will be asked what database, database user, and password to use, and a few other questions, then your site is good to go.   You may want to search google for better securing your site with plugins and other file permission changes.

— Ricky Bryce