ubuntu server 安装svn svnmanager ssl svn+apache2 集成
安装svn和svn与apache集成的必要.so文件 执行:
apt-get -y install libapache2-svn apache2-mpm-prefork subversion subversion-tools
svn --version
sudo touch /etc/apache2/sites-aviliables/dev-svn
sudo vim /etc/apache2/sites-aviliales/dev-svn
<Location /svn> DAV svn #/srv/svn是你的svn版本库路径 SVNParentPath /srv/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd AuthzSVNAccessFile /etc/apache2/dav_svn.authz SVNListParentPath On Require valid-user </Location>
sudo chown -R www-data.www-data /srv/svn
sudo mkdir /etc/apache2/dav_svn.passwd
sudo mkdir /etc/apache2/dav_svn.authz
apt-get install php-pear
pear install -a VersionControl_SVN-0.3.3
<?php $htpassword_cmd = "/usr/bin/htpasswd"; $svn_cmd = "/usr/bin/svn"; $svnadmin_cmd = "/usr/bin/svnadmin"; $svn_repos_loc = "/srv/svn"; $svn_passwd_file = "/etc/apache2/dav_svn.passwd"; $svn_access_file = "/etc/apache2/dav_svn.authz"; $svn_trash_loc = ""; $svnserve_user_file=""; $smtp_server = "smtp.mailserver.net"; $dsn = "mysql://root:@localhost/svnmanager"; $admin_name = "admin"; $admin_temp_password = "admin"; ?>
chmod 777 /etc/apache2/dav_svn.passwd chmod 777 /etc/apache2/dav_svn.authz
mysql –u root –p
Mysql>create database svnmanager; Mysql>grant all privileges on svnmanager.* to 'svnmanager'@'localhost' identified by '[访问用户密码]'; Mysql>FLUSH PRIVILEGES; Mysql>quit;
apt-get install openssl
apt-get install ssl-cert
a2enmod ssl
mkdir /etc/apache2/ssl
cd /etc/apache2/ssl
openssl genrsa -des3 -out my-server.key 1024
openssl req -new -key my-server.key -x509 -out my-server.crt -config /etc/ssl/openssl.cnf
sudo cp my-server.key my-server.key.org
sudo openssl rsa -in my-server.key.org -out my-server.key
sudo /etc/init.d/apache2 restart
sudo touch /etc/apache2/sites-available/ssl
NameVirtualHost *:443 <VirtualHost *:443> ServerName www.test.com ServerAdmin webmaster@localhost DocumentRoot "/srv/www/dev" <Directory / > Options FollowSymLinks AllowOverride None </Directory> <Directory /srv/www/dev> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On SSLEngine on SSLCertificateFile /etc/apache2/ssl/my-server.crt SSLCertificateKeyFile /etc/apache2/ssl/my-server.key <Location /svn> DAV svn SVNParentPath /srv/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd AuthzSVNAccessFile /etc/apache2/dav_svn.authz SVNListParentPath On Require valid-user </Location> Alias /svnmanager "/opt/svnmanager-1.08/" <Directory "/opt/svnmanager-1.08/"> SSLRequireSSL </Directory> </VirtualHost>
a2ensite ssl
https://192.168.2.119/svnmanager/