NGiNXでうまくいかなかったので、とりあえず動く例が欲しくなって試す。 環境は、基本、NGiNXの時と同じ
XenServer 6.5SP1 | |
CPU | 2 |
Memory | 2048M |
Disk | 20G |
NIC | 2 |
OS | FreeBSD 10.2 |
Apacheなんて15年ぶりなので、正直、グッとくるhttpd.confのサンプルがない。 なので、とりあえずの設定。
FreeBSDの場合、ports/pkgからInstallすると、Apache関連の設定ファイルは/usr/local/etc/apache24
に格納される。
LoadModule alias_module libexec/apache24/mod_alias.so
をコメントアウトOptions Indexes FollowSymLinks
をOptions -Indexes +FollowSymLinks
に変更security.conf
を作成# # Apache Security Conf. # # Prevent CrossSite Tracing TraceEnable Off # Hide Apache Version ServerTokens ProductOnly ServerSignature off <IfModule headers_module> # Hide Header X-Powered-By Header always unset X-Powered-By # Prepend Click-Jacking Header append X-FRAME-OPTIONS "SAMEORIGIN" # for IR^?E Header set X-Content-Type-Options: "nosniff" </IfModule> # Anti POODLE <IfModule ssl_module> SSLProtocol All -SSLv2 -SSLv3 </IfModule> # Prevent to access to SCM Dir. <DirectoryMatch "/\.svn"> Require all denied </DirectoryMatch> <DirectoryMatch "/\.git"> Require all denied </DirectoryMatch> <DirectoryMatch "/\.hq"> Require all denied </DirectoryMatch> <DirectoryMatch "/\.bzr"> Require all denied </DirectoryMatch>
Includes/mod_security.confに以下を記載
# Include mod_security module LoadModule security2_module libexec/apache24/mod_security2.so <IfModule security2_module> Include etc/modsecurity/*.conf </IfModule>
Apacheなんて正直15年位真面目に使ってなかった(LighttpdとかNGiNXに転んだから)のでとてつもなく恥ずかしいが、幾つかのメモ
apachectl -l
apachectl -M