0

I have set up Apache on Ubuntu 12.04 inside of an AWS VPC. The Apache server is in a private subnet accessible through a NAT. I am able to access Apache on port 80 as expected from the server itself (even using the IP Address rather than 127.0.0.1). When I try and access the server from a remote server (NAT in this case) I get a 404 error from Apache. This does not appear to be a networking issue. I am able to connect to the Apache server on 80 using telnet. I am using wget to test if I can retrieve a document from the Apache server (also gets a 404).

Apache is configured to "Listen 80" and the virtual host is also "*:80". Does anyone have any ideas what might be limiting access from remote hosts?

Thanks.

Edit: I spun up another Ubuntu 12.04 instance (same AMI) in the same subnet, installed Apache and everything seems to be working as expected, meaning I can access index.html from localhost, from a remote host in the same subnet, and from the NAT instance. Both of these were stock Apache installs using "sudo apt-get install apache2". I'm trying to detect any differences now. BTW, no iptables running on either instance.

3
  • 1
    Have you checked what apache logs say?
    – ptman
    Jun 23, 2014 at 19:10
  • Yes. I get nothing in the access log when attempting to connect from a remote host. I get nothing in the error log either. When I connect locally, I get one entry in the access log as expected. Jun 23, 2014 at 20:17
  • Have you tried using telnet from a remote host to see if port 80 is open?
    – Andrew M.
    Jun 24, 2014 at 18:10

2 Answers 2

0

If you are trying to connect to the site via DNS name, you should set the "ServerName" directive in the VirtualHost section. I had similar problems with my last Apache install with multiple virtual hosts.

2
  • I am not. I am connecting via (private) ip address i.e. 10.0.3.53/index.html. Also I have only 1 virtual host configured (OOTB Ubuntu install). Jun 23, 2014 at 18:57
  • Maybe try adding "ServerName 10.0.3.53" into your VirtualHost container. Jun 23, 2014 at 19:50
-1

It turns out there was a NAT entry in iptables that forwarded 80 to 8080 (tomcat). It didn't show up with a "sudo iptables --list". I flushed the table and it started working.

Thanks for everyone who helped.

1
  • iptables -t nat then.
    – towo
    May 26, 2015 at 20:49

You must log in to answer this question.

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