当前位置: 移动技术网 > 网络运营>服务器>Linux > 详解fedora 开启 apache 并 开启目录浏览模式

详解fedora 开启 apache 并 开启目录浏览模式

2019年05月29日  | 移动技术网网络运营  | 我要评论

在内网中 暂时需要一台 文件 服务器,所以准备安装一台 http服务器并开启目录访问权限。这次使用 apache 在 fedora 28 机器上:

因为 fedora 28 已经包含 httpd 软件,使用systemctl start httpd 就能进行启动。

启动时 默认开启 目录访问权限,但是首次访问网站根目录的时候,会显示test page.

进入如下文件夹:

[root@dhcp-65-15 conf.d]# pwd
/etc/httpd/conf.d
[root@dhcp-65-15 conf.d]# cat welcome.conf
#
# this configuration file enables the default "welcome" page if there
# is no default index page present for the root url. to disable the
# welcome page, comment out all the lines below.
#
# note: if this file is removed, it will be restored on upgrades.
#
<locationmatch "^/+$">
  options -indexes
  errordocument 403 /.no
</locationmatch>
<directory /usr/share/httpd/noindex>
  allowoverride none
  require all granted
</directory>

进行注释上述文件:

[root@dhcp-65-15 conf.d]# cat welcome.conf
#
# this configuration file enables the default "welcome" page if there
# is no default index page present for the root url. to disable the
# welcome page, comment out all the lines below.
#
# note: if this file is removed, it will be restored on upgrades.
#
#<locationmatch "^/+$">
#  options -indexes
#  errordocument 403 /.no
#</locationmatch>
#<directory /usr/share/httpd/noindex>
#  allowoverride none
#  require all granted
#</directory>
#alias /.no /usr/share/httpd/noindex/

httpd 文件配置如下所示:

<directory "/var/www/html">
  #
  # 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:
  #  options fileinfo authconfig limit
  #
  allowoverride none
  #
  # controls who can get stuff from this server.
  #
  require all granted
</directory>

options  indexes followsymlinks

这个配置表明为 开启目录权限

结束后,你会看到如下所示画面:

总结

以上所述是小编给大家介绍的fedora 开启 apache 并 开启目录浏览模式,希望对大家有所帮助

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网