A tutorial on configuring/Installing SVN in the Ubuntu system

Source: Internet
Author: User
Tags anonymous mkdir svn svn client tortoisesvn

Ubuntu Install and configure SVN
First step: Install apache2 libapache2-svn Subversion
sudo apt-get install apache2
sudo apt-get install subversion
sudo apt-get install LIBAPACHE2-SVN
Follow the prompts when you are finished installing
Run '/etc/init.d/apache2 restart ' to activate new configuration!
Restart Apache2
Step Two: Create SVN libraries and projects
sudo mkdir/home/svn//create SVN Library
sudo svnadmin create/home/svn/project//Create Project
Step Three: Create groups and add members
sudo addgroup subversion//Create a group called Subversion to own the directory where the warehouse resides
System hint: Adding Group "Subversion" (GID 1001) ...
sudo usermod-g subversion-a www-data//Put yourself and "Www-data" (Apache users) into group membership
View: More/etc/group | grep subversion
System Hint: subversion:x:1001:www-data
Step Three: Modify Project Permissions
sudo chown-r root:subversion/home/svn/project
sudo chmod-r g+rws/home/svn/project//Give group members the appropriate permissions for all files newly added to the file warehouse
View permissions and user and group information for txn-current-lock files
System hint:-rw-rwsr--1 root subversion 0 2011-01-25 17:47/home/svn/project/db/txn-current-lock
Step Fourth: Access the Library by command
sudo svn co file://lodalhost/home/svn/project//first method, knowing the host name with
sudo svn co file:///home/svn/project//The second method, when unsure of the host's life, uses a file:///, three slash
System tip: Remove version 0.
You can take out the version to show that the SVN server is running properly, and try to access from WebDAV
Fifth Step: Configure Apache2
sudo vim/etc/apache2/mods-available/dav_svn.conf
Add the following code:

The code is as follows Copy Code
AuthType Basic
AuthName "Project Subversion repository"
<limitexcept Get PROPFIND OPTIONS report>
Require Valid-user

If you want users to authenticate each time they log on, <limitexcept get PROPFIND OPTIONS report> with </LimitExcept> Two lines are commented out
Restart apache2 after adding code
Step Sixth: Create a/etc/subversion/passwd file that contains details of the user's authorization
Add user
sudo htpasswd-c/etc/subversion/passwd [user_name]////The first time you add a user using the parameter "-C" then add it later.
Accessing the File Warehouse
SVN Co http://hostname/svn/project Project--username [username]
Ok! This time through the Web page access to the version library, and then try to import the version library
Import Version Library
Import the content under/var/www/into the version number:
sudo svn import-m "first import"/var/www Http://
System prompts:
Certification domain: Password for "root":
Certification domain: User name: Test
Password for "test":
Attention! Your password, for the authentication domain:
Can only be saved in plaintext on disk! If possible, consider configuring your system so that Subversion
You can save the encrypted password. Please refer to the documentation for more information.
You can set the option "Store-plaintext-passwords" to "yes" or "no" in "/home/icedot/.subversion/servers".
To prevent this warning from appearing again.
Save an unencrypted password (yes/no)?
Please enter ' yes ' or ' no ': Yes
The submitted version is 1.
Finally, it was successfully accessed via TORTOISESVN and Web pages under Windows.
Errors that have occurred in the course of the trial
Check out version Library error:
sudo svn co
SVN: Method options failed in "Http://": "OK" (
This error is checked on the internet for a long time, there is nothing to learn from the information, vague sleep may be said that the user name and permissions are not right, to be later confirmed
sudo svn co file://localhost/home/svn/project
SVN: Unable to open ra_local session for URL
SVN: Unable to open version library "File://localhost/home/svn/projcet"
1. Install SVN
Apt-get Install Subversion
2. Set up SVN warehouse
1. Set up SVN directory: MKDIR/HOME/.SVN (using hidden directories)
2). cd/home/.svn
3). mkdir Astar
4. Create Warehouse astar:svnadmin Create/home/.svn/astar, after execution Astar directory has svnadmin created directories and files
5). mkdir Test
6. Create Warehouse test:svnadmin create/home/.svn/test, after execution, the test directory has svnadmin created directories and files
3. Configuring and Managing SVN
1. The configuration files for each warehouse are under $repos/conf/, VI svnserve.conf, and the configuration items under [general]:
Anon-access: Permissions for anonymous users, can be read,write and none, default value read. Do not allow anonymous user access: Anon-access = None
Auth-access: Authenticated user permissions, can be read,write and none, default value write.
PASSWORD-DB: The path to the password database, remove the front #
AUTHZ-DB: The path to the authentication rule library, remove the front #.
Note: The rows of these configuration items are below, or they will be an error. After you modify the configuration, you need to restart SVN to take effect.
2). Configure passwd files
This is the password file for each user, relatively simple, is "username = password", using the plaintext. such as allen=111111
3). Configure Authz Files
1. [Groups] section: In order to facilitate management, some users can be placed inside a group, such as: Owner=allen,ellen
2. The sections below groups represents the authentication rules for a directory, such as the section of the authentication rule for the root directory [/]. A single user line when setting up a single-user authentication rule, such as:
ALLEN=RW #allen对根目录的权限为rw
Ellen=r #ellen对根目录的权限为r
If you use group, you need to add @ before the group name, such as
@owner =RW #group owner of the user is RW, equivalent to the two words above
When booting from/home/.svn/astar,/is the Astar directory, set the permissions on the Astar directory as the root.
If you start from/home/.svn/, each warehouse root is your own starting directory. You can set Astar permissions as above, or you can use the following methods:
@owner =RW
The permissions to set test are as follows:
@harry_and_sally = RW
In short, the root directory (/) of each warehouse is its own starting directory; [repos:/] This approach applies only to multiple warehouses; [/] Suitable for single warehouse and single warehouse.
3. You cannot set permissions across warehouses.
4. Start and Stop SVN
1). Start:
1. Boot from the Astar directory, svnserve-d-r/home/.svn/astar, the root directory (/) is the configuration of the rule in Astar,authz use section[/]. The access mode is:
2. Boot from the. SVN directory, svnserve-d-r/home/.svn, the root directory (/) is the Astar configuration using section[astar:/in. Svn,authz, using section[test:/for the configuration of test. The access mode is:
If you need SVN to start, add the command to the/etc/rc.local
2. Check to see if SVN server has been started (SVN defaults to use port 3690): Netstat-an | grep 3690
3). Stop: Killall svnserve
5. SVN client
Recommended use of TORTOISESVN, http://tortoisesvn.tigris.org/
Eclipse Plug-in, http://subclipse.tigris.org/

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.