#启用的前提是已经使用LoadModule指令载入了该模块
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
#指定守护进程httpd的管理用户
User daemon
#指定守护进程httpd的管理组
Group daemon
</IfModule>
# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
#指定管理员email地址
ServerAdmin you@example.com
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#指定服务器在DNS上注册的名称 FQDN
#ServerName
ServerName 127.0.0.1
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
#apache 目录访问权限
#使用<Directory /path> 指定目录路径
#拒绝用户通过apache访问你的文件系统/及以下的所有内容
<Directory />
#是否允许.htaccess实现权限复写
AllowOverride none
#设置所有人的访问权限 denied 拒绝 granted允许
Require all denied
#设置结束用</Directory>指令结束
</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指定WEB站点的根目录
DocumentRoot "/usr/local/apache/htdocs"
#对默认网站根目录设置访问权限
<Directory "/usr/local/apache/htdocs">
#
# 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
#Indexes 站点中有index页面优先加载
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2730/viewspace-3139485/ ,如需转载,请注明出处,否则将追究法律责任。