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

 更新时间:2018年07月25日 11:28:00   作者:xuyaowen  
这篇文章主要介绍了fedora 开启 apache 并 开启目录浏览模式的相关资料,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下

在内网中 暂时需要一台 文件 服务器,所以准备安装一台 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 /.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  indexes FollowSymLinks

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

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

总结

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

相关文章

  • Linux提示网络不可达问题

    Linux提示网络不可达问题

    这篇文章主要介绍了Linux提示网络不可达问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2023-12-12
  • Linux 中清空或删除大文件内容的五种方法

    Linux 中清空或删除大文件内容的五种方法

    这篇文章主要介绍了Linux 中清空或删除大文件内容的五种方法的相关资料,需要的朋友可以参考下
    2016-12-12
  • Apache服务器关闭TRACE Method请求方式的方法

    Apache服务器关闭TRACE Method请求方式的方法

    这篇文章主要介绍了Apache服务器关闭TRACE Method请求方式的方法,因为支持该方式的服务器存在跨站脚本漏洞,需要的朋友可以参考下
    2014-06-06
  • apache 开启重定向 rewrite的实现方法

    apache 开启重定向 rewrite的实现方法

    这篇文章主要介绍了apache 开启重定向 rewrite的实现方法的相关资料,希望通过本文能帮助到大家,让大家实现这样的功能,需要的朋友可以参考下
    2017-10-10
  • Linux系统下 centos7下搭建ElasticSearch中间件及常用接口演示

    Linux系统下 centos7下搭建ElasticSearch中间件及常用接口演示

    ElasticSearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。这篇文章主要介绍了Linux系统下 centos7下搭建ElasticSearch中间件及常用接口演示 ,需要的朋友可以参考下
    2019-07-07
  • CentOS下安装python3.5+scrapy的方法步骤

    CentOS下安装python3.5+scrapy的方法步骤

    本篇文章主要介绍了CentOS下安装python3.5+scrapy的方法步骤,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-12-12
  • linux下如何实现快速拷贝大文件

    linux下如何实现快速拷贝大文件

    这篇文章主要介绍了linux下如何实现快速拷贝大文件,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
    2020-05-05
  • Linux中一种友好的find替代工具(fd命令)

    Linux中一种友好的find替代工具(fd命令)

    这篇文章主要介绍了Linux中一种友好的find替代工具(fd命令),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2019-11-11
  • Linux远程登录实现教程解析

    Linux远程登录实现教程解析

    这篇文章主要介绍了Linux远程登录实现教程解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
    2020-05-05
  • linux系统对外开放3306、8080等端口,防火墙设置详解

    linux系统对外开放3306、8080等端口,防火墙设置详解

    这篇文章主要介绍了linux系统对外开放3306、8080等端口,防火墙设置,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2019-05-05

最新评论