帮助中心 >  技术知识库 >  云服务器 >  服务器教程 >  windows下apache2.4虚拟主机配置打开403问题解决

windows下apache2.4虚拟主机配置打开403问题解决

2017-11-11 23:09:19 12797

配置文件


<VirtualHost *>
    <Directory "D:/htdocs/www.landui.com">
        Options -Indexes FollowSymLinks
    </Directory>
    ServerAdmin admin@www.landui.com
    DocumentRoot "D:/htdocs/www.landui.com"
    ServerName www.landui.com
    ServerAlias hack123.com www.landui.com
    ErrorLog logs/www.landui.com_log
    php_admin_value open_basedir "D:\htdocs\www.landui.com;C:\Windows\Temp;"
</VirtualHost>

在apache2.4环境下导致无法启动服务


blob.png

查看日志错误


后在一国外网站看出一些名堂

https://www.landui.com/questions/362682/403-error-after-upgrading-to-apache2-4

blob.png


由于apache版本变化后指令有变迁


修改apache配置文件

<Directory />
    AllowOverride none
   #Require all denied
   Require all granted //这里  不然php打开403错误
</Directory>


<VirtualHost *>
    <Directory "D:/htdocs/www.landui.com">
        Options FollowSymLinks  //2.4的配置
    </Directory>
    ServerAdmin admin@www.landui.com
    DocumentRoot "D:/htdocs/www.landui.com"
    ServerName www.landui.com
    ServerAlias hack123.com www.landui.com
    ErrorLog logs/www.landui.com_log
    php_admin_value open_basedir "D:\htdocs\www.landui.com;C:\Windows\Temp;"
</VirtualHost>

重启apache,顺利打开。


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: