Linux 6.6 で Apache 2.4.18 を介して SVN を構成しました。次に、svn URL のクロス フレーム スクリプティングを無効にする必要があります。SVN URL はhttps://servername/svn/projectAのようなものです。mod_security2.so をコンパイルし、/modules ディレクトリにコピーしてロードし、virtualHost に次の行を追加しました。
LoadFile /usr/lib64/libxml2.so
LoadFile /usr/lib64/liblua-5.1.so
LoadModule security2_module modules/mod_security2.so
httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin email@domain.com
DocumentRoot "/var/local/apache/httpd2.4.18/htdocs"
ServerName servername.fqdn.com
# For http to https redirect
Redirect / https://servername
TraceEnable off
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
SecRuleEngine On
#SecFilterEngine On
#SecFilterForceByteRange 32 126
#SecFilterScanPOST On
#SecFilter "<( |\n)*script"
SecRequestBodyAccess On
SecResponseBodyAccess On
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common
</VirtualHost>
Apache がサポートしていないルールは次のとおりです。
SecFilterEngine SecFilterForceByteRange SecFilterScanPOST SecFilter Blockquote
SecFilterEngine の代わりに、SecRuleEngine を取ります。しかし、私は他のルールの代替ルールを知りません。modsecurity-2.9.0 ソースをコンパイルして使用しています。私が見るエラーは以下の通りです。[root@server extra]# /var/local/apache/httpd2.4.18/bin/apachectl configtest AH00526: /var/local/apache/httpd2.4.18/conf/extra/httpd-vhosts.conf の 45 行目の構文エラー: 無効なコマンド 'SecFilterForceByteRange' です。スペルが間違っているか、サーバー構成に含まれていないモジュールによって定義されている可能性があります。mod_security2 が SecFilterForceByteRange、SecFilterScanPOST、および SecFilter でサポートするモジュールを知っている人は誰でも知っています。mod_security に関するドキュメントも読みましたが、問題を把握して解決することはできませんでした。以下のURLをたどりました。
http://www.unixpearls.com/how-to-block-xss-vulnerability-cross-site-scripting-in-apache-2-2-x/
[編集]ヘッダー応答を追加することで解決しました。