I'm trying to create a basic web server. I am running Ubuntu 12.04 desktop. I have installed LAMP and set up html files, and when I open a browser and navigate to 192.168.1.95 (static internal IP of my server), or 192.168.2.2, the modified index.html file that came with Apache2 appears on screen. The problem is with connecting through internet, rather than intranet. I have used a cell phone (WiFi disabled) to connect through the cell network, as well as giving my external IP to a friend, and asking him to try to open the site. Each time, however, we receive error 502 Bad Gateway - Response Error, a bad response was received from another proxy server or the destination origin server.
Let me say that I have already gotten disabled the remote configuration option in my router, so that's not the problem, and I have already forwarded port 80 through my router. Yes, I'm pretty sure I did it right. In fact, to test that the router wasn't the problem, I connected my server directly to my modem, which does NOT have an internal router, and still got the same error. A Google search has told me that my ISP (CenturyLink) does not block port 80, and that others with the same ISP have been successful in hosting their own sites from home. Obviously I'm not very knowledgeable about this subject, but from my understanding, I've ruled out everything except the server, which means that something is either blocking port 80 on the way in, or the data is never making it back out. My question is this:
Is there something (firewall, etc.) in Ubuntu that could be responsible for such an error?
I have already enabled, disabled, and opened holes through UFW, and that hasn't made a difference. One tutorial I read suggested that AppArmor could be a problem, and they suggested that it be uninstalled, so I followed their instructions on how to do so, but I have noticed that there is still an AppArmor folder in /etc/, so I'm not exactly sure what all got done. If there is any other information you could give me, I would truly appreciate it. In the event that I overlooked some blatantly obvious solution, I'm really sorry to bother you all, but it hasn't been for lack of effort; I've been working on this for the vast majority of the past two days...
Also, I'm not sure if it makes any difference, or if this is actually related, but I'm having the same problem with SSH; I can SSH into this system over my local network using username@local_IP, but I can't get it to work over a non-local network (yes, I do realize that I need more than just a local IP) Maybe this helps narrow down the problem, then again, maybe not...
Thanks in advance for your time and support!!!
Once you can connect to HTTP/SSH from the local network, the rest is totally beyond control of your Ubuntu machine - it is most definitely either a mis-configuration of the router, your ISP blocking ports, you trying the wrong external IP address or something else.
The 502 error suggests that your requests go through some kind of a proxy, which also may complicate the matter. If you can't access the server, you should be getting a connection timeout, not a response from some proxy.