Apacheをインストール&初期設定
はじめに
nginxをインストールして使おうとしてたけど、GitBucket の動作がよろしくない。
事象はLogin時にURLが http://localhost:8080 に遷移するので、リダイレクトの設定したけどうまくいかなかったので、あきらめて Apache を入れます。
Apacheインストール
yum install httpd
パッケージ
インストール完了
自動起動有効化 & Apahe起動
# 自動起動を有効化 systemctl enable httpd # Apache起動 systemctl start httpd
ブラウザで確認
- 起動することを確認
初期設定
- バージョン非表示
- ファイル一覧の非表示(Indexes削除)
/etc/httpd/conf/httpd.conf
<Directory "/var/www/html"> ~(中略)~ # [変更] ディレクトリ内のファイル一覧を非表示 #Options Indexes FollowSymLinks Options FollowSymLinks ~(中略)~ </Directory> ~(中略)~ # [追加] レスポンスヘッダーの「Server」のバージョン非表示 ServerTokens Prod
/etc/httpd/conf.d/autoindex.conf
<Directory "/usr/share/httpd/icons"> ~(中略)~ # [変更] ディレクトリ内のファイル一覧を非表示 #Options Indexes MultiViews FollowSymlinks Options MultiViews FollowSymlinks ~(中略)~ </Directory>
/etc/httpd/conf.d/userdir.conf
<Directory "/home/*/public_html"> ~(中略)~ # [変更] ディレクトリ内のファイル一覧を非表示 #Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Options MultiViews SymLinksIfOwnerMatch IncludesNoExec ~(中略)~ </Directory>
おわりに
次回以降はSSL(https)やTomcatとの連携(ajp)をやっていきます。