Make lighttpd listen on multiple ports

I have a lighttpd server running on an AWS EC2 instance. It can serve port 80 (or any other port if I change server.port in the /etc/lighttpd/lighttpd.conf file) without problems. However, when I serve an alternate root directory on another port (say, 8080), browsers will never be able to connect to the server.

The corresponding section of my lighttpd.conf file is:

server.port = 80 ## ## Use IPv6? ## server.use-ipv6 = "disable" ## ## bind to a specific IP ## #server.bind = "localhost" ## ## Run as a different username/groupname. ## This requires root permissions during startup. ## server.username = "lighttpd" server.groupname = "lighttpd" ## ## enable core files. ## #server.core-files = "disable" ## ## Document root ## server.document-root = server_root + "/release" $SERVER["socket"] == ":8080" { server.document-root = server_root + "/dev" } 

Full file here

The site based on server_root + "/dev" works fine - I tested it by changing their port assignments, and in this case / dev loads normally: 80 and / release were not found.

I read numerous manuals (e.g. here , white papers , here , etc.) to no avail. The first of them said that a firewall conflict could occur, but I don’t know how to resolve it on EC2, and the fact that I can set server.port=8080 without problems makes me think that this is not a problem.

Both folders belong to my user lighttpd , which has full rights in both folders.

I do not see anything in the log files when accessing <my address>:8080 .

+4
source share
1 answer

Oops, now I can answer my question.

It was a firewall problem, but it was very easy to fix - go to console.aws.amazon.com (log in if necessary), select the appropriate security group and add a firewall rule that allows incoming traffic on this port - either from a specific source, if you want to restrict access, or from 0.0.0.0/0 for universal access.

+2
source

All Articles