Installing wordpress and lighttpd on ubuntu

July 7, 2008 – 1:28 am

My blog is finally up ! But it’s a wordpress blog, not one that I made myself in python. Wordpress is great as a tool. Simple enough, functional enough, I wish it was written in python for me to extend. Anyway, let’s forget python for a second and go into how I installed wordpress.

It’s a brand new server that I ordered this evening at ovh for 20€/month and that I could connect to in less than an hour. It has an ubuntu 8.04 server on it. I would have chosen a debian server if it was more up to date … unfortunately it’s not, so ubuntu it was. I could have been tempted by archlinux which I’m probably going to move to on my desktop, but it was not proposed.

Apache is too big and complicated so I chose lighttpd. So now I need to install lighttpd php and mysql to run wordpress. In all the following commands I assume you are the root user.

$ apt-get install lighttpd php5-cgi php5-mysql mysql-server

Let’s add a database for wordpress.

$ mysql -u root -p
mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO "wordpress"@"hostname"
       IDENTIFIED BY "your password";
mysql> FLUSH PRIVILEGES;
mysql> EXIT;

That’s it the wordpress database was created. Oh yeah and put your password instead of your password !

Now let’s download wordpress and put it in /var/www

$ cd /var/www
$ wget http://wordpress.org/latest.tar.gz
$ tar -xzf latest.tar.gz
$ mv wordpress/* .
$ rm -rf wordpress
$ mv wp-config-sample.php wp-config.php

And we need to configure wordpress so that it connects to our mysql database. For that we need to edit the wp-config.php file. You can use vim or nano at you convenience. You can also edit it with gedit if you want: just type ssh://root@yourserverip/var/www in nautilus and you’ll be in your remove folder and you’ll be able to edit wp-config with gedit.

So put the following informations in the file:

define('DB_NAME', 'wordpress');    // The name of the database
define('DB_USER', 'wordpress');     // Your MySQL username
define('DB_PASSWORD', 'your password'); // ...and password

Save it.

Load mod-fascgi for lighttpd.

$ lighty-enable-mod fastcgi

Restart it.

$ /etc/init.d/lighttpd restart

That’s it wordpress is installed. Well everything on the server at least. You now need to connect to your server to finish the installation and configure wordpress.

So go to http://your_domain_name_or_ip/ in your web browser.

One last thing wordpress use the domain name or ip address that you use the first time you connect to it as it’s default address. To change that go in setting in your blog admin.

Post a Comment