Dan Paul Smith

Interface and visualisation developer.

Saturday 12 March 2011

Installing Wordpress 3 on Ubuntu 10 (Dirty)

After spending all day migrating stuff from server to server, finding that some servers were slower than others, trying out different server hosts etc etc, I thought I'd list what I've narrowed down to be the essential steps to setting up your own Wordpress website (as well as your own server based in London) - for only 7.44 a month. Bar. Gain.

I'm only going to list the install steps once you've got your server set up, but FYI my server details are:

  • Cloud server host: Rackspace UK

  • Operating system: Ubuntu 10.04 LTS (Lucid Lynx)

  • Memory: 256MB @ 0.01 an hour ~ 7.50 a month (this is the lowest, you can fork out a little more for 512MB @ 0.02 an hour ~ 14 a month)


Logged in to your server? Staring at a matrix thingy? root@yourservername? Ok.

Copy and paste these commands into the terminal and press enter (Note, when the blue screen appears use TAB to scroll through the options and SPACE to select them) (Note 2: I'm not sure how many times you have to enter a password here but I've used the same password every-time I've been asked):

apt-get update

apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils

apt-get install php5 libapache2-mod-php5 php5-common php5-gd php5-mysql php5-imap php5-cli php5-cgi php-pear php-auth

apt-get install mysql-server mysql-client
(blue screen appears, enter a password for your database, you won't really use it much)

apt-get install phpmyadmin
(blue screen appears again, asks whether your using apache2 or lightpdd - select apache2 using TAB and SPACE)
(I think you need to enter some more passwords again)

service mysql restart

service apache2 restart

cd /var/www/

wget http://wordpress.org/latest.tar.gz

tar -zvxf latest.tar.gz

sudo chown -R www-data wordpress/

cd wordpress/

mv * /var/www/

cd /var/www/

rmdir wordpress/

Go to http://your_server_IP_address/phpmyadmin and where it says "Create new database", enter "wordpress" and click "Create".

Go to your server IP address in your browser again, you should see Wordpress complaining that there's no config file. Click 'Create config" (or something like that). Fill out the fields, "wordpress", username, pass, leave the other 2.

Proceed and Wordpress will say that it can't create your config file because of permissions, so it gives you the code to paste into the file yourself. So you need to create a file called wp-config.php in the /var/www directory and paste that code in. Once you've done that, click "Run the installation" from the browser window.

The Wordpress Dashboard should appear!

Go back to the terminal, type in:

sudo a2enmod rewrite

Then find the file /etc/apache2/sites-enabled/000-default and change the AllowOverride "None" 's:


DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>


to "All" 's


DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>


Enter this:

service apache2 restart

Go to your Wordpress dashboard, expand the Settings arrow in the bottom left, and click Permalinks. Change the template for your site's page addresses to something nice like month/day/title.

You should be good!

Install themes (under Appearance) and plugins and pimp your site out. Everything's all clicky clicky and no typey typey from now on :)

4 comments:

Scott said...

Thank you! Ugh, I struggled with this for hours.

Install WordPress 3 on Ubuntu | TurboLinux Blog said...

[...] Here is a good tutorial show you how to Install WordPress 3 on Ubuntu: Copy and paste these commands into the terminal and press enter (Note, when the blue screen appears use TAB to scroll through the options and SPACE to select them) (Note 2: Im not sure how many times you have to enter a password here but Ive used the same password every-time Ive been asked): [...]

David said...

Awesome tutorial. Cheers!

Jake said...

Is it possible to install wordpress in the parent directory? such as www.site.com instead of www.site.com/wordpress.