Apache:编写httpd-userdir.conf时出错:权限被拒绝

时间:2017-02-24 19:00:09

标签: apache osx-elcapitan

我跟随this guide,以便我可以在OS-X El Capitan上使用Apache在本地服务器上运行网站。我正在尝试编辑我的httpd-userdir.conf文件,但是当我尝试保存时,它给出了错误:

编写httpd-userdir.conf时出错:权限被拒绝

终端显示我的httpd-userdir.conf文件的权限是-rw-r - r--,所以我不明白为什么我不被允许写?

drwxr-xr-x  15 root  wheel   510B Feb 24 13:35 ./
drwxr-xr-x  11 root  wheel   374B Feb 24 13:27 ../
-rw-r--r--   1 root  wheel   2.8K Jul 31  2015 httpd-autoindex.conf
-rw-r--r--   1 root  wheel   1.7K Jul 31  2015 httpd-dav.conf
-rw-r--r--   1 root  wheel   2.9K Jul 31  2015 httpd-default.conf
-rw-r--r--   1 root  wheel   1.1K Jul 31  2015 httpd-info.conf
-rw-r--r--   1 root  wheel   5.0K Jul 31  2015 httpd-languages.conf
-rw-r--r--   1 root  wheel   1.0K Jul 31  2015 httpd-manual.conf
-rw-r--r--   1 root  wheel   4.4K Jul 31  2015 httpd-mpm.conf
-rw-r--r--   1 root  wheel   2.2K Jul 31  2015 httpd-multilang-errordoc.conf
-rw-r--r--   1 root  wheel    13K Jul 31  2015 httpd-ssl.conf
-rw-r--r--   1 root  wheel   607B Jul 31  2015 httpd-userdir.conf
-rw-r--r--   1 root  wheel   607B Feb 24 13:35 httpd-userdir.conf.bak
-rw-r--r--   1 root  wheel   1.5K Jul 31  2015 httpd-vhosts.conf
-rw-r--r--   1 root  wheel   3.1K Jul 31  2015 proxy-html.conf

1 个答案:

答案 0 :(得分:0)

@erapert是正确的,我只需要做sudo vi /etc/apache2/extra/httpd-userdir.conf并允许我编辑该文件。