Put sites on different ports with Lighttpd web server

Maybe you want to have your personal www directory/web service/anything on a separate port on your “lighty” web server. This is easily accomplished by just adding a setting to your lighttpd.conf (/etc/lighttpd/lighttpd.conf):

$SERVER["socket"] == ":81" {
        server.document-root        = "/home/user/www"
}

This will redirect all traffic to port 81 to ‘/home/user/www’

To add more ports just create another entry in the lighttpd.conf file

Also make sure your firewall allows traffic on the desired port and that lighttpd has the rights to read you new webroot!

Tested on Debian Lenny (ARM) running on a Linksys NSLU2

  1. Thanks mate just was I was looking for works great!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

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