• Apache+Subversion+TortoiseSVN


    Key words: dav_svn, apache, subversion, tortoisesvn

    # install apache2
    sudo apt-get install libapache2-svn apache2
    # install subversion
    sudo apt-get install subversion

    # enable the module mod_dav_svn

    sudo a2enmod ssl
    sudo a2enmod dav_svn

    # create the directory for svn
    mkdir -p /var/svn

    # create the SVN repository
     sudo svnadmin create /var/svn/repoOne
     (then grant the necessary for the account apache will be running under. say we will run under the default account of ubuntu, then make ubuntu the owner of the repository)
     sudo chown -R ubuntu repoOne
     (Need to make sure the apache account has sufficient permission to this folder.)

    # edit the envars
    vi /etc/apache2/envars, change as below:

    export APACHE_RUN_USER=ubuntu
    export APACHE_RUN_GROUP=ubuntu

    # create svn authentication file under /etc/apache2/svn-auth-file

    ##first user for userOne(need "-c" argument as to create a new auth file)
    sudo htpasswd -cm /etc/apache2/svn-auth-file userOne [PWD]
    ##second user for userTwo
    sudo htpasswd -m /etc/apache2/svn-auth-file userTwo [PWD]

    # edit dav_svn.conf

    vi /etc/apache2/mods-enabled/dav_svn.conf, so apache knows all accesses to the resource under the directory need to be handled by the module of mod_dav_svn.

    <Location /svn>
      DAV svn
      SVNParentPath /var/svn
      AuthType Basic
      AuthName "Subversion Repository"
      AuthUserFile /etc/apache2/svn-auth-file
      Require valid-user
      SSLRequireSSL
    </Location>

    ## For AuthType, there can be two options:

    Basic: this will leverage the ssl over http communication
    DSA: not recommended

    ## For SVNParentPath, easy for new repository creation, otherwise use SVNPath instead for single repository

    # create self assigned cert
    sudo apt-get install ssl-cert
    sudo mkdir /etc/apache2/ssl
    sudo /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem

    # new virtual host for svn

    create a new virtual server called "svnserver" under /etc/apache2/sites-enabled, contents as below:

    NameVirtualHost *:443
    <VirtualHost *:443>
            ServerName serverName
            ServerAdmin webmaster@localhost
            SSLEngine on
            SSLCertificateFile /etc/apache2/ssl/apache.pem
            SSLProtocol all
            SSLCipherSuite HIGH:MEDIUM
            DocumentRoot /var/svn

            ErrorLog ${APACHE_LOG_DIR}/error_svn.log

            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
    </VirtualHost>

    # restart apache
    sudo service apache2 restart

    # check svn setup
    put the link either in browser or TortoiseSVN

    https://serverName/svn/repoOne/


    Reference:

    http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.serverconfig.choosing.apache

    http://stackoverflow.com/questions/60736/how-to-setup-a-subversion-svn-server-on-gnu-linux-ubuntu




  • 相关阅读:
    未能加载包“Microsoft SQL Server Data Tools”
    SharePoint 客户端对象模型共用ClientContext的坑
    安装VisualStudio 2015 x64 中文企业版失败
    Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0 系统找不到指定的文件。
    为Sharepoint 2010 批量创建SharePoint测试用户
    User Profile Service Application 配置同步连接时,报 MOSS MA not found
    SharePoint 2010 系统账户没完全控制权限了
    百度编辑器 UEditor 报错汇总
    更改SharePoint 2007/2010/2013 Web 应用程序端口号
    SharePoint 2013 报:网站在改进过程中处于只读状态,对此给您带来的不便,我们深表歉意
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/5266397.html
Copyright © 2020-2023  润新知