Mac OS Sierra更新后,Apache给出了404错误 [英] Apache giving 404 error after Mac OS sierra update
问题描述
最近我刚刚更新到Mac OS 10.11 Sierra,并且经典Web服务器无法正常工作,或者应该说我的主目录不工作
当我得到'It works'页面时,Apache服务器正在localhost运行,但是localhost/~myuser
给出了此消息'The requested URL /~myuser was not found on this server'
我尝试遵循此 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
事后对我有用,但是现在我更有动力开始搬到流浪汉了.
Things worked for me afterwards, however I am better motivated now to start moving to Vagrant.
这篇关于Mac OS Sierra更新后,Apache给出了404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!