Mac OS sierra 更新后 Apache 出现 404 错误 [英] Apache giving 404 error after Mac OS sierra update

查看:62
本文介绍了Mac OS sierra 更新后 Apache 出现 404 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近刚刚更新到 Mac OS 10.11 Sierra 并且经典 Web 服务器无法正常工作,或者我应该说我的主目录无法正常工作当我看到 'It works' 页面时,Apache 服务器正在 localhost 上工作,但是 localhost/~myuser 给出了这个消息 '请求的 URL/~myuser 是在此服务器上找不到'我试图按照这个 tuto 但它仍然不是工作

I just updated to Mac OS 10.11 Sierra lately and classic web server is not working properly, or I should say that my home directory is not working Apache server is working at localhost as I get the 'It works' page, but localhost/~myuser is giving this message 'The requested URL /~myuser was not found on this server' I tried to follow this tuto but it is still not working

有人可以帮我吗?

推荐答案

从 El Capitan 升级到 Sierra 后对我有用的方法:

What worked for me after upgrading from El Capitan to Sierra as well:

1) 从 /etc/apache2/httpd.conf 取消注释

LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
Include /private/etc/apache2/extra/httpd-vhosts.conf
Include /private/etc/apache2/extra/httpd-userdir.conf

2) 取消注释 /etc/apache2/extra/httpd-userdir.conf

Include /private/etc/apache2/users/*.conf

3) 在我的 /etc/apache2/users/$USERNAME.conf 文件中,我也配置了 ProxyPass,为了让它再次工作,我不得不重新- 从我的 httpd.conf

3) In my /etc/apache2/users/$USERNAME.conf file I had ProxyPass configured as well, and to get it working again I had to re-uncomment the following from my httpd.conf

LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so

4) PHP 可选:您还需要从 httpd.conf 中重新取消注释以下内容:

4) Optional for PHP: You need to re-uncomment the following from the httpd.conf as well:

LoadModule php5_module libexec/apache2/libphp5.so

5) 当然,重启apache

5) Of course, restart apache

sudo apachectl -k restart

后来事情对我有用,但是我现在更有动力开始转向 Vagrant.

Things worked for me afterwards, however I am better motivated now to start moving to Vagrant.

这篇关于Mac OS sierra 更新后 Apache 出现 404 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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