背景:测试机是从生产克隆而来,但是CollabnetSubversion从1.8升级到1.9。
原先环境:redhat升级到5.11。
选择的软件:httpd-2.2.31和subversion-1.8.15。
已经安装了新版本的OpenSSL 1.0.2g。
参考下面:
http://blog.csdn.net/yuanchao99/article/details/25308309
http://running.iteye.com/blog/1973284
1 下载安装apr-1.5.2.tar和apr-util-1.5.4.tar
[root@svnsubv apr-1.5.2]# ./configure --prefix=/usr/local/apr
省略
[root@svnsubv apr-1.5.2]# make
[root@svnsubv apr-1.5.2]# make install
[root@svnsubv apr-1.5.2]# /usr/local/apr/bin/apr-1-config --version
1.5.2
[root@svnsubv apr-1.5.2]#
[root@svnsubv apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
[root@svnsubv apr-util-1.5.4]# make
[root@svnsubv apr-util-1.5.4]# make install
[root@svnsubv apr-util-1.5.4]# /usr/local/apr-util/bin/apu-1-config --version
1.5.4
[root@svnsubv apr-util-1.5.4]#
2 安装httpd:
./configure --prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd/ --with-included-apr --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config --enable-dav --enable-so --enable-maintainer-mode --enable-ssl=static --with-ssl=/usr/local/openssl
make
make install
有时需要提前设置环境变量
export LDFLAGS=-ldl
3 安装subversion:
下载subversion-1.8.15.tar.gz和sqlite-amalgamation-3120100.zip。并将sqlite解压放入subversion目录,目录名为sqlite-amalgamation。
./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl=/usr/local/openssl --with-libs=/usr/local/openssl
make
make install
4 修改httpd的配置:
LoadModule dav_svn_module /usr/local/subversion/libexec/mod_dav_svn.so
LoadModule authz_svn_module /usr/local/subversion/libexec/mod_authz_svn.so
LoadModule php5_module modules/libphp5.so
User csvn
Group csvn
<IfModule dir_module>
DirectoryIndex index.php index.cgi index.html
</IfModule>
AddType application/x-httpd-php .php .phtml
Include /etc/httpd//extra/httpd-vhosts.conf
Include /etc/httpd//extra/httpd-ssl.conf
Include /etc/httpd/subversion.conf
Include /etc/httpd/svnmanager.conf
subversion.conf
<Location /svn>
DAV svn
SVNParentPath /data/svn/svnroot/
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /data/svn/svnauth/svn_auth_file
AuthzSVNAccessFile /data/svn/svnauth/svn_access_file
Satisfy Any
Require valid-user
#SSLRequireSSL
</Location>
svnmanager.conf
Alias /svnmanager/ "/opt/svnmanager-1.08/"
<Directory "/opt/svnmanager-1.08/">
AllowOverride none
# Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}$1 [L,R]
# RewriteBase /
# RewriteCond %{SERVER_PORT} 443
# RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</VirtualHost>
httpd-ssl.conf
Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4
SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4
SSLHonorCipherOrder on
SSLProtocol all -SSLv2 -SSLv3
SSLProxyProtocol all -SSLv2 -SSLv3
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:/usr/local/apache2//logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
SSLMutex "file:/usr/local/apache2//logs/ssl_mutex"
<VirtualHost _default_:443>
DocumentRoot "/opt/bugzilla-4.4.11"
ServerName bugzilla.leniovo.com:443
ServerAdmin zhaoxp2@lenovo.com
ErrorLog "/usr/local/apache2//logs/error_log"
TransferLog "/usr/local/apache2//logs/access_log"
SSLEngine on
SSLCertificateFile "/etc/httpd/server.crt"
SSLCertificateKeyFile "/etc/httpd/server.key"
SSLCertificateChainFile "/etc/httpd/server.crt"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/usr/local/apache2//cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "/usr/local/apache2//logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>