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

Comments are closed.

Niklas Tech Blog
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.