Initial install of PH - question regarding lighttpd on a different port

The documentation says if I have apache listening on 80 i need to set lighttpd on a different port.
I thought I will get a chance to configure the alternative port during the installation.
I wasn't asked which port should I have the PH listen on - I thou
But the PH seems to work fine (at least the two devices I connected are seen on the web admin dashboard and that queries are being blocked)

So what's the deal with making lighttpd listen on a different port

sherab# netstat -tupln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      992/mariadbd        
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      6725/pihole-FTL     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      954/sshd: /usr/sbin 
tcp        0      0 127.0.0.1:4711          0.0.0.0:*               LISTEN      6725/pihole-FTL     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      7548/cupsd          
tcp        0      0 0.0.0.0:5230            0.0.0.0:*               LISTEN      1406/rootlesskit    
tcp6       0      0 :::53                   :::*                    LISTEN      6725/pihole-FTL     
tcp6       0      0 :::22                   :::*                    LISTEN      954/sshd: /usr/sbin 
tcp6       0      0 :::80                   :::*                    LISTEN      1210/apache2        
tcp6       0      0 :::443                  :::*                    LISTEN      1210/apache2        
tcp6       0      0 :::5230                 :::*                    LISTEN      1406/rootlesskit    
tcp6       0      0 ::1:4711                :::*                    LISTEN      6725/pihole-FTL     
tcp6       0      0 ::1:631                 :::*                    LISTEN      7548/cupsd          
udp        0      0 0.0.0.0:44821           0.0.0.0:*                           665/avahi-daemon: r 
udp        0      0 0.0.0.0:53              0.0.0.0:*                           6725/pihole-FTL     
udp        0      0 0.0.0.0:631             0.0.0.0:*                           7552/cups-browsed   
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           665/avahi-daemon: r 
udp6       0      0 :::53                   :::*                                6725/pihole-FTL     
udp6       0      0 fe80::a9ab:8605:89a:546 :::*                                776/NetworkManager  
udp6       0      0 :::52012                :::*                                665/avahi-daemon: r 
udp6       0      0 :::5353                 :::*                                665/avahi-daemon: r 
root@raspberrypi:/home/sherab# 

When you have a different web server running on port 80, you have 3 options:

  1. Disable the current web server before install Pi-hole. In this case, Pi-hole web interface will be served by lighttpd using port 80.

  2. Keep your current web server running, install lighttpd and configure lighttpd to use a different port. In this case your current server will still use port 80 and Pi-hole web interface will be served by lighttpd using a different port.

  3. Do not install lighttpd at all and use your current web server. In this case Pi-hole web interface will be served by your web server. Also, you will need to be configured the web server to execute PHP files.

During Pi-hole installation, you are asked whether you want to install the webserver, and the same happen's for the web interface.

If you already run a webserver (like Apache), then you do not need to install Pi-hole's web server (currently, lighttpd), just the web interface.

Only if you decide to installed lighttpd beside Apache, then you'd have to move one of them to a different port.

Since your netstat output shows lighttpd is not listening on any port, you either opted to skip Pi-hole's web server installation, or lighttpd failed to start, as port 80 was already taken by Apache.

In any case, if you can access Pi-hole's web UI, it is Apache that is serving it.
But note that you'd commonly have to adopt Apache in order to make it serve Pi-hole's web UI.

If it works for you now, you do not have to change anything (except uninstalling lighttpd, perhaps).

It works for now

I can access the web UI without having done any adjusments to Apache

That resolves my question.

Thank you

I have two other services on the Pi - Nextcloud and Memos
If I disabled the Apache - and run the lighttpd - how will I make those other services work?

at the moment PH works - aparently with the apache I alread have installed.
Is it worthwhile the hassle to change things?

How?

That would be a question for the respective maintainers of those services.
Do those other services offer to install their web interface to be used with a different web server?

If not, I'd stick with Apache.
I'd probably stick with Apache either way, as your current config seems to be working.

As for the following remarks:

Since you report Pi-hole's web UI as working, it seems reasonable to assume that -by chance- some of the other services you run already configured Apache to be fit for serving Pi-hole's UI.

1 Like

In your specific case, everything is already working and you don't need lighttpd or change your config.

My previous answer was written before you said you have other PHP interfaces on your system.
Your Apache is already configured to execute PHP (Nextcloud interface uses PHP).

1 Like

Thank you

Thank you

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