Arch:Apache在/ home上更改DocumentRoot - 403禁止访问

问题描述 投票:0回答:1

试图看着维基和谷歌搜索。没有成功。

我将documentRoot目录更改为httpd.conf中的/ home / user / web /

<Directory />
    AllowOverride none
    Require all denied
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/home/user/web/"
<Directory "/home/user/web/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ".ht*">
    Require all denied
</Files>

然后根据维基,我跑chmod o+x /home/user/web/甚至chmod o+x /home/user/

我在/home/user/web/index.html中有一个带有一个h1元素的index.html。仍然在systemctl restart httpd后我仍然得到

[Thu Aug 30 16:52:40.918808 2018] [core:error] [pid 1537] (13)Permission denied: [client ::1:37306] AH00035: access to / denied (filesystem path '/home/user/web') because search permissions are missing on a component of the path

这让我认为它的许可问题,但不知道如何从这里开始?

apache permissions arch
1个回答
0
投票

请检查以下几点以了解您的Apache网站。

  1. SELINUX
  2. 用户和所有权应该与httpd.conf文件中的相同
  3. 设置755权限
  4. 如果有任何.htaccess文件请重命名并访问它是否正常工作,那么你需要查看.htaccess文件。
© www.soinside.com 2019 - 2024. All rights reserved.