# Lighhtpd not started

**URL:** <https://discourse.pi-hole.net/t/lighhtpd-not-started/62847>\
**Category:** Community Help\
**Tags:** lighttpd\
**Created:** [May 8, 2023, 8:38pm UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847 "2023-05-08T20:38:01Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 8, 2023, 8:38pm UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/1 "2023-05-08T20:38:01Z")

</div>

**The issue I am facing:**  
Service lighttpd starting but stops shortly after.  
Message in /var/log/syslog:  
can't bind to socket: 0.0.0.0:80: Address already in use  
or  
can't bind to socket: 192.168.139.235:80: Address already in use

**Details about my system:**  
Ubuntu 22.04.2 LTS on bare metal  
Pihole v5.16.2  
FTL v5.22  
Web v5.19

**What I have changed since installing Pi-hole:**  
Added the file external.conf in /etc/lighttpd.  
Added one line in that file: server.port = 88  
Tried also with server.port := 88 and adding server.bind = "192.168.139.235"  
None of this worked - looks like the file is not read.

Edited the file /etc/lighttpd/lighttpd.conf and replaced server.port = 80 with server.port = 88. Now works as expected.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![tomporter518](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/tomporter518/32/3504_2.png) [@tomporter518](https://discourse.pi-hole.net/u/tomporter518)\
**Post date:** [May 8, 2023, 8:43pm UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/2 "2023-05-08T20:43:21Z")

</div>

That error message is your biggest clue. Something else is running which is binding to port 80 before lighttpd can. This would often be another web server, Apache, Ngnix, etc. If you aren't using that service, you could disable it.

BTW, the external.conf file is no longer used. In the release notes of one of the recent updates, it is noted to use an alternative file structure.

---

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 8, 2023, 9:00pm UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/3 "2023-05-08T21:00:31Z")

</div>

Thank you for the quick response.  
Yes - another service is running on port 80 - hence the switch to port 88.

Will try to find out what this is.

---

<div class="post-metadata">

**Author:** ![rdwebdesign](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rdwebdesign/32/51363_2.png) [@rdwebdesign](https://discourse.pi-hole.net/u/rdwebdesign)\
**Post date:** [May 9, 2023, 12:28am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/4 "2023-05-09T00:28:16Z")

</div>

> [@NogNeetMachinaal](#):
>
> Added the file external.conf in /etc/lighttpd.

Are you updating an older Pi-hole installation or did you install fresh?

The `external.conf` file was used on older versions. If you are updating previous versions, this should work.

If you are on a fresh install, you can create a file in `/etc/lighttpd/conf-enabled/15-pihole-admin-port.conf` with the same code you use in your `external.conf`.  
_(you can use a different file name, if you like)_

---

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 9, 2023, 4:43am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/5 "2023-05-09T04:43:59Z")

</div>

I did a fresh install.

As suggested (thank you 🙂):  
I moved the external.conf to "../conf-enabled" and renamed it to 15-server-port.conf, preserving its content.

The result is the same - its just a different error message.

The error is now about having the parameter server.port mentioned in 2 config files. If I comment this parameter out in lighttpd.conf then the service is started with the port mentioned in 15-server-port.conf.

Assuming this works-as-designed:  
What will happen if pihole is updated with a new version of lighttpd? Is this lighttpd.conf then overwritten? And with the same result?

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [May 9, 2023, 6:19am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/6 "2023-05-09T06:19:00Z")

</div>

Please upload a debug log and post **just the token URL** that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

```auto
pihole -d

```

or do it through the Web interface:

_ **Tools \> Generate Debug Log** _

---

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 9, 2023, 6:36am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/7 "2023-05-09T06:36:53Z")

</div>

This was generated utilizing the web interface:  
[https://tricorder.pi-hole.net/o9dm5jV2/](https://tricorder.pi-hole.net/o9dm5jV2/)

Thank you - Will

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [May 9, 2023, 6:53am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/8 "2023-05-09T06:53:06Z")

</div>

Run from your Pi-hole machine, what's the output of:

```auto
sudo grep server.port /etc/lighttpd/conf-enabled/*.conf /etc/lighttpd/*.conf

```

---

<div class="post-metadata">

**Author:** ![rdwebdesign](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rdwebdesign/32/51363_2.png) [@rdwebdesign](https://discourse.pi-hole.net/u/rdwebdesign)\
**Post date:** [May 9, 2023, 6:56am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/9 "2023-05-09T06:56:55Z")

</div>

Your debug log shows `lighttpd` is using port `88` and `nginx` is using a few ports, including port `80`:

```auto
*** [DIAGNOSING]: Ports in use
    ...
    tcp:0.0.0.0:88 is in use by lighttpd
    ...
    tcp:0.0.0.0:443 is in use by nginx
    tcp:0.0.0.0:99 is in use by nginx
[✗] tcp:0.0.0.0:80 is in use by nginx (https://docs.pi-hole.net/main/prerequisites/#ports)

```

---

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 9, 2023, 8:16am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/13 "2023-05-09T08:16:55Z")

</div>

Yes - correct - I am aware of that.  
Hence the wish for reconfiguring to port 88.

---

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 9, 2023, 8:18am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/14 "2023-05-09T08:18:56Z")

</div>

> [@Bucking\_Horn](#):
>
> `sudo grep server.port /etc/lighttpd/conf-enabled/*.conf /etc/lighttpd/*.conf`

sudo grep server.port /etc/lighttpd/conf-enabled/_.conf /etc/lighttpd/_.conf  
/etc/lighttpd/conf-enabled/15-server-port.conf:server.port = 88  
/etc/lighttpd/lighttpd.conf:#server.port = 80  
/etc/lighttpd/lighttpd.conf:#include\_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [May 9, 2023, 8:44am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/15 "2023-05-09T08:44:26Z")

</div>

> [@NogNeetMachinaal](#):
>
> /etc/lighttpd/conf-enabled/15-server-port.conf:server.port = 88

That line should use the replacement operator (`:=`), i.e. `server.port := 88`.

Also note that by convention, your 15-server-port.conf should go to ../conf-available/, with ../conf-enabled/ just containing the respective link to ../conf-available/15-server-port.conf.  
That is by no means a hard requirement, but sticking to that convention would allow you to disable a specific \*.conf by removing the link from ../conf-enabled/, whithout losing its actual contents, so it can be later re-enabled by re-adding the link in ../conf-enabled/.

---

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 9, 2023, 10:11am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/16 "2023-05-09T10:11:30Z")

</div>

Thank you - this one did it (almost):  
While IPv6 is disabled via sysctl, lighttpd still starts with IPv6 on port 80 - not 88.  
Is there a way to disable this? Or at least reflect port 88?

This was already noticed previously but not mentioned in the initial post:  
When doing "service lighttpd status" it says:  
`Warning: mod_auth should be listed in server.modules before dynamic backends such as mod_fastcgi`

What does this mean? Should I make other config changes?

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [May 10, 2023, 5:24am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/17 "2023-05-10T05:24:19Z")

</div>

> [@NogNeetMachinaal](#):
>
> While IPv6 is disabled via sysctl, lighttpd still starts with IPv6 on port 80 - not 88.

How did you observe this?

Your debug log showed lighttpd to be listening on port 88 for IPv4 exclusively:

```auto
*** [DIAGNOSING]: Ports in use
(...)
  tcp:0.0.0.0:88 is in use by lighttpd

```

In fact, there is not a single port tied to an IPv6 address in your debug log, and there is also no IPv6 address tied to any of your 20 different network interfaces.

---

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 10, 2023, 5:49am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/18 "2023-05-10T05:49:25Z")

</div>

That's correct. 🙂

The IPv6 parts are disabled in sysctl.  
Any leftovers are removed by changing the respective config files.  
Like for example with the ssh service and the nginx services.

The file lighttpd.conf has this line:  
`include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port`

This line was commented out during the debug run... 😇

If I leave this line active and do `ss -tulpn | grep 80`, it shows:  
`tcp LISTEN 0 1024 [::]:80 [::]:* users:(("lighttpd",pid=57231,fd=4))`

Among a few other lines already in the debug file. 😊

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [May 10, 2023, 5:59am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/20 "2023-05-10T05:59:40Z")

</div>

> [@NogNeetMachinaal](#):
>
> The file lighttpd.conf has this line:  
> `include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port`

That script is part of the _`lighttpd`_ package.  
The script is called with the correct parameter, but your observation would suggest that it may not honor your custom port override from another custom configuration file

I'm undecided whether that script should or could be fixed by lighttpd or avoided by Pi-hole.  
Also, a Pi-hole fix seems less likely (unless it would be really easy), as we are busy working on v6, which wouldn't include lighttpd as dependency anymore.  
We'll discuss that within the team.

In the meantime, is that causing real issues for you, even though IPv6 seems disabled on that host?  
If so, you should probably keep that line commented out.

---

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/nogneetmachinaal/32/30554_2.png) [@NogNeetMachinaal](https://discourse.pi-hole.net/u/NogNeetMachinaal)\
**Post date:** [May 10, 2023, 6:05am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/21 "2023-05-10T06:05:49Z")

</div>

That is correct. The output from `ss -tulpn | grep lighttpd` is:

```auto
tcp LISTEN 0 1024 0.0.0.0:88 0.0.0.0:* users:(("lighttpd",pid=57231,fd=5))                                                          
tcp LISTEN 0 1024 [::]:80 [::]:* users:(("lighttpd",pid=57231,fd=4))

```

Which shows that this included script doesn't take the override into account - it is still looking at the original `server.port`?

I don't have an issue with this - its more of a cosmetic thing because there is no IPv6 active on any of the interfaces.

---

<div class="post-metadata">

**Author:** ![rdwebdesign](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rdwebdesign/32/51363_2.png) [@rdwebdesign](https://discourse.pi-hole.net/u/rdwebdesign)\
**Post date:** [May 10, 2023, 7:36am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/23 "2023-05-10T07:36:13Z")

</div>

> [@NogNeetMachinaal](#):
>
> Which shows that this included script doesn't take the override into account - it is still looking at the original `server.port`?

Apparently the new value is not take into account because `lighttpd.conf` is loading the new values only after this script is executed.

If you like to test, reversing the order of this 2 lines and restarting `lighttpd` will fix the IPv6 port.

Open `/etc/lighttpd/lighttpd.conf` and find these lines:

```conf
   include_shell "/usr/share/lighttpd/create-mime.conf.pl"
   include "/etc/lighttpd/conf-enabled/*.conf"

```

Change their order to:

```conf
   include "/etc/lighttpd/conf-enabled/*.conf"
   include_shell "/usr/share/lighttpd/create-mime.conf.pl"

```

After restarting `lighttpd` the `ss` output will show the correct port for ipv6:

```auto
...
tcp LISTEN 0 1024 0.0.0.0:88 0.0.0.0:*                            
tcp LISTEN 0 32 [::]:53 [::]:*                            
tcp LISTEN 0 1024 [::]:88 [::]:*  

```

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [May 31, 2023, 7:36am UTC](https://discourse.pi-hole.net/t/lighhtpd-not-started/62847/24 "2023-05-31T07:36:50Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
