centos配置虚拟主机
首先注释掉 DocumentRoot /var/www/html
然后添加如下代码至文件底部:
NameVirtualHost 192.168.0.3
<virtualhost 192.168.0.3>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/website2
ServerName www.website2.com
ErrorLog /var/www/html/website2/logs/error_log
TransferLog /var/www/html/website2/logs/access_log
</virtualhost>