I'm on a mac (osx 10.9.3) running CentOS7 in virtualbox. I would like to access the website hosted on the virtual machine. Browsing to the Guest IP returns webpage not available.

I'm able to ping and ssh to the VM.
I've set bridged adapter for the network settings in the VM.
I've given /etc/httpd/conf/httpd.conf Listen 80 and host IP address. telnet and curl to Guest IP returns connection refused.

I'm guessing it's a firewall / iptables configuration problem where I need to allow the host. How do I configure CentOS firewall / iptables to allow host?

  • 1
    post your firewall rules: service iptables status please, and be sure that httpd is running service httpd status
    – Nidal
    Jul 20, 2014 at 14:20
  • CentOS7 doesn't recognize service command.. really annoying
    – RobSeg
    Jul 20, 2014 at 14:23
  • try /etc/init.d/httpd status
    – Nidal
    Jul 20, 2014 at 14:24
  • returns "no such file or directory" Isn't there an official alternative to these commands? Or a download to get them. example: I needed to download net-tools to get ifconfig to work..
    – RobSeg
    Jul 20, 2014 at 14:26
  • The modern commands would be systemctl status httpd and systemctl status iptables.
    – Ned64
    Aug 7, 2021 at 9:05

2 Answers 2


you are able to ping and ssh to the VM, So I guess it is not a firewall problem, I guess your httpd service isn't running:

try to run it using:

service httpd start


/etc/init.d/httpd start

httpd should installed on centos by default!!!!, to install httpd you can simply do this on centos:

yum install httpd

to set the apache service to start on boot(to avoid such a problem again):

chkconfig httpd on
  • httpd is installed. I'm having problems with starting the httpd service. Both service httpd start and /etc/init.d/httpd start don't work. I'll look into getting these commands working, thank you. If this gets it working i'll accept answer
    – RobSeg
    Jul 20, 2014 at 14:36
  • Apache is running. '/bin/systemctl status httpd.service' returns 'active(running)' and in 'ps -aux' there are about 5 processes called apache. Still can't acces the webpage.
    – RobSeg
    Jul 21, 2014 at 9:55

Open your firewall to allow connections.


sudo firewall-cmd --permanent --zone=public --add-service=http

sudo firewall-cmd --permanent --zone=public --add-service=https

sudo firewall-cmd --reload

You must log in to answer this question.

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