# Conflict with other webservices running on Pi (Ports 80 and 443)

**URL:** <https://discourse.pi-hole.net/t/conflict-with-other-webservices-running-on-pi-ports-80-and-443/2329>\
**Category:** Help\
**Created:** [March 21, 2017, 1:44pm UTC](https://discourse.pi-hole.net/t/conflict-with-other-webservices-running-on-pi-ports-80-and-443/2329 "2017-03-21T13:44:06Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [March 22, 2017, 7:19pm UTC](https://discourse.pi-hole.net/t/conflict-with-other-webservices-running-on-pi-ports-80-and-443/2329/8 "2017-03-22T19:19:43Z")

</div>

For example if you want to setup like below:

```
10.0.0.10:80 --> lighttpd (for Pi-Hole)
10.0.0.20:80 --> nginx (your other web apps via HTTP)
10.0.0.20:443 --> nginx (your other web apps via HTTPS)

```

1. In the "interfaces" file, you add alias interface "eth0:0" with second IP:  
\*replace IP address and netmask to suit your needs.

2. Bring up the new interface, including verbose logging, with:

`sudo ifup -v eth0:0`

1. Configure lighttpd to listen to the **eth0** interface IP address:

`echo 'server.bind = "10.0.0.10"' | sudo tee -a /etc/lighttpd/lighttpd.conf`

1. Reload lighttpd settings:

`sudo service lighttpd reload`

1. Have nginx listen to the **eth0:0** interface IP address by adding/changing below in "`nginx.conf`":

- Not sure how to configure nginx as I dont have and have never used before.

1. Reload nginx settings:

`sudo service nginx restart`

1. Check the relevant daemons with:

`sudo netstat -nltup | grep 'Proto\|lighttpd\|nginx\|dnsmasq\|dhcpcd\|pihole-FTL'`

Below the output for netstat as example:

```
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:4711 0.0.0.0:* LISTEN 50/pihole-FTL
tcp 0 0 10.0.0.10:80 0.0.0.0:* LISTEN 100/lighttpd
tcp 0 0 10.0.0.20:80 0.0.0.0:* LISTEN 200/nginx -g daemo
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 300/dnsmasq
tcp 0 0 10.0.0.20:443 0.0.0.0:* LISTEN 200/nginx -g daemo
tcp6 0 0 :::53 :::* LISTEN 300/dnsmasq
udp 0 0 0.0.0.0:53 0.0.0.0:* 300/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 400/dhcpcd
udp6 0 0 :::53 :::* 300/dnsmasq

```

And here is explained how to disable IPv6 if conflicting:

> [@Conflict with other webservices running on Pi (Ports 80 and 443)](https://discourse.pi-hole.net/t/conflict-with-other-webservices-running-on-pi-ports-80-and-443/2329/13):
>
> How is going ? I realized lighttpd still binds to ipv6 and maybe nginx will do so too (netstat -nltp). If so, the two could conflict again at ipv6 level. If you have not setup your network with ipv6, you can disable ipv6 for lighttpd by hashing out below 1 line in "/etc/lighttpd/lighttpd.conf": # include\_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port And reload lighttpd to apply new settings: sudo service lighttpd reload And check again with: sudo netstat -nltp Not sure if you n…

Very important note, if using Pi-Hole as DHCP server, the only way to not have dnsmasq mix up the interfaces is to hash out all static IP address assignments for the "eth0" interface in the "dhcpcd.conf" file eg:

```
sudo nano /etc/dhcpcd.conf

#interface eth0
# static ip_address=10.0.0.10/24
# static routers=10.0.0.1
# static domain_name_servers=10.0.0.1

```

And move the static IP address assignment for "eth0" to the "interfaces" configuration file (hash out existing eth0 line):

```
sudo nano /etc/network/interfaces

#iface eth0 inet manual
auto eth0
allow-hotplug eth0
iface eth0 inet static
  address 10.0.0.10
  netmask 255.255.255.0
  gateway 10.0.0.1

```

And make sure a DNS nameserver is set in the "resolv.conf" file eg:

```
sudo nano /etc/resolv.conf

# Local Pi-Hole DNS service
nameserver 127.0.0.1

```

---

_[View the full topic](https://discourse.pi-hole.net/t/conflict-with-other-webservices-running-on-pi-ports-80-and-443/2329)._
