User Tools

Site Tools


eg-259:practicals:2

Practical 2: Installing a Web Application

Practical 2: To be completed as homework after completing the installation of the EG-259 Virtual Machine.

Instructions: Dr Chris P. Jobling.

In this homework exercise we will guide you to resources that you can use to successfully install the WordPress blogging application. We assume that you have already installed the EG-259 Virtual Machine, if not go through the EG-259 Virtual Machine installation instructions first. In an optional supplementary case study1) we use an installation of WordPress to demonstrate the use of PHP templates and CSS for layout and styling.

About WordPress

WordPress is a web-based blogging application written in PHP and making use of the LAMP stack. It is fairly easy to install, well documented and very popular both as the backbone of a hosted blogging service (WordPress.com/) and as a web application that can be run either on a web hosting service or installed on your own web server. We shall use it both as a case study for the installation of a web application on the LAMP stack as well as a platform for learning more about CSS layout and as one of several examples of a PHP application. Once installed of course, you can use it as a private blogging tool.

WordPress's main disadvantage is that it is designed as a single user or single group blog: it supports multiple contributors to a single blog but does not readily support multiple blogs.

Assumptions

To make these instructions as useful as possible I will assume that you have installed the EG-259 Virtual machine on your desktop and have started the guest operating system by issuing a command like:

<cli> $ cd ~/Dekstop/eg-259-vm $ vagrant up </cli>

In the following, I will continue to refer to the top-level folder of your installation as ~/Desktop/eg-259-vm and I will also use Unix conventions for directory movement, file names and operations that you are asked to perform. If you are working on a Windows machine simply use the path, e.g. C:\Users\you\Desktop\eg-259-vm, and the equivalent windows commands. If you installed them using the windows installers, both Vagrant and Git should work from the windows command prompt.

If you prefer, you can work in the Unix environment provided by the guest operating system using

<cli>$ vagrant ssh</cli>

If you do this, you will be dealing with files stored in /var/www on the guest operating system and you will need to use the sudo prefix.

Acquiring WordPress

WordPress is a free open source web application written in PHP for the LAMP platform. It is distributed as a zip file from the download page. The zip file contains a single folder called wordpress that is designed to be dropped into your web server's DocumentRoot (~/Desktop/eg-259-vm/web in your copy of the EG-259 Virtual Machine). It needs some minor configuration before it can connect to the MySQL database provided by in the guest operating system. And on first run, you need to run an installation script which names the blog and assigns an administrator account. Once installed and configured inside a running copy of the EG-259 Virual Machine, a local copy of WordPress will be available from URI: http://localhost:4567/wordpress.

Installing WordPress

In outline, the installation of WordPress on XAMPP follows these steps:

First, make sure that your virtual host (guest operating system) is running <cli> $ cd ~/Desktop/eg-259-vm $ vagrant up </cli>

  1. Download WordPress as a zip file and extract it into ~/Desktop/eg-259-vm/web2)
  2. Create a user with same-named database called wordpress using http://localhost:4567/phpmyadmin (user name root, password root)3)
  3. Make a copy of the file ~/Desktop/eg-259-vm/web/wordpress/wp-config-sample.php and save it as ~/Desktop/eg-259-vm/web/wordpress/wp-config.php. You can use your favourite text editor to open this file and amend the database name, database user name and database password. Save the file.
  4. Name your blog, note the password provided for the admin user, login as admin and reset the password.
  5. Create an ordinary user account for yourself.
  6. Log out admin and login as yourself.
  7. Create your first blog post.

Full installation instructions for WordPress are given on the WordPress site. In addition Rachel of cre8d.com and Teli Adlam of OptiNiche have provided videos that walk through the process of installing WordPress on a hosted webserver.

Please let me know if any of these instructions fail for you.

Running WordPress

Once WordPress is installed, you administer it via the web using the admin account. From there you can create user accounts for youself and your friends, change the themes (look and feel of your blog) etc. Ordinary users can login to create blog entries, manage comments, etc.

More Web Applications

Now that you have installed WordPress, why not try the installation of a wiki (try DokuWiki or MediaWiki) and a Content Management System (try Drupal or Joomla). The process should be pretty similar!

What's Next?

  • Case Study: CSS for Layout (Optional)
  • Getting Started with JavaScript

Previous lecture | Home | Case Study: CSS for Layout | Next Lecture

1)
This is no longer formally part of the EG-259 module
2)
If logged into the guest operating system use this sequence: <cli> $ vagrant ssh $ cd /var/www $ sudo wget http://wordpress.org/latest.tar.gz $ tar xvfz http://wordpress.org/latest.tar.gz $ cd wordpress </cli>
3)
You can do this step from the mysql command prompt inside the guest operating system if you prefer
eg-259/practicals/2.txt · Last modified: 2013/02/08 15:24 by eechris