码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2016-12-10 21:43:00      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:exe   dmi   root   sts   虚拟主机   cgi   lin   err   include   

一  将 主配置文件 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以上版本配置虚拟主机

标签:exe   dmi   root   sts   虚拟主机   cgi   lin   err   include   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!