Based domain name, usually external website
www.etiantian.org / var / www / html / www blog.etiantian.org / var / www / html / blog bbs.tiantian.org / var / www / html / bbs
mkdir / var / www / html / {www, blog, bbs} -p # Create File Directory
touch /var/www/html/{www,blog,bbs}/index.html # Create a Home
for name in www blog bbs;do echo "http://$name.etiantian.org" >
/var/www/html/$name/index.html;done root@Nagios-Server extra]# vim httpd-vhosts.conf NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin [email protected] DocumentRoot "/var/www/html/www" ServerName www.etiantian.org ServerAlias etiantian.org
ErrorLog "logs/www-error_log"
CustomLog "logs/www-access_log" common
</VirtualHost>
[root@Nagios-Serverconf]# vimhttpd.conf
# Virtual hosts enable vhsts
Include conf/extra/httpd-vhosts.conf
#set www,blog,bbs
<Directory "/var/www/html"> Options FollowSymLinks
AllowOverride None
Order allow,deny 84
Allow from all
</Directory>
# Syntax checking whether it is
[root@Nagios-Server extra]# ../../bin/apachectl -t
Syntax OK
[root@Nagios-Server extra]# ../../bin/apachectl graceful
If the domain name is your own needs in the local C: \ Windows \ System32 \ drivers \ etc modifies the hosts
192.168.1.125 www.etiantian.org blog.etiantian.org bbs.etiantian.org
# Ping check for proper use
In cmd in the ping www.etiantian.org