VMware Communities
rherrick
Contributor
Contributor
Jump to solution

Can't connect to web server port 80 on guest Ubuntu from host

I have a very strange problem. I've been running an Ubuntu 14.04 VM on my MBP under VMware Fusion for quite some time. I re-installed Yosemite over the weekend for a clean install to try to fix some issues I was having. I've now got my Ubuntu VM back up and running. Everything is fine except that I can't hit the web server on the VM any more.

I can access the VM in a variety of different ways!

  • ping: I can ping it
  • ssh: I can ssh into it
  • psql: I can remotely connect to the database via port 5432
  • nfs: I can mount folders from the VM to folders on my local hard drive
  • Tomcat: I can access my web application directly through Tomcat on port 8080

When I do a port scan of the VM, I get this:

Port Scan has started…

Port Scanning host: 10.39.186.13

     Open TCP Port:     22             ssh

     Open TCP Port:     111            sunrpc

     Open TCP Port:     389            ldap

     Open TCP Port:     2049           nfsd

     Open TCP Port:     5001           commplex-link

     Open TCP Port:     5432           postgresql

     Open TCP Port:     8000           irdmi

     Open TCP Port:     8080           http-alt

     Open TCP Port:     8104

     Open TCP Port:     37805

     Open TCP Port:     41301

     Open TCP Port:     42060

     Open TCP Port:     55224

     Open TCP Port:     60974

Port Scan has completed…

Port 80 doesn't even show there. From the VM itself, I can access the site through port 80:

xnat@xnatdev:~$ wget http://xnatdev.wurstworks.com

--2015-06-22 11:20:50--  http://xnatdev.wurstworks.com/

Resolving xnatdev.wurstworks.com (xnatdev.wurstworks.com)... 127.0.0.1

Connecting to xnatdev.wurstworks.com (xnatdev.wurstworks.com)|127.0.0.1|:80... connected.

HTTP request sent, awaiting response... 302 Found

Location: http://xnatdev.wurstworks.com/app/template/Login.vm;jsessionid=18A2C3A7C7AB6A63F39F7AC49E54FCD4 [following]

--2015-06-22 11:20:50--  http://xnatdev.wurstworks.com/app/template/Login.vm;jsessionid=18A2C3A7C7AB6A63F39F7AC49E54FCD4

Reusing existing connection to xnatdev.wurstworks.com:80.

HTTP request sent, awaiting response... 200 OK

Length: unspecified [text/html]

Saving to: ‘index.html’

    [ <=>                                                                                         ] 12,818      --.-K/s   in 0.001s

2015-06-22 11:20:50 (11.2 MB/s) - ‘index.html’ saved [12818]

But from the host OS, I get this:

rherrick@Aerys:~$ wget http://xnatdev.wurstworks.com

--2015-06-22 11:21:50--  http://xnatdev.wurstworks.com/

Resolving xnatdev.wurstworks.com... 10.39.186.13

Connecting to xnatdev.wurstworks.com|10.39.186.13|:80... failed: Connection refused.

I've tried switching between NAT and bridged networking (I know that I had it working with NAT before, but I'm willing to try anything at this point).

I am on OS X 10.10.3 and the latest and greatest VMware Fusion 7.1.2. Any ideas on how to get this working would be greatly appreciated!

0 Kudos
1 Solution

Accepted Solutions
rherrick
Contributor
Contributor
Jump to solution

OK, got it working. The issue was the listen directive in the nginx configuration for the Tomcat connection. I had it set to the FQDN and port 80 of the server, but something I did made the FQDN resolve to 127.0.0.1 instead of the DHCP-issued IP. So that didn't work because the incoming request was to the FQDN from the host OS, which is configured in my /etc/hosts, so nginx didn't pair together the nginx configuration for the domain since the listen was screwed up.

View solution in original post

0 Kudos
1 Reply
rherrick
Contributor
Contributor
Jump to solution

OK, got it working. The issue was the listen directive in the nginx configuration for the Tomcat connection. I had it set to the FQDN and port 80 of the server, but something I did made the FQDN resolve to 127.0.0.1 instead of the DHCP-issued IP. So that didn't work because the incoming request was to the FQDN from the host OS, which is configured in my /etc/hosts, so nginx didn't pair together the nginx configuration for the domain since the listen was screwed up.

0 Kudos