# Unable to start lighttpd on alternate port



## KevinOberman (Jul 18, 2014)

I am looking to use lighttpd as a simple web server, to replace the even simpler one I am using now. I want to develop using an alternate port, switching to 80 when all is working correctly.

The problem is that I get:

```
Starting lighttpd.
2014-07-18 12:07:17: (network.c.409) can't bind to port: 0.0.0.0 80 Address already in use 
/usr/local/etc/rc.d/lighttpd: WARNING: failed to start lighttpd
```

My lighttpd.conf file contains:

```
server.port = 3880
```

So, why is it even looking at port 80? I grepped the file and found only the line above containing "80".

Any idea what I can do to get it to honor server.port?


----------



## KevinOberman (Jul 18, 2014)

Never mind. Found it. Either I can't read or can't type. I have it running correctly, now.


----------



## walterbyrd (Jun 24, 2015)

How did you fix this? I am having the same problem.


----------



## junovitch@ (Jun 24, 2015)

Oddly enough, both of these are in the default /usr/local/etc/lighttpd/lighttpd.conf config file.


```
server.port = 80
```
It seems this one gets used as the IPv6 port.  Unless IPv6 is disable were it gets used as an alternate port on IPv4.


```
$SERVER["socket"] == "0.0.0.0:80" { }
```
This one keep it binding on port 80.

I find that to be a confusing default configuration.  I've never used www/lighttpd but setting both to the same port resulted in the correct behavior.


----------

