apache configuration
apache virtual hosts in CentOS
Note: Guidance given below is based on CenOS 5.3 version line numbers are tentative
- create a directory such as /var/www/html/myvirtualhost and give permissions using chmod 777 /var/www/html/myvirtualhost
- Assume 192.168.m.n as IP and 'localhost' as Servername. Open /etc/httpd/conf/httpd.conf and do the following.
- line 266 : ServerName localhost:80
- line 974 : NameVirtualHost 192.168.m.n:80
- Uncomment the lines 987 to 993
- line 987 : < virtualHost localhost:80>
- line 988 : ServerAdmin localhost
- line 989 : DocumentRoot /var/www/htm/myvirtualhost
- line 990 : ServerName localhost
- restart the service : service httpd restart
- if your DNS is pointing correctly,you can access the virtual host over the web.
To make DNS point
- Edit /etc/hosts : 192.168.m.n localhost
- Service network restart


