1

So, I am pretty new to Apache, haven’t used it very much. But I’m trying to setup a website with it on a raspberry pi. I’ve done Apt-get install apache2 and modified the index.html file in /var/www/html to have a little plain text for testing purposes. I’ve also forwarded port 80 on my router to my pi. When I’m on my WAN I can access the site fine by typing my external IP, but as soon as I go on cellular or a friend’s WiFi I can no longer access the site. Not totally sure what I’m missing. Sorry if it’s a rookie mistake

1

It's likely that your ISP is blocking port 80 if you are on a residential line. The vast majority of ISP's will block a set of specific ports for a number of reasons including safety (cut down on unlisted websites that might be doing illegitimate things), convenience (keep bandwidth open for other traffic) and "because they can". This will not affect traffic from within your network, however it will prevent virtually any outside connections from using your public IP address SPECIFICALLY on port 80.

I have a webserver and my solution to this problem is to change the default port. You can do this in a couple of ways.

  1. On your router: Instead of forwarding port 80 to 80, forward port 60123 to 80, or something similar. This will make your router listen on a non-standard port and forward anything it hears to your raspberry pi on the appropriate port.

  2. On your raspberry pi AND your router: in /etc/apache2 modify the ports.conf file and change port 80 to something else (preferrably above 1024 to avoid getting blocked). Then update your router to this new port, and you should be fine.

Once changed, you'll need to append the port number to your IP address whenever you type it into your web browser, including using simply localhost

eg: http://localhost:10123, http://192.168.1.3:12345

  • I seen this a few times in researching it and didn’t understand what it meant, thankyou for clarifying how to do it! It works perfectly now – Tech_Person Feb 8 at 5:43

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.