![当我访问 http://localhost/~admin/ 时出现 403](https://linux22.com/image/1341896/%E5%BD%93%E6%88%91%E8%AE%BF%E9%97%AE%20http%3A%2F%2Flocalhost%2F~admin%2F%20%E6%97%B6%E5%87%BA%E7%8E%B0%20403.png)
我正在运行 mac osx 10.8。
当我访问 localhost 或 127.0.0.1/ 时,我的浏览器显示:“它有效!”。
但是当我转到 localhost/~admin/ 或 127.0.0.1/~admin/ 时,我的浏览器显示:
“禁止
您无权访问此服务器上的 /~admin/。”
我该如何改变这种状况?!??!?! 这让我抓狂了!
这是我的 /etc/apache2/users/admin.conf:
<Directory "/Users/admin/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
我在 .bash_profile 文件中创建了别名,以便可以快速启动、重新启动和停止 Apache:
alias startApache="sudo apachectl start"
alias stopApache="sudo apachectl stop"
alias restartApache="sudo apachectl restart"
在我的 /etc/apache2/httpd.conf 文件中我打开了 php5:
LoadModule php5_module libexec/apache2/libphp5.so
我还确保使用终端中的以下命令更改我的 admin.conf 文件的权限:
sudo chmod 644 username.conf