WordPress Installation

First, the famous 5 Minute Install is here: http://codex.wordpress.org/Installing_WordPress and yes it is a 5 minute install… if you know what you are doing… and if you already have all your downloads done… and if your AMP stack is in place…. and… 🙂 

In any event I will provide my installation steps here that distill the instructions found in the link above.  While I provide instructions I am still going to ask everyone to read all the content in the link above as you need understanding the context rather than blindly following instructions. Also my instructions are for a particular version and WordPress evolves at an astounding rate so my instructions are only a conceptual framework.  

Note we have already covered much of this material (i.e. phpMyAdmin and MySQL setup).  You should also deduce that we will be setting up the system locally in our VM Ubuntu guest OS instance.  There is wonderful and even required merit to this approach as you should always design, implement and test locally and upload to an active site when the design and implementation is robust.

Now you should note that running WordPress locally on your box is also possible on Mac with the MAMP stack (this is actually the most robust implementation) or the Windows AMP (WAMP).    Note that our simple implementation will run locally (e.g. so certain functionality will be restricted (e.g. mail functionality, etc.). This is of course resolved if you upload your site to a real site or if you actually made your Web server functional outside of local implementation (not recommended at this juncture and level of understanding).  

On the WordPress site you will also see that WordPress offers to host your site for free (www.wordpress.com) and I encourage you to continue your exploration of WP developing locally and uploading when your design is complete. A new option is Amazon’s EC2 Cloud and I will provide extra credit for students that complete this local and then Amazon’s EC2 installation.

So here we go:

Of course start your Ubuntu VM, open a terminal, open Firefox and download WP (of course I chose to confirm this lab on Jan 18 during the Protest The Protect IP Act when sites are shutdown but I will go ahead in any event)

Use the Terminal CLI with apt-get install:

$ sudo apt-get install wordpress php5-gd

Assignment Screenshot #4

The installation places the files in the /usr/share/wordpress folder.  Please verify this and take and insert a screenshot into your assignment.

Continuing On:

So that Apache2 knows where to find the installation folder, make a symbolic link to the Apache2 www folder (previously we only made links to files so here is another very useful piece of knowledge/functionality).

$ sudo ln -s /usr/share/wordpress /var/www/wordpress 

Note: ln -s creates a soft link pointing from /var/www/wordpress to /usr/share/wordpress which contains the actual WordPress files.  First you should research the ln command if you have forgotten and if this you run into problems below you need to verify the ln command worked.  You will do this by navigating to /var/www which is up several levels (perform a cd .. and then a pwd and a ls to see where you are and the directory contents.  To verify that wordpress (in /var/www) is a link perform a ls -la.  You should also go to /usr/share/wordpress and see and verify the existence of the WordPress architecture.

Now we install WordPress using the supplied script #Note you may see an error as MySQL DB is already setup

$ sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

Ok, now just to see how things work, in your browser goto – http://localhost/wordpress

You should see a database error as the Apache server can find the middle tier (PHP) but the middle tier’s PHP business logic cannot find the database.  I also recommend you drag this browser tab address up to the quick access menu and in properties rename it  ‘WordPress’.  To get things running let’s configure PHP.

We need to setup and configure the wp-config.php file so enter:

$ sudo gedit  # to run gedit with root privileges 

Navigate to Filesystem in the file menu => /var/www/wordpress and open wp-config-sample.php

Somewhere in the file you will find the MySQL settings and instructions to replace the generic placeholders with your information (I hope you remember how to search a Web page as I presented this in week 1).  Please fill this in as follows and I’m assuming you took my recommendations.

// ** MySQL settings ** //

define(‘DB_NAME’, ‘wordpress’);    // Replace ‘database_name_here’ with the name of your database

define(‘DB_USER’, ‘wordpress’);     // Your MySQL username

define(‘DB_PASSWORD’, ‘password’); // Your MySQL password

define(‘DB_HOST’, ‘localhost’);    // 99% chance you won’t need to change this value – in some cases putting in the ‘loopback address’ resolved problems – note you will have to lookup the loopback address if you don’t remember it.

Save this file as wp-config.php  #Note you may be over-writing the existing blank wp-config.php file

Ok, again in your browser go to: http://localhost/wordpress

Now you should see the WordPress Installation Screen, if this didn’t work (and only if this didn’t work) please do the following indented itallicized commands otherwise jump below to WordPess Installation Screen:

Open phpMyAdmin and drop the WordPress database (more -> operations) and re-execute the following commands

sudo apt-get install wordpress php5-gd 

sudo ln -s /usr/share/wordpress  /var/www/wordpress 

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

Now open phpMyAdmin and create the wordpress database and wordpress user as before (please do not do this from memory).  If wordpress user is automatically created you can choose action (rightmost icon) and grant all privileges and set the password if necessary.  

If you still get database errors I recommend you search using the words “wordpress installation” or “wordpress configuration” and the complete error message provided by your system.  Quite often this will lead you here: http://wordpress.org/tags/error-establishing-a-database-connection but there are many other valid resources and this is the real purpose of the final projects (i.e. overcoming obstacles) and this is the last hurdle you will encounter.

WordPress configuration

Now everyone should see the WordPress Installation screen

Name your blog LastnameFirstnameCISS100

Choose a username (since this is local, default admin is ok but I chose jameslooby)

Choose a password and verify it

Enter your HVCC email

Click on Install

Assignment Screen Shot # 5 – take a screen shot of the success screen and paste into your pdf file.

Assignment Screen Shot # 3 – Login to WP and take a screenshot of your WordPress Welcome Page/Dashboard.

Congratulations because you just installed and configured a Web server so start exploring – make some test posts, install some plug-in modules, change your theme but most importantly….. well done!

***If your password doesn’t work (I don’t know why it does this in some instances) see next page***

*** Note this is actually a good exercise/read for all you budding Web/Sys Admins***

WordPress Passwords:

There are many methods for resetting WordPress passwords information found here and this should drive home the need for good security on your database: http://codex.wordpress.org/Resetting_Your_Password

My augmented phpMyAdmin Instructions from the link above:

1. Begin by logging into phpMyAdmin (see LAMP installation if you have forgotten and screen shot thumbnails open in a new tab).  Note the interface phpMyAdmin interface does change in various versions so what you see may not be exactly what is below.  Note this is educational as we should be seeking a greater understanding rathter than simply following directions.

2. Click databases if necessary and select your ‘wordpress’ DB (see my mouse position and purple highlighted field)

3. All the tables in your database will appear. If not, click Structure.

Look for wp_users (highlighted in orange this image).

Click on the wp_users icon to open it and view its settings 

(2 separate images/views below as you may see either view and get to where we need to go)

Note edit icon is under my cursor in the first square box following wp_users

 4. Once you have wp-users open in edit mode – locate your Username under user_login and click edit icon (see my cursor over what my look like a stylus)

5. Now be careful here but also have a look around at what you can manage

Next to the user_pass is a long list of numbers and letters (see my cursor)

Select and delete these numbers and letters 

Type in the password you want to use. Just type it in normally, but remember, it is case-sensitive.

Once you have done that, click the dropdown menu on the same line and select MD5 from the menu. 

Click ‘Go’

Test the new password on the login screen. If it doesn’t work, check that you’ve followed these instructions exactly and repeat if necessary.

WordPress Configuration

If you are here, again well done.  Open a Firefox and enter localhost/wordpress in the browser location bar and configure your site.  Please take a screenshot of this opening configuration screen and paste the image and submit your FP.

Extra Credit

You can receive extra credit if you implement on Amazon’s EC2 Cloud.

EC2 Free Signup: http://aws.amazon.com/free/

EC2 WordPress Installation: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html

Please send me the EC2 url and also please post the EC2 url to the FP Discussion Board.

Leave a Reply