Home » Misc Tech Stuff, Planet Ubuntu

Setting up a WordPress Blog on Lighttpd with Pretty URLs

7 March 2009 22,724 views 13 Comments

Now that we have our LLMP Stack setup, we can setup our WordPress Blog. Because Lighttpd does not use a .htaccess file like Apache does, we need to create rewrite rules and put them in the Lighttpd configuration. These are the easiest rewrite rules out there as there is only one line.

All you have to do is add the following line to your vhost.

server.error-handler-404 = “/index.php”

So lets create our vhost. I prefer to create each vhost in a seperate file. We are going to create the vhost for chrisjohnston.org. To start lets create the file:

# sudo nano /etc/lighttpd/chrisjohnston.org.conf

and then add the following code:

$HTTP["host"] =~ "(^|\.)chrisjohnston\.org$" {
        server.document-root = "/www/chrisjohnston.org/www/htdocs/"
        server.errorlog = "/www/chrisjohnston.org/www/logs/error.log"
        accesslog.filename = "/www/chrisjohnston.org/www/logs/access.log",
        server.error-handler-404 = "/index.php"

Now exit out of your vhost configuration file. We need to add chrisjohnston.org.conf to our lighttpd.conf so that it will recognize it.

sudo nano /etc/lighttpd/lighttpd.conf

Now all the way at the bottom add the following line:

include “chrisjohnston.org.conf”

Exit out of the lighttpd.conf file and restart lighttpd.

sudo /etc/init.d/lighttpd restart

Don’t forget to change your DNS if you need to. Your WordPress install should now be working and have the ability to have “Pretty URL’s.”

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)


Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.