求高手:百度无果,访问 index 报 403 ?
设备&版本:
腾讯云centos 7.1
apache v2.4
php v5.6
通过composer安装laravel
情况:
在默认根目录/var/www/html下自建的index.php,访问服务器 Ip 能输出phpinfo()信息。(到此)
问题:
修改httpd.conf文件的 DocumentRoot 和 Directory 为laravel项目根目录后(目录路径确认没错),restart httpd重启服务,服务正常。
1、访问服务器ip,显示是apache默认页,如下:
(Testing 123..
This page is used to test the proper operation of the Apache HTTP server after it has been installed. If you can read this page it means that this site is working properly. This server is powered by CentOS.)。
2、访问ip/index.php,报403.如下:
(Forbidden
You don't have permission to access /index.php on this server.)
问:这是什么问题,要如何修改?
其他说明:
1、项目根目录为: (省略部分路径)/composer/pro/
——————
2、httpd/error_log文件如下:(只有一条)
AH01797: client denied by server configuration: (省略部分路径)/composer/pro/public/noindex, referer: http://xxx.xxx.xxx.xxx(服务器ip)/noindex/css/open-sans.css
3、httpd.conf文件如下:
ServerName xxx.xxx.xxx.xxx(服务器Ip):80
AllowOverride All
Require all granted
DocumentRoot "(省略部分路径)/composer/pro/public/"
<Directory "(省略部分路径)/composer/pro/public/">
AllowOverride All
Require all granted
<Directory "(省略部分路径)/composer/pro/public/">(我的conf有2部分directory)
Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
Options Indexes FollowSymLinks
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride All
# Controls who can get stuff from this server.
Require all granted
4、以对pro根目录进行 chmod -R 777 pro
——————
5、本人初入编程,第一次接触服务器。以前在windows下用过laravel,但按照当时视频省略了composer步骤。且windows和linux很多不同。烦请大牛细说。
我百度看了一堆都是说文件权限未777,或者httpd.conf未设allow。然而,我的这些设置均已设~
推荐文章: