试图看着维基和谷歌搜索。没有成功。
我将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网站。