美文网首页
svn+https ubuntu搭建

svn+https ubuntu搭建

作者: heliping_peter | 来源:发表于2018-11-09 17:43 被阅读15次

    配置https

    1. 安装软件,制作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
    
    1. 修改apache的监听端口,其他几个443可以删除掉,可能报错
    sudo vi /etc/apache2/ports.conf
    
    NameVirtualHost *:443
    Listen 443
    
    1. 修改ssl的鉴权
    sudo vi /etc/apache2/sites-available/default-ssl
    
    SSLCertificateFile /etc/apache2/ssl/apache.pem
    SSLCertificateKeyFile /etc/apache2/ssl/apache.key
    
    1. 启动配置并重启apache
    sudo a2ensite default-ssl
    sudo /etc/init.d/apache2 restart
    

    配置SVN

    1. 增加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>
    
    1. 创建svn用户和密码
    sudo htpasswd -cm /etc/apache2/dav_svn.passwd abc
    
    1. 给文件夹增加权限
    sudo chown -R www-data:www-data /svn
    
    1. 重启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/

    相关文章

      网友评论

          本文标题:svn+https ubuntu搭建

          本文链接:https://www.haomeiwen.com/subject/doioxqtx.html