要讓 SVN Server 只接受 SSL 連線比較重要的地方在於 /etc/httpd/conf.d/subversion.conf
要加入 SSLRequireSSL 設定
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /svn/repos
# Require SSL connection for password protection.
SSLRequireSSL
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/subversion/htpasswd
AuthzSVNAccessFile /etc/subversion/authz
Require valid-user
</Location>
另外要把 http 連線轉成 https 要在 /etc/httpd/conf/httpd.conf 加入
<VirtualHost *:80>
ServerAdmin webmaster@gmail.com
DocumentRoot /var/www/html
ServerName svn.example.com
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*)$ https://192.168.1.2/$1 [R=301,L]
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
留言列表