One, SVN installation
1. Installation package
$ sudo apt-get install subversion
2. Add SVN Admin user and Subversion Group
$ sudo adduser svnuser
$ sudo addgroup subversion
$ sudo addgroup svnuser subversion
3. Create a project directory
$ sudo mkdir/home/svn
$ cd/home/svn
$ sudo mkdir Fitness
$ sudo chown-r root:subversion Fitness
$ sudo chmod-r G+rws Fitness
4. Create the SVN file repository
$ sudo svnadmin create/home/svn/fitness
5. Access mode and Project import:
$ SVN Co file:///home/svn/fitness
Or
$ SVN Co file://localhost/home/svn/fitness
Note
If you are unsure of the name of the host, you must use three slashes (///), and if you specify the name of the host, you must use two slashes (//).
//--
The following command is used to import the project into the SVN file repository:
$ svn import-m "New import"/home/svn/fitness file:///home/svnuser/src/fitness
Be sure to indicate the import information
//--------------------------//
6. Access Rights settings
Modify the/home/svn/fitness directory:
Svnserve.conf, passwd, Authz three files, no spaces allowed at the front of the line
//--
Edit the svnserve.conf file to uncomment the following two lines
password-db = password
Authz-db = Authz
Additional Information
# [General]
Anon-access = Read
auth-access = Write
Password-db = passwd
Where anon-access and auth-access are anonymous and privileged user permissions, default to anonymous users read-only permissions, but if you want to deny
User's access, simply change the read to none to achieve the goal.
//--
Edit/home/svnuser/etc/passwd as follows:
[Users]
Mirze = 123456
Test1 = 123456
Test2 = 123456
//--
Edit/home/svnuser/etc/authz as follows
[Groups]
admin = Mirze,test1
Test = Test2
[/]
@admin =RW
*=r
There are three users mirze,test1,test2 passwords are 123456.
where Mirze and test1 belong to the admin group, have read and write permissions, test2 belong to the test group only Read permission
7. Start the SVN service
Svnserve-d-R/HOME/SVN
Description Description:
-d means svnserver runs in daemon process mode
-r Specifies the root location of the file system (the repository's root directory) so that the client can access the repository without entering the full path
such as: svn://192.168.12.118/fitness
The SVN installation is now complete.
LAN access mode:
Example: SVN checkout svn://192.168.12.118/fitness--username Mirze--password 123456/var/www/fitness
-----------------------------------------------------------------------
II./HTTP [Apache]
1. Install package [Subversion installed]
$ sudo apt-get install LIBAPACHE2-SVN
Apt-get Install Apache2-utils
To create a version repository:
sudo svnadmin Create/directory Address
The directory address must exist, this is the place to save the repository, different versions of the repository to create different folders, such as:
sudo svnadmin create/home/svn/project
Originally/home/svn/project This directory under Nothing, execute the following command and then go to see, more files and folders, we need to operate is conf This folder, this folder has a file, called passwd, used to store the user name and password.
The repository directory is then licensed to Apache for Read and write:
sudo chown-r www-data:www-data/directory Address
Then come to open the Apache configuration file:
sudo gedit/etc/apache2/mods-available/dav_svn.conf
Add the following content:
<Location/project>
DAV SVN
Svnpath/home/svn/project
AuthType Basic
AuthName "MyProject Subversion repository"
authuserfile/home/svn/project/conf/passwd
#<limitexcept GET PROPFIND OPTIONS report>
Require Valid-user
#</limitexcept>
</Location>
Location says access address, such as the above address, when Access is
Http://127.0.0.1/project
Two of these lines are commented out to ensure that the user name password is required every time.
The last step is to create access to the user, it is recommended that the user name password file in the current version of the repository under the Conf folder, so the version of the warehouse when there is no too much confusion.
Because the passwd file already exists under the Conf folder, add the user directly:
sudo htpasswd-c/home/svn/project/conf/passwd test
Then enter the password two times, Laoyang this user is created.
Open/HOME/SVN/PROJECT/CONF/PASSWD This file will open to text like the following form:
Test:wed.83h.geala//followed by the encrypted password.
Once created, you will need to add this user to another repository and copy the line directly to the past.
Restart Apache for you.
Sudo/etc/init.d/apache2 restart
This article is from the "Network Engineering topic" Blog, please be sure to keep this source http://houzhibo.blog.51cto.com/3103241/1597826
Ubuntu under SVN Server installation configuration