Setting up Apache HTTP Server on CentOS

Setting up HTTPD on CentOS

By default the Apache web server is installed on CentOS but even if it is not, you can install it using the following command:

$ sudo yum install httpd

to start the service, type the following entry:

$ service httpd start

if you want to be able to access your pages externally, you need to open port 80 on the firewall. Open up the iptables file:

$ vim /etc/sysconfig/iptables

and add the following line to the end of the file right before COMMIT:

A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

save and exit, and then restart the firewall:

$ service iptables restart

The HTTP file location is in /var/www/
The index.html page should be in

/var/www/html


References

Apache guide by Dedoimedo

This entry was posted in Linux and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>