主頁 > 知識庫 > 詳解fedora 開啟 apache 并 開啟目錄瀏覽模式

詳解fedora 開啟 apache 并 開啟目錄瀏覽模式

熱門標(biāo)簽:百度競價點擊價格的計算公式 網(wǎng)站建設(shè) 檢查注冊表項 硅谷的囚徒呼叫中心 美圖手機 使用U盤裝系統(tǒng) 智能手機 阿里云

在內(nèi)網(wǎng)中 暫時需要一臺 文件 服務(wù)器,所以準(zhǔn)備安裝一臺 http服務(wù)器并開啟目錄訪問權(quán)限。這次使用 apache 在 fedora 28 機器上:

因為 fedora 28 已經(jīng)包含 httpd 軟件,使用systemctl start httpd 就能進行啟動。

啟動時 默認開啟 目錄訪問權(quán)限,但是首次訪問網(wǎng)站根目錄的時候,會顯示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

這個配置表明為 開啟目錄權(quán)限

結(jié)束后,你會看到如下所示畫面:

總結(jié)

以上所述是小編給大家介紹的fedora 開啟 apache 并 開啟目錄瀏覽模式,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

標(biāo)簽:山南 黃山 湘潭 湖北 懷化 煙臺 賀州 通遼

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《詳解fedora 開啟 apache 并 開啟目錄瀏覽模式》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266