【问题标题】:Apache: Error writing httpd-userdir.conf: Permission deniedApache:写入 httpd-userdir.conf 时出错:权限被拒绝
【发布时间】:2017-07-15 17:45:16
【问题描述】:

我正在关注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

【问题讨论】:

  • 向我们展示完整的ls -alhp 列表。几乎可以保证该文件归根用户所有——您需要这样做 sudo vi /path/to/httpd-userdir.conf

标签: apache osx-elcapitan


【解决方案1】:

@erapert 是正确的,我只需要执行 sudo vi /etc/apache2/extra/httpd-userdir.conf 就可以编辑文件了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-08-13
    • 2017-11-16
    • 2016-11-15
    • 2014-06-29
    • 1970-01-01
    相关资源
    最近更新 更多