0

I'm running apache on a raspberry pi behind my firewall and trying to serve a static index.html from it. I have a domain example.com registered and pointed at my public IP by a DNS service, and my router is forwarding port 80 requests to the raspberry pi

When I try to reach example.com, my public IP/index.html, or the pi's private IP/index.html chrome produces This site can't be reached. The fact that the error is the same regardless of trying to contact via IP or domain name tells me the problem is not with the DNS service.

Presumably then the problem is with Apache.

1) The apache2 service is running, though I'm not sure why there are so many processes for it: ps aux | grep apache2

root     10857  3.3  2.0  95976 19668 ?        Ss   22:21   0:00 /usr/sbin/apache2 -k start
www-data 10860  0.0  0.6  96000  5768 ?        S    22:21   0:00 /usr/sbin/apache2 -k start
www-data 10861  0.0  0.6  96000  5768 ?        S    22:21   0:00 /usr/sbin/apache2 -k start
www-data 10862  0.0  0.6  96000  5768 ?        S    22:21   0:00 /usr/sbin/apache2 -k start
www-data 10863  0.0  0.6  96000  5768 ?        S    22:21   0:00 /usr/sbin/apache2 -k start
www-data 10864  0.0  0.6  96000  5768 ?        S    22:21   0:00 /usr/sbin/apache2 -k start
server   10874  0.0  0.2   4156  1976 pts/0    S+   22:21   0:00 grep --color=auto apache2

2) The apache config file defines the root directory as /var/www/html which is where index.html is located.

3) netstat -tulpn | grep apache2:

tcp6       0      0 :::80                   :::*                    LISTEN      10857/apache2

Any ideas?

4
  • Are you using a residential ISP? Commented May 13, 2016 at 22:40
  • Yes, but as of a few days ago they were not blocking traffic on port 80. I was able to contact a separate server on the pi (which is not currently running).
    – aeb0
    Commented May 13, 2016 at 22:42
  • To be sure, forward a non standard port from your router to your PI's port 80 and try it with that port. If that fails, also try disabling the firewall on the PI. Commented May 13, 2016 at 22:49
  • And of course try to load the page with the local IP to see what happens. Commented May 13, 2016 at 22:52

1 Answer 1

0

sorry for the obvious question but..." Can you reach the website using your internal network ip address from another computer on your local network"?

Turn off your iptables program. Perhaps your local firewall on the rasberry pi is blocking traffic. ubuntu --> sudo ufw disable other --> service iptables stop

1
  • This is poor security practise. Confirm the service is listening on the port with netstat. If so, run a port scan from a host on the same LAN with nmap to see if the port is open. If it is not, it is a firewall issue and you should configure iptables to accept connections to it.
    – Dylan Knoll
    Commented May 13, 2016 at 23:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .