首页 > Web开发 > 详细

apache2.4以上版本配置虚拟主机

时间:2016-12-10 21:42:13      阅读:150      评论:0      收藏:0      [点我收藏+]

一  将 主配置文件 httpd.conf中

#Include conf/extra/httpd-vhosts.conf 前面的# 去掉

二  进入conf/extra 

修改 /conf/extra/httpd-vhosts.conf

增加下面内容 ,2.4以后这部分内容很重要

<Directory "/www/html/">   

 Options Indexes FollowSymLinks Includes ExecCGI

 AllowOverride All 

 Require all granted

</Directory>

 

/www/html/是根目录

 

然后在下面增加:

<VirtualHost *:80>

  ServerAdmin webmaster@dummy-host2.example.com   

 DocumentRoot "/srv/http/yii2/web" 

  ServerName yii2   

 ErrorLog "/var/log/httpd/dummy-host2.example.com-error_log"   

 CustomLog "/var/log/httpd/dummy-host2.example.com-access_log"  combined

</VirtualHost>

 

ServerName 以及DocumentRoot这一部分一定要写对!其它可以默认即可!

apache2.4以上版本配置虚拟主机

原文:http://www.cnblogs.com/xuwenjj/p/6156420.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!