现在本地主机403禁止OS X的Apache [英] localhost now 403 Forbidden OS X Apache

查看:161
本文介绍了现在本地主机403禁止OS X的Apache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://mallinson.ca/post/osx-web-development/

我下面就我的新的MAC建立OS X小牛当地的发展环境和原来一切上述指南制定。真的不知道以后的事情,但在离开我的电脑的某个时候,在其他的东西的工作,也许重新启动后,我现在得到一个禁止 - 您没有权限访问/在此服务器上。 (在标题栏禁止403),当我尝试去ANYTHING.dev,本地主机,127.0.0.1等。由于我没有任何改变,因为这是最后一个工作日的文章中提到的文件,我的猜测是,这是某种权限问题

I was following the above guide for setting up the OS X Mavericks local development environment on my new mac and originally everything worked out. Not really sure what happened afterwards, but after leaving my computer for sometime, working on other stuff, and maybe rebooting, I now get a Forbidden -- You don't have permission to access / on this server. (403 Forbidden in title bar) when I try to go to ANYTHING.dev, localhost, 127.0.0.1, etc. Since I didn't change any of the files mentioned in the article since it was last working, my guess is this is some sort of permissions issue.

此整个设置是文件的不同的比什么是指南中的httpd-vhosts.conf中/私营发现在/ etc / apache2的/额外/ ,这是简单地更改为符合我的目录,而不是作者的。为了以防万一,你可以在这里查看该文件 - http://pastebin.com/wcr1fdZe (我有2个硬盘驱动器,固态硬盘的引导和HDD存储和命名存储,所以我发现它合理的把硬盘www目录)

The only file from this entire setup that is different than what is in the guide is httpd-vhosts.conf found in /private/etc/apache2/extra/, which was simply changed to match my directories rather than the author's. Just in case, you can view the file here -- http://pastebin.com/wcr1fdZe (I have 2 hard drives, SSD boot and HDD for storage and named storage, so I found it reasonable to put the www directory on the HDD)

顺便说一句,该目录如下:/卷/存储/网络/网站/家庭/ wwwroot文件,其中网站是WWW的唯一文件夹和家庭是网站唯一的文件夹,wwwroot文件是空的。

By the way, that directory is as follows /Volumes/Storage/www/sites/home/wwwroot where sites is the only folder in www and home is the only folder in sites and wwwroot is empty.

注意:其实,我也试图通过这个指南会更早,它最初的工作,然后用相同的403随机失败了,所以我重新安装了操作系统看,它的工作,并以类似再次失败方式。我试图刷新DNS缓存,并通过终端重新启动Apache服务器。我是新来的这个东西,所以请提供具体的命令,路径等时有什么需要做的,并询问你是否需要更多的细节。

Note: I actually also tried going through this guide earlier and it worked originally and then it failed randomly with the same 403, so I reinstalled OS to see and it worked and failed again in a similar manner. I have tried flushing dns cache and restarting apache server via terminal. I'm new to this stuff so please provide specific commands, paths, etc. when something needs to be done, and ask if you need more details.

推荐答案

只要按照这些步骤,这是简单的权限问题:

just follow those steps this is simple permission issue:

CD的/ usr /本地/的Apache2 / htdocs中/ (如果你改变了它浏览到您的文件夹)

cd /usr/local/apache2/htdocs/ (if you changed it navigate to your folder)

CHMOD 644。

搭配chmod + X。

希望能解决你的问题。

编辑:

添加到您的httpd-vhosts.conf

add this to your httpd-vhosts.conf

<VirtualHost *:80>     
ServerName localhost    
DocumentRoot /Library/WebServer/Documents/
 </VirtualHost>

这篇关于现在本地主机403禁止OS X的Apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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