VirtualBox webserver not accessbile on host browser

1

0

I setup and installed a CentOS6 webserver on a virtualbox.

Already setup port-forwarding of port 4444 to 80 so that I can access it and even disabled Win7 firewall.

I think that probably the problem is in apache httpd so I install lynx and I can view the test.html I created. But I can't access it in the host browser.

ifconfig says the guest ip is 10.0.2.15 so when I try to access it in my web browser on i type : http://10.0.2.15:4444

I don't know what's wrong with my setup

EDIT: 127.0.0.1:4444 doesn't work either

EDIT: Switched network type to bridged networking, still has windows firewall disabled, removed port-forwarding setting on virtualbox and I still could not access the web server. :(

MegaNairda

Posted 2012-07-04T05:00:15.437

Reputation: 679

1

If you are portforwarding+NAT rather than using bridged networking, you would be accessing this from the host on http://127.0.0.1:4444

– Paul – 2012-07-04T05:13:45.027

@Paul 127.0.0.1:4444 still doesn't work – MegaNairda – 2012-07-04T05:37:40.927

It sounds like the Linux server is running on 80 and you're forwarding that to 4444 on the Windows host so you can access from other machines? If so, 10.0.2.15:80 on the host machine should work, and host-machine-LAN-IP:4444 should work elsewhere on your physical network. Any particular reason for not using bridged networking? – Vickash – 2012-07-04T05:55:35.857

@Vickash 10.0.2.15:80 doesn't work either. I just simply want to access the web server on my host PC. I have now switched to bridged networking. Guest OS has internet, but still could not access it. – MegaNairda – 2012-07-04T06:19:47.223

If you have switched to bridged networking, then the IP address on the server should be different, and now reside in the same subnet as your host (if it did prior to the switch, then that was probably the reason it didn't work - natted networks are on their own subnet). Can you ping it? – Paul – 2012-07-04T06:23:51.583

@Paul yes, the IP is different and I can ping to it – MegaNairda – 2012-07-04T06:25:41.773

Answers

0

Finally found the cause. Apparently, CentOS 6 iptables block httpd port 80 outside by default.

MegaNairda

Posted 2012-07-04T05:00:15.437

Reputation: 679