Build an SSL-based svn Server

Source: Internet
Author: User

Setting up an SSL-based svn server strictly speaking, configuration management is not in the scope of CI, but I personally think that as a process improvement practice, the better configuration management is, the more conducive to CI implementation. Configuration Management is not the focus of this article. I want to introduce Version Control in two key aspects of Configuration Management (Configuration Policy and version control. Starting from the use of version management tool svn, this article mainly introduces how to build svn servers. Www.2cto.com svn (subversion) is a famous open-source version control software. I believe many developers are using it for code management. For more information, see http://subversion.apache.org /. You may know how to use svn for daily code check in and check out, but you may not necessarily know how to build a svn server. This blog is mainly about this. All of the following operations are performed on Ubuntu, so you may need to know something about Ubuntu. The first step to build svn is of course installed, under Ubuntu you can do sudo apt-get install subversion libapache2-svn libapache-mod-dav apache2 if the installation fails because the installation package cannot be found, run apt-get install update first. step 2: Enable SSL. sudo a2enmod sslsudo sh-c "echo 'Listen 100'>/etc/apache2/ports. conf "because the default port of SSL is port 443, we add it to the apache port configuration file.
Step 3: Generate SSL authentication, install the SSL authentication service www.2cto.com sudo apt-get install ssl-certsudo mkdir/etc/apache2/sslsudo/usr/sbin/make-ssl-cert/usr/share/ ssl-cert/ssleay. cnf/etc/apache2/ssl/apache. pem
Step 4: Create a site. The $ SITENAME environment variable here can be a name you like. Sudo cp/etc/apache2/sites-available/default/etc/apache2/sites-available/$ SITENAMEsudo vim/etc/apache2/sites-available/$ SITENAME and then modify the site configuration file as follows:

The next step is to configure an svn access account: sudo htpasswd2-c-m/etc/apache2/dav_svn.passwd $ AUTH_USER and then restart the apache service to start the site sudo a2ensite $ SITENAMEsudo/etc/init. d/apache2 restart if the restart fails, it may be that the VM is not found by apache. Add this line of ServerName $ SERVERNAME to the/etc/apache2/apache2.conf file. Step 5 is the time to create the svn knowledge base. First, create a directory to store svn configuration information, and then create an environment variable $ REPOS to store content, and change the access permission www.2cto.com sudo mkdir/var/svnsudo export REPOS = your knowledge base path sudo svnadmin create/var/svn/$ REPOSsudo chown-R www-data: www-data/var/svn/$ REPOSsudo chmod-R g + ws/var/svn/$ REPOS step 6 Add basic authentication information, $ AUTH_USER: Just give your favorite user name. Sudo htpasswd2-c-m/etc/apache2/clusters $ AUTH_USER and modify the WebDav and svn configuration files sudo vim/etc/apache2/mod-available/dav_svn.conf to add the following DAV svnSVNParentPath//svnAuthType BasicAuthName "Subversion Repository" AuthUserFile/etc/apache2/dav_svn.passwdRequire valid-userSSLRequireSSL and cancel the annotations for the two rows # <limit%t get propfind options report> # </limit#t> alas! Configuring the svn server is really troublesome! Fortunately, this is the last step. For the rest, restart apache to enable our configuration. Sudo/etc/init. d/apache2 restart if everything is normal and you have not typed the wrong letter, apache should be able to start normally. In this case, enter the following in your browser's address bar: https://localhost/svn/ Your knowledge base name. The prompt "enter user name and password" dialog box appears. After you pass the authentication, you will see the following interface (test.html is imported by myself, and there should be no files by default ).

If no error occurs in the above steps, the interface will be displayed normally. If it fails, the error 403 is used in most cases. Check the port and directory permissions. Author: moonz-wu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.