My Blog List

Sunday, September 5, 2010

Apachi Web Server Configuretion

############## To configure apache server. ###############

1)To configuration file

#vim /etc/httpd/conf/httpd.conf

normal configuration:-
line no.264:-ServerName www.example.com:80
line no.280:-DocumentRoot "/var/www/html"
line no.305:-
line no.390:-DirectoryIndex index.html index.html.var

2)vertual web hosting.

line no.971:-
NameVirtualHost *:80 - uncomment the line.

---------------------------------------------------------------

############## name base #####################

    ServerAdmin root@server1.example.com
    DocumentRoot /var/www/html/yahoo
    ServerName www.yahoo.com
    Directoryindex yahoo.html
    ErrorLog logs/www.yahoo.com-error_log
    CustomLog logs/www.yahoo.com-access_log common


################ ip based #############################

    ServerAdmin root@server1.example.com
    DocumentRoot /var/www/html/rediff
    ServerName www.rediff.com
    Directoryindex rediff.html
    ErrorLog logs/www.rediff.com-error_log
    CustomLog logs/www.rediff.com-access_log common


############### port base ###############################

LISTEN 3000


    ServerAdmin root@server1.example.com
    DocumentRoot /var/www/html/india
    ServerName www.india.com
    Directoryindex india.html
    ErrorLog logs/www.india.com-error_log
    CustomLog logs/www.india.com-access_log common

-------------------------------------------------------------

3)To create the directory under this path

#cd /var/www/html
mkdir yahoo
mkdir rediff
mkdir india

4)To create html file under this path.

#vim /var/www/html/index.html
#vim /var/www/html/yahoo/yahoo.html
#vim /var/www/html/rediff/rediff.html
#vim /var/www/html/india/india.html

5)To configure the flat dns.

vim /etc/hosts
11.0.0.1        www.example.com
11.0.0.1        www.yahoo.com
11.0.0.4        www.rediff.com
11.0.0.5        www.india.com

6)To check.(by using firefox or elinks by text mode)

www.example.com
www.yahoo.com
www.rediff.com
http://www.india.com:3000/


############### END ################
By Laxman D. Kadam
Ph. No. 9967413230
email:-vikasjk3@gmail.com

No comments:

Post a Comment