Ubuntu (6) install subversion (SVN) + apache2

Source: Internet
Author: User

To use SVN + HTTP to control access, Windows has a very convenient visualsvn server, and Linux has to build its own SVN and the corresponding web server. Generally, select subversion + apache2.

The following content is excerpted from the subnet and modified accordingly: (Michael is the user name. Please modify it accordingly)

1 , Installation Apache2 And Subversion Module
In the Ubuntu Software Center Search in "Apache2 ", Install Apache2, apache2-common, apache2-utils, apache2-doc (Apache Documentation, recommended Installation ), Libapache2-svn (apache2 Of Subversion Module ) .
2 , Create Subversion Library
Create directory:


$ Sudo mkdir-P/var/local/Repos


CreateSubversionLibrary:


$ Sudo svnadmin create/var/local/Repos


Grant ownershipApache (www-data ),To read and write the database files: ----- You can skip this step and use it in step 3.Htpasswd2OrHtpasswdCommand to set the user name and password


$ Sudo chown-r www-data: www-data/var/local/Repos


3 , configure apache2 (use the basic authentication method, that is, the user name and password)
modify /etc/apache2/mod-available/dav_svn.conf, change the corresponding row to:


<Location/repos>
Dav SVN
Svnpath/var/local/Repos
Authtype basic
Authname "subversion repository"
Authuserfile/etc/apache2/dav_svn.passwd
<Limitaskt get PROPFIND Options Report>
Require valid-user
</Limit10000t>
</Location>

Note: addSVN RepositoryUser:

To create a user on the repository use, the following command:

Sudo htpasswd2-CM/etc/apache2/dav_svn.passwd <username>

---Note: some are notHtpasswd2Command,HtpasswdCommand, you can go/Usr/bin/Find this command.

Note that you shoshould only use the-C option the first time that you create a user. after that you will only want to use the-M option, which specifies MD5 encryption of the password, but doesn't recreate the file.

Example:

Sudo htpasswd2-CM/etc/apache2/dav_svn.passwd geek
New password:
Re-type new password:
Adding password for user geek

If you want to force all users to authenticate even for read access, add the following line right below the authuserfile line from abve. Restart Apache after changing this line.

Require valid-user


4RestartApache2:


# Sudo/etc/init. d/apache2 restart


5Open a browser and accessHttp: // localhost/repos,You can seeSubversionLibrary page. (Of course, there are no other things yet. We will import some files below)


6, Add/Home/Michael/workspaceFileHttp: // localhost/ReposUnderWorkspaceDirectory


$ SVN import-M"Operation notes"/Home/Michael/workspaceHttp: // localhost/repos/workspace


7,Checkout http: // localhost/repos/workspaceFile/Home/Michael/test


$ SVN checkout http: // localhost/repos/workspace/home/Michael/test

 

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.