Install WordPress on Ubuntu 11.10


WordPress is web software you can use to create a beautiful website or blog. This blog post will outline the steps for installing WordPress on Ubuntu Server 11.10. It is assume that the LAMP stack is installed and properly configured. If not, please read the following post to install it before continuing:

Download and unzip the latest WordPress install files

$ cd ~/Downloads
$ sudo wget http://wordpress.org/latest.tar.gz
$ sudo tar -xzvf latest.tar.gz – – directory=/var/www

There should now be a wordpress folder under www. This is the location where latest.tar.gz was unzipped to.

Create the WordPress database and user

$ mysql -u root -p
mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.01 sec)
mysql> CREATE USER wp-user@localhost;
Query OK, 1 row affected (0.00 sec)
mysql> SET PASSWORD for wp-user@localhost=PASSWORD(“pwd-for-wp-user”);
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wp-user@localhost IDENTIFIED BY ‘pwd-for-wp-user’;
Query OK, 0 rows
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> exit;
Bye

Please note: replace wp-user and pwd-for-wp-user with your own choices. These are there for illustration purposes only.

Modify the WordPress configuration

$ cd /var/www
$ sudo cp wordpress/wp-config-sample.php wordpress/wp-config.php
$ sudo nano wordpress/wp-config.php

Set the following values in wp-config.php

/** MySQL database name */
define(‘DB_NAME’,’wordpress’);
/** MySQL database username */
define(‘DB_USER’,’wp-user’);
/** MySQL database password */
define(‘DB_PASSWORD’,’pwd-for-wp-user’);

Then control-X to exit and Yes to save changes to wp-config.php.
Please note: replace wp-user and pwd-for-wp-user with your own choices. These are there for illustration purposes only.

Set folder permission for the installation

$ sudo chown www-data:www-data * -R
$ sudo usermod -a -G www-data {ubuntu-user-for-installation}

That is, set the owner and group for www folder and all its subfolders and files to www-data. Then add the ubuntu user you use to install WordPress to the www-data group.

Ensure php5-gd module is installed

$ sudo apt-cache search php5-gd

You should see:
php5-gd – GD module for php5

if not, install it

$ sudo apt-get install php5-gd

Run the WordPress install script from a web browser

Open a web browser, and enter the following address:

http://localhost/wordpress/wp-admin/install.php

Enter the following details:

  • Site Title
  • Username
  • Password
  • Email

And that’s the end of the WordPress installation!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.