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

发布时间:2022-04-22 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了详解fedora 开启 apache 并 开启目录浏览模式脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

在内网中 暂时需要一台 文件 服务器,所以准备安装一台 http服务器并开启目录访问权限。这次使用 apacheFedora 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 /.noindex.htML
</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 /.noindex.html
#</LocationMatch>
#<Directory /usr/share/httpd/noindex>
#  AllowOverride None
#  Require all granted
#</Directory>
#Alias /.noindex.html /usr/share/httpd/noindex/index.html

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&nbsp; indexes FollowSymLinks

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

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

总结

以上所述是小编给大家介绍的fedora 开启 apache 并 开启目录浏览模式,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本宝典网站的支持!

脚本宝典总结

以上是脚本宝典为你收集整理的详解fedora 开启 apache 并 开启目录浏览模式全部内容,希望文章能够帮你解决详解fedora 开启 apache 并 开启目录浏览模式所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:开启开启