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>

 

posted @ 2016-12-27 11:43  BaronYan  阅读(162)  评论(0编辑  收藏  举报