1

I've just deployed a new CentOS 5.7 box with a base install. After the base install I ran

yum install httpd

and confirmed that Apache was installed.

I created a test index.html file in /var/www/html/ and then restarted apache expecting that when I connect to the server in a browser that the test page would be displayed.

However, when I connect, all I see is:

ERROR Service Unavailable


The requested service is unavailable.

Please try again later.

I'm sure there is something very simple that I'm missing here but I don't have a lot of linux experience so I'm hoping somebody can lend a hand.

Thanks in advance!

John Mee
  • 2,898
Windows Ninja
  • 2,606
  • 20
  • 48
  • 72

3 Answers3

2

Try This:

Service iptables stop
service httpd restart

NOTE: the reason is that by default CentOS installation has the Firewall On, then what we did here is to disable it, but when you restart then activates again with this command: "chkconfig iptables off" we disable it permanently.

but you can also add a rule to allow port rute 80 if you want

1

Check to make sure you have a valid hosts entry in /etc/hosts. Apache won't start successfully without it.

ewwhite
  • 201,205
0

By default CentOS has a firewall enabled. You need to open port 80 in your firewall to allow access to the apache server.

sudo iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

If this works then

sudo service iptables save

to save the working configuration for the next restart.

user9517
  • 117,122