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