gpt4 book ai didi

php - fedora 20 上的 httpd (apache2) 权限错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:33:53 25 4
gpt4 key购买 nike

我正在尝试在 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. nico nico

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

system_u:object_r:file_t:s0 ..

谢谢!

最佳答案

通过仅针对 apache 禁用 SELinux 解决:

semanage permissive -a httpd_t

关于php - fedora 20 上的 httpd (apache2) 权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22899782/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com