项目部署测试到一半,先把配置保存下来。
win10,apache2.4,php7.3
一开始能访问前端,不能访问admin,报无权限、或者AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error。慢慢试错,现在能访问admin不能访问前端了。前面没保存当时配置,现在赶紧先保存一波。
现在:
http://localhost/admin/正常访问,
http://localhost/被禁止
apache httpd.conf:
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
#DocumentRoot "${SRVROOT}/htdocs"
#<Directory "${SRVROOT}/htdocs">
...
#</Directory>
DocumentRoot "C:/Users/qss/Code/zhaeec/public/"
<Directory "C:/Users/qss/Code/zhaeec/public" >
Options FollowSymLinks
AllowOverride All
#
##注意:2.4版用了2.2的访问控制语句,apache会无法启动,
#
#Require为2.4版本的访问控制语句,用来封IP,网络上常见的Order allow,deny为2.2版本的访问控制语句
#Require all granted
#访问控制语句2.2版,
#Order allow,deny
#Allow from all
#Deny from 192.168.1.4
#Options指令-------目录的访问特性
#option none 禁止对目录的所有操作
#option all 允许对目录的所有操作,ALL---所有操作
#option ExecCGI 对该目录,可以执行cgi脚本
#option Indexes 允许访问该目录(而该目录没有index.html)时,返回目录下的文件列表
#option FollowSymLinks 只允许对目录的FollowSymLinks操作
#AllowOverride指令
#AllowOverride None 不读取.htaccess
#AllowOverride all 允许.htaccess所有指令,缺省是all
#AllowOverride Limit .htaccess函盖具体限定的主机(allow,deny)
#AllowOverride AuthConfig .htaccess函盖跟认证有关指令(AuthType,AuthName)
</Directory>