Project

General

Profile

(network.c.358) can't bind to port

Added by stiggz over 13 years ago

Hi, I'm trying to get lighttpd set up on the Amazon EC2 service. I'm running the EC2 RPM based linux distribution. To install lighttpd I simply ran:

yum install lighttpd

Which installed with no problem, but I'm having trouble properly configuring my lighttpd.conf file. When I try to start up lighty, I get the following error:

(network.c.358) can't bind to port: 107.22.000.000 80 Cannot assign requested address

I know it's the correct IP, because I'm sshing into the machine using the same IP I am trying to bind lighty to. If I change the server.bind to "localhost" it starts up just fine, but then I can't access the webpage from a remote computer. If I add the server.ipv6="enable" setting, I get a different error:

(network.c.261) getaddrinfo failed: Address family for hostname not supported ' 107.22.000.000 '

lighttpd.conf looks like this (changed actual IP values for 0s):

@server.document-root="/var/www/lighttpd"
server.port=80
server.username="lighttpd"
server.groupname="lighttpd"
server.bind="107.22.000.000"
#server.bind="www.ec2-50-19-000-000.compute-1.amazonaws.com"

server.tag="lighttpd"
server.errorlog="/var/log/lighttpd/error.log"

accesslog.filename="/var/log/lighttpd"
index-file.names=("index.php", "index.html")
server.modules=(
"mod_access",
"mod_accesslog",
"mod_fastcgi",
"mod_rewrite",
"mod_auth")

mimetype.assign=(
".pdf"=>"application/pdf",
".sig"=>"application/pgp-signature")@

Any ideas?

Thanks,
Zach


Replies (2)

RE: (network.c.358) can't bind to port - Added by stbuehler over 13 years ago

Looks like you forgot to mention that you solved the issue.

For future reference: with elastic ip you can't bind to the public visible ip, bind to 0.0.0.0 instead (or just don't set it at all). and don't forget to allow http in the security groups.

and: if something doesn't work, have a look at the errorlog.

    (1-2/2)