donglue8180 2014-04-06 20:44
浏览 65

Fedora 20上的httpd(apache2)权限错误

I am trying to configure a custom DocumentRoot in apache. Despite I followed all the tutorials I found i couldn't get it to work... Here's the error:

(DocumentRoot must be a directory)

httpd.service - The Apache HTTP Server    Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)    Active: failed (Result: exit-code) since dom 2014-04-06 17:37:00 ART; 2s ago   Process: 14072 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)   Process: 14068 ExecStart=/usr/sbin/httpd $OPTIONS
-DFOREGROUND (code=exited, status=1/FAILURE)  Main PID: 14068 (code=exited, status=1/FAILURE)    Status: "Total requests: 7; Current requests/sec: 0; Current traffic:   0 B/sec"

abr 06 17:36:59 lilo systemd[1]: Starting The Apache HTTP Server... abr 06 17:36:59 lilo httpd[14068]: AH00526: Syntax error on line 120 of /etc/httpd/conf/httpd.conf: abr 06 17:36:59 lilo httpd[14068]: DocumentRoot must be a directory abr 06 17:37:00 lilo systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE abr 06 17:37:00 lilo systemd[1]: Failed to start The Apache HTTP Server. abr 06 17:37:00 lilo systemd[1]:

And here's my httpd.conf

#DocumentRoot "/var/www/html"
DocumentRoot "/home/nico/public_html"

#
# Relax access to content within /var/www.
#
#<Directory "/var/www">
<Directory "/home">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

<Directory "/home/nico/public_html">
    Options Indexes FollowSymLinks
    AllowOverride None
</Directory>

I executed the command chcon -R -h -t httpd_sys_content_t /home/nico/public_html and nothing happends.

Here are the prermissions, etc...

[root@lilo nico]# ls -laZ /home/nico/public_html drwxr-xr-x. nico nico

system_u:object_r:httpd_sys_content_t:s0 . drwx--x--x. nico nico

system_u:object_r:file_t:s0 ..

Thanks!

  • 写回答

1条回答 默认 最新

  • dtp0760 2014-04-06 23:08
    关注

    Solved by disbling SELinux for apache only:

    semanage permissive -a httpd_t

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog