配置https
- 安装软件,制作key
sudo apt-get install subversion apache2 libapache2-svn
sudo a2enmod ssl
sudo mkdir /etc/apache2/ssl
sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key
- 修改apache的监听端口,其他几个443可以删除掉,可能报错
sudo vi /etc/apache2/ports.conf
NameVirtualHost *:443
Listen 443
- 修改ssl的鉴权
sudo vi /etc/apache2/sites-available/default-ssl
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
- 启动配置并重启apache
sudo a2ensite default-ssl
sudo /etc/init.d/apache2 restart
配置SVN
- 增加svn目录
sudo mkdir /svn
sudo vi /etc/apache2/mods-enabled/dav_svn.conf
<Location /svn>
DAV svn
SVNParentPath /svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
SSLRequireSSL
</Location>
- 创建svn用户和密码
sudo htpasswd -cm /etc/apache2/dav_svn.passwd abc
- 给文件夹增加权限
sudo chown -R www-data:www-data /svn
- 重启apache
sudo /etc/init.d/apache2 restart
成功
https://192.168.x.x/svn/myrepo
参考
https://rbgeek.wordpress.com/2012/09/09/svn-server-on-ubuntu-with-https-access/
网友评论