今天为了方便测试,将一本地目录设置为一apache的虚拟主机,在httpd-vhosts.conf文件中进行简单设置,然后在hosts文件中将访问地址指向本地,启动apache,进行访问,却出现了You don't have permission to access / on this server的提示,baidu了一下,原来是因为我的虚拟主机目录为非apache安装目录下的htdocs,所以违反了apache对默认对网站根访问权限。
apache的默认虚拟主机根目录地址为../Apache Software Foundation/Apache2.2/htdocs 目录下,需要对httpd.conf文件进行修改才能指向其他目录。
在httpd.conf文件下找到这段:
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
将之修改为
# 允许指向外部的目录进行访问
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
然后重启apache,就ok了。
分享到:
相关推荐
"Apache You don't have permission to access / on this server" 是一个经典的Apache服务器错误信息,它意味着用户尝试访问网站时遇到了权限问题。这个错误通常出现在Apache HTTP服务器的配置不当或者目录权限设置...
本文实例讲述了WampServer设置apache伪静态出现404 not found及You don’t have permission to access / on this server解决方法。分享给大家供大家参考。具体如下: 出现404 not found 时: 确保LoadModule rewrite_...
键字: Apache 403 Forbidden 系统配置: 操作系统:Red Hat Linux 6.2 Web服务器:Apache 3.1.1+jakarta-tomcat 3.1.1 数据库服务器:oracle 8i Apache服务器是目前应用... You don’t have permission to access
Apache服务器在运行过程中可能会遇到各种错误,其中"403 Forbidden"是一个常见的错误,提示用户没有权限访问指定的资源。这个错误通常出现在尝试访问某个网页或文件时,服务器返回的状态码为403,表示服务器理解了...
主要介绍了WampServer设置apache伪静态出现404 not found及You don't have permission to access / on this server解决方法,较为详细的分析了几种常见情况,非常具有实用价值,需要的朋友可以参考下
在使用PHP和Apache服务器进行开发或测试时,可能会遇到一种常见的错误:“You don’t have permission to access /index.php on.” 这个错误信息表明,Web服务器没有足够的权限访问指定的PHP文件,导致用户无法正常...
You don't have permission to access / on this server. 更改D:\Installsoftware\apache\apache\httpd-2.2-x64\conf文件夹中的httpd.conf文件中 <Directory /> Options FollowSymLinks AllowOverride None ...
本地搭建wamp,输入http://127.0.0.1访问正常,当输入http://localhost/,apache出现You don't have permission to access/on this server.的提示,如何解决? 解决方法:...
一直在用APMServ5.2.6,mysql好办,可以用mariadb代替进行升级,但php...You don't have permission to access / on this server. Apache/2.4.9 (Win32) PHP/5.5.12 Server at www.sitename.com Port 80 一、在国内网
今天调试一个项目,项目放在webroot下面的javascript目录,无论怎么设置都是403 You don’t have permission to access /javascript/ on this server. 思考过程 首先第一反应,Google了错误You don't have ...
### 错误十:You don't have permission to access /on this server. 这是服务器权限问题,表示当前用户没有足够的权限访问特定资源。对于Apache服务器,检查配置文件(如httpd.conf)和日志文件(如error.log),...
echo 'You don\'t have permission to access / on this server.'; echo '<P>'; echo 'Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.'; ...
- 在配置过程中,如果遇到权限问题,比如出现“You don't have permission to access / on this server”这样的错误提示,应该检查httpd.conf中的段落设置,确保服务器具有读取和访问指定目录的权限。 以上步骤完成...
问题:配置Apache,httpd.conf... You don’t have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact t