You are on page 1of 1

To configure Apache Server on CentOS 5.

You do not need to do any thing to the default configuration httpd.conf file to
get your Apache Server running.
All you need is to write your index.html and your web pages and place them in /v
ar/www/html.
The default DocumentRoot is located in /var/www/html.
The default home page is located in /usr/share/doc/HTML/index.html.
The default ServerRoot in httpd.conf is ServerRoot /etc/httpd .
Make sure the firewall does not block access to port 80 by running:
# system-config-securitylevel
Allow WWW(HTTP) as "Trusted Services"
# apachectl start
# chkconfig httpd on
Configure Apache Server to restart on CentOS 5
# apachectl restart
Example
1.
Back up your /etc/httpd/conf/httpd.conf file.
2.
Run from the command line:
3.
# mkdir /var/www/html/test/
4.
# cd /var/www/html/test/
5.
# vi index.html
insert(type i) the following:
======Hello======
Save(press Esc then type :wq) the file
# apachectl restart
Browse
http://127.0.0.1/test

You might also like