Tag Archives: Lighttpd

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