CentOS7 HTTP(s) File Server
Lab試験などで簡易的なHTTS(s) File Server が欲しくなる場合のメモ
環境
CentOS7
httpd (yum -y install httpd)
参考URL: https://qiita.com/S-Masakatsu/items/63b9e0e7a869d2aafc4b
手順
1. DocumentRoute (default = var/www/html) から index.html を削除 (最初からなければそのまま)
2. httpd.conf ()に以下の設定があることを確認
"Options Indexes FollowSymLinks"
# 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
#
3. systemctl restart httpd で リスタート
うまくいけば、以下のように folderがみえてダウンロード可能

追記: 2023/01/30
いつの間にやら Appache test page が表示されるようになってたので以下のように /etc/httpd/conf.d/welcome.conf の <LocationMatch> の部分をコメントアウトして対応。
[root@localhost www]# cat /etc/httpd/conf.d/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>
↓
# 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>
いいなと思ったら応援しよう!
