<VirtualHost 192.168.1.100:80>
DocumentRoot "/usr/local/apache24/htdocs/test1"
ServerName test1.linuxidc.com
ErrorLog "/var/log/test1/errlog"
CustomLog "/var/log/test1/acccesslog" common
</VirtualHost>
<VirtualHost 192.168.1.100:80>
DocumentRoot "/usr/local/apache24/htdocs/test2"
ServerName test2.linuxidc.com
ErrorLog "/var/log/test2/errlog"
CustomLog "/var/log/test2/accesslog" common
</VirtualHost>8、创建网页测试文档
[root@linuxidc htdocs]# pwd
/usr/local/apache24/htdocs
[root@linuxidc htdocs]# mkdir test1 test2
[root@linuxidc htdocs]# echo "test1" > test1/index.html
[root@linuxidc htdocs]# echo "test2" > test2/index.html9、检查配置文件是否正确
[root@linuxidc ~]# apachectl -t
Syntax OK10、重启启动服务测试
[root@linuxidc ~]# /usr/local/apache24/bin/apachectl restart
[root@linuxidc ~]# curl
test1
[root@linuxidc ~]# curl
test2