Connect to CentOS httpd server running on VMware Player?
Solution 1
I ran into this recently, and it turned out to be a firewall issue. The default iptables blocked any incoming port (except ssh).
Here's an intro on iptables if you're not familiar with it: http://wiki.centos.org/HowTos/Network/IPTables
And you need to make sure to at least allow port 80 incoming.
Solution 2
This is a firewall issue, so if you want to fix it quickly then temporarily stop iptables
by giving the following command:
service iptables stop
Then check by running apache in host browser.
You can also add port 80 and 443 to iptables
:
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT
Do that before commit and restart service. This way you can keep the firewall running and allow these to be be pinged from outside.
Solution 3
This firewall issue can be fixed easily via webmin.
Just open
http://{YOUR-SERVER-IP:10000/
Then navigate to Networking → Linux Firewall. Then you should add a rule or edit one of predefined rules (like the one for 22 port) and save. At last click on Apply Configuration button.
Related videos on Youtube
SNeacy
Updated on September 18, 2022Comments
-
SNeacy almost 2 years
I have a virtual LAMP machine set up with 32-bit CentOS 5.5 running on VMWare Player. It's being hosted on a Win 7 64-bit machine running a bridged network connection. Everything seems OK on the guest OS, as I can navigate to http://localhost and get the CentOS Apache 2 test page. However, I can not access the web server from a browser on the host OS through the IP address of the guest OS, which is the point of setting this up in the first place. I can successfully ping from host to guest (there is no firewall on the guest OS) too.
The image file for CentOS was downloaded from here (only used part 1 of 2):
http://virtual-machine.org/vmware-image-centos-55-i386-download
So is this something weird in the Apache conf or some hidden setting I'm missing in VMWare Player?
-
Linker3000 about 13 yearsYes, this has caught me before with CentOS - very annoying!
-
Thale about 11 years+1 for you buddy! you belong to ServerFault world :) I am a developer so server stuff is not in top of my mind when it comes to IPTables, etc even though I know what it is. I digged through VMWare kb, support and ServerFault, none pointed this setting as far as my search goes. More power to you!