Sunday, October 7, 2012

Starting lighttpd: (network.c.358) can't bind to port: 80 Address already in use

Recently I had the error message appearing when trying to launch my PB on my Ubuntu machine:
Starting lighttpd: (network.c.358) can't bind to port:  80 Address already in use 

Turns out there are quite a few old forum threads on this topic where the issue comes down to one of 2 things:

  1. Another webserver application is running (like apache)To solve this issue check what is running on port 80 by:
    sudo fuser -v 80/tcp
    And then kill or remove this application.
  2. IPv6 is causing some issues in the lighttpd.conf file
    Open lighttpd.conf file in any text editor and comment the line
    include_shell "/usr/share/lighttpd/use-ipv6.pl"
    with a #, so:
    #include_shell "/usr/share/lighttpd/use-ipv6.pl"
    Although in case of the PirateBox script package, this comes ready and set.

My personal issue was that somehow I had apache2 webserver installed on my system. I do not remember installing it, but now it has been removed and lighttpd is starting/running just fine. So if anyone is having a similar issue, you may want to check out these 2 possible issues.

1 comment:

  1. From webpage http://www.penguintutor.com/linux/light-webserver
    sudo apt-get install php5-common php5-cgi php5

    Note it's important to install in the order listed above. If you try to install php5 without first installing the php5-cgi package then it will install Apache as well, which we don't want for this light-weight lighttpd server.

    ReplyDelete