簡體   English   中英

fedora 20上的httpd(apache2)權限錯誤

[英]httpd (apache2) permission error on fedora 20

我正在嘗試在apache中配置自定義DocumentRoot。 盡管我遵循了所有教程,但我發現我無法使它正常工作……這是錯誤的地方:

(DocumentRoot必須是目錄)

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]:

這是我的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>

我執行了命令chcon -R -h -t httpd_sys_content_t /home/nico/public_html ,沒有任何反應。

這是優先事項,等等。

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

system_u:object_r:httpd_sys_content_t:s0 drwx - X - X。 尼科尼科

system_u:object_r:file_t:s0 ..

謝謝!

通過僅針對Linux禁用SELinux來解決:

允許的語義-a httpd_t

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM