设置新别名时出现 Access Forbidden (Error 403) [英] I get Access Forbidden (Error 403) when setting up new alias

查看:27
本文介绍了设置新别名时出现 Access Forbidden (Error 403)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Windows 7,最近安装了 XAMPP 来构建开发环境.我对服务器端的东西不是很好,所以我在为项目设置别名时遇到了一些问题.

I'm running windows 7 and recently installed XAMPP to build a dev environment. I'm not great with the server side of things so I'm having some problems setting up an alias for a project.

到目前为止,XAMPP 正在运行,如果我访问 localhost,我会看到 XAMPP 欢迎页面.我在我的 apache 安装的conf"文件夹中创建了一个alias"文件夹.在那里我添加了具有以下内容的 dev.conf:

So far XAMPP is running and if I go to localhost I get the XAMPP welcome page. I created an "alias" folder in my "conf" folder of my apache install. In there I added dev.conf with the following content:

<Directory "C:Usersmy_userMy%20DocumentsAptana%20Studio%203%20Workspaceproject">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from 127.0.0.1
</Directory>

Alias /dev "C:Usersmy_userMy%20DocumentsAptana%20Studio%203%20Workspaceproject"

但是当我转到localhost/dev"时,我得到:

But then when I go to "localhost/dev" I get:

禁止访问!

您无权访问请求的对象.它是服务器读保护或不可读.

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 the webmaster.

错误 403

我尝试使用谷歌搜索并在 SO 上发现了其他类似的问题,但我似乎无法弄清楚.有人说你必须告诉它有权限,但在我的 conf 文件中我指定允许它从 127.0.0.1 开始.也许这是因为我的路径中有空格(尽管一些谷歌搜索告诉我 %20 工作).我设法在另一个文件夹中创建了一个并复制粘贴了工作文件夹并更改了别名和路径,它坏了,所以这告诉我它可能与其中任何一个有关.

I tried googling and I found other similar questions on SO but I can't seem to figure it out. Some say that you have to tell it to have permissions but in my conf file I specified to allow it from 127.0.0.1. Maybe this is because my path has spaces in it (though some googling told me %20 work). I had managed to create one to a different folder and copy pasted the working one and changed the alias and path and it broke so it this tells me it probably has something to do with either.

我查看了我的日志文件夹,发现以下行:

I looked in my log folder and found the following line:

[2011 年 12 月 13 日星期二 14:59:20] [错误] [客户端 ::1] 客户端被拒绝服务器配置:C:/Users/my_user/My%20Documents

[Tue Dec 13 14:59:20 2011] [error] [client ::1] client denied by server configuration: C:/Users/my_user/My%20Documents

我不确定它是否会减少,因为错误消息只能有一定的长度,但这绝对不是我在 dev.conf 文件中添加的路径,我希望这可以让一些人更清楚,因为我变得非常沮丧,我不知道该尝试什么了.

I'm not sure if it cuts because error messages can only be of a certain length but that's definitely not the path I added in the dev.conf file, I'm hoping this can make this a bit clearer for some because I am getting pretty frustrated and I'm not sure what to try anymore.

推荐答案

终于搞定了.

我不确定路径中的空格是否会破坏某些内容,但我将 Aptana 安装的工作区更改为没有空格的内容.

I'm not sure if the spaces in the path were breaking things but I changed the workspace of my Aptana installation to something without spaces.

然后我卸载了 XAMPP 并重新安装了它,因为我在想可能是我在某个地方打错了字而没有注意到,并认为我应该从头开始工作.

Then I uninstalled XAMPP and reinstalled it because I was thinking maybe I made a typo somewhere without noticing and figured I should be working from scratch.

原来 Windows 7 有一个使用端口 80 的服务阻止 apache 启动(给它 -1)错误.于是我把它监听的端口改成了8080端口,不再冲突了.

Turns out Windows 7 has a service somewhere that uses port 80 which blocks apache from starting (giving it the -1) error. So I changed the port it listens to port 8080, no more conflict.

最后我重新启动了我的计算机,由于某种原因,XAMPP 不喜欢我处理 ini 文件,而仅仅重新启动 apache 并没有解决问题.

Finally I restarted my computer, for some reason XAMPP doesn't like me messing with ini files and just restarting apache wasn't doing the trick.

无论如何,这是有史以来最令人沮丧的一天,所以我真的希望我的回答最终能帮助别人!

Anyway, this has been the most frustrating day ever so I really hope my answer ends up helping someone out!

这篇关于设置新别名时出现 Access Forbidden (Error 403)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆