成都网站建设设计

将想法与焦点和您一起共享

apache-2.4.12之虚拟主机配置问题与觖决办法-创新互联

apache-2.4.12基于域名访问的多虚拟主机配置

成都创新互联是一家专注于成都网站制作、成都网站设计与策划设计,历城网站建设哪家好?成都创新互联做网站,专注于网站建设10多年,网设计领域的专业建站公司;建站业务涵盖:历城等地区。历城做网站价格咨询:028-86922220

原始配置:

  ServerAdmin kk@etiantian.org

  DocumentRoot "/data/cms"

  ServerName www.etiantian.org

  ServerAlias etiantian.org

  ErrorLog "logs/www.etiantian.org-error_log"

  CustomLog "logs/www.etiantian.org-access_log" common

  ServerAdmin kk@etiantian.org

  DocumentRoot "/data/bbs"

  ServerName bbs.etiantian.org

  ErrorLog "logs/bbs.etiantian.org-error_log"

  CustomLog "logs/bbs.etiantian.org-access_log" common

  ServerAdmin kk@etiantian.org

  DocumentRoot "/data/blog"

  ServerName blog.etiantian.org

  ErrorLog "logs/blog.etiantian.org-error_log"

  CustomLog "logs/blog.etiantian.org-access_log" common

  以上的基于域名访问的多虚拟主机配置大家能看出错在哪吗?乍一看没有问题,可是在apache-2.4.12下这样配置完,访问出现403错误,无权限访问。根据提示查看了目录以及文件的权限问题,没有问题;查看程序错误日志和系统日志也没有明显的错误;这时冷静下来好好想了想,目录及文件权限没有问题,那剩下就是站点目录访问权限了,于是在虚拟主机配置文件里面的虚拟主机配置前加入这么一段:

  Options Indexes FollowSymLinks Includes ExecCGI

  AllowOverride All

   Require all granted

再些修改虚拟主机配置文件如下:

  Options Indexes FollowSymLinks Includes ExecCGI

  AllowOverride All

   Require all granted

  ServerAdmin kk@etiantian.com

  DocumentRoot "/data/cms"

  ServerName www.etiantian.org

  ServerAlias etiantian.org

  ErrorLog "logs/www.etiantian.org-error_log"

  CustomLog "logs/www.etiantian.org-access_log" common

  ServerAdmin kk@etiantian.com

  DocumentRoot "/data/bbs"

  ServerName bbs.etiantian.org

  ErrorLog "logs/bbs.etiantian.org-error_log"

  CustomLog "logs/bbs.etiantian.org-access_log" common

  ServerAdmin kk@etiantian.com

  DocumentRoot "/data/blog"

  ServerName blog.etiantian.org

  ErrorLog "logs/blog.etiantian.org-error_log"

  CustomLog "logs/blog.etiantian.org-access_log" common

  经过以上的修改后,重启apache服务,现在可以正常访问,呵呵,大功能告成!

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页标题:apache-2.4.12之虚拟主机配置问题与觖决办法-创新互联
网页URL:http://chengdu.cdxwcx.cn/article/dhjhhj.html