OSX Apache Web Server El Capitan Upgrade 404 Error
在运行OSX Yosemite时已经在用户级别启用了本地站点目录中的页面后,尝试访问本地站点目录中的页面时,升级到El Capitan后收到404错误。问题是Apache将httpd.conf文件重置为其默认值,这将禁用用户文件夹加载文件的功能。因此,http:// localhost加载良好,但不会加载http://localhost/~username/index.html。
解决方法:
备份已创建的"新"配置文件:
1 | sudo cp /etc/apache2/httpd.conf /etc/apache2/httpd.conf_capitan |
还原已重命名的"旧"配置文件:
1 | sudo cp /etc/apache2/httpd.conf~previous /etc/apache2/httpd.conf |