Ch 22 Httpd Apache Server

# rpm –qa httpd

Package required : httpd

# vi /etc/httpd/conf/httpd.conf

(Line to be change ) 204

 servername www.myserver.com:80

 document root “/var/www/html”

 Namevirtualhost www.myserver.com:80

 <virtualhost www.myserver.com:80>

 serveradmin webmaster@myserver.com

 document root /var/www/html

 server name www.myserver.com

 errorLog  logs

 customLog logs

</virtualHost>

 

# add more virtual host

 

Namevirtualhost www.cmstest.com:80

 <virtualhost www.cmstest.com:80>

 serveradmin webmaster@cmstest.com

 document root /var/www/html

 server name www.cmstest.com

 errorLog  logs

 customLog logs

</virtualHost>

 

 # as per usage we can add virtual server more in this file

  END OF FILE

 # vi /etc/hosts

  IP domain name

  IP virtual domain name

# service httpd restart

# service network restart ( necessary after host file change)