咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

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

2017-11-11 23:09:19 7007次

配置文件


<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,顺利打开。


首页
最新活动
个人中心