Install and configure SVN in ubuntu

Source: Internet
Author: User
Tags svn client tortoisesvn
Ubuntu installation and configuration SVN Step 1: install the apache2libapache2-svnsubversionsudoapt-getinstallapache2sudoapt-getinstallsubversionsudoapt-getinstalllibapache2-svn after installation follow the prompts Run & amp; #39 ;/... ubuntu installation and configuration SVN Step 1: install apache2 libapache2-svn subversionsudo apt-get install apache2sudo apt-get install subversionsudo apt-get install libapache2-svn
After installation, follow the prompts to Run '/etc/init. d/apache2 restart' to activate new configuration! Restart apache2
Step 2: create the SVN library and project sudo mkdir/home/svn // create the SVN Library sudo svnadmin create/home/svn/project // create the project Step 3: create a group and add the sudo addgroup subversion // create a group named subversion as the directory where the repository is located. the system prompts: adding the group "subversion" (GID 1001 )... complete. Sudo usermod-G subversion-a www-data // add yourself and "www-data" (Apache user) to the group member www.2cto.com to view: more/etc/group | grep subversion system prompt: subversion: x: 1001: www-data
Step 3: modify the project permission sudo chown-R root: subversion/home/svn/projectsudo chmod-R g + rws/home/svn/project // assign the group members the permission to view txn-current- the ls-l/home/svn/myproject/db/txn-current-lock system prompts the permissions and users of the lock file and the group information: -rw-rwSr -- 1 root subversion 0/home/svn/project/db/txn-current-lock Step 4: Access the sudo svn co file library through commands: // lodalhost/home/svn/project // method 1. use sudo svn co file: // home/svn/project // Two methods: If you are not sure about the host, file: // is used. the system prompts three slashes: Get version 0. The version can be retrieved, indicating that the SVN server is running normally. Next, visit step 5 from webdav: configure apache2 to modify/etc/apache2/mod-available/dav_svn.confsudo vim/etc/apache2/mod-available/dav_svn.conf and add the following code: ====================================== DAV svnSVNPath/home/svn/myprojectAuthType BasicAuthName "project subversion repository" AuthUserFile/etc/subversion/passwd Require valid-user If you need to verify the user password every time you log on And Comment out www.2cto.com and add the code. then restart apache2 ============================ ===
Step 6: create the/etc/subversion/passwd file, this file contains the user authorization details. add the user sudo htpasswd-c/etc/subversion/passwd [user_name] // add the user for the first time using the parameter "-c" and then add no need to access the file repository svn co http: // hostname/svn/project -- username [username] OK! This time, I accessed the version library through the web page. next I will interview you to import the version library to the version library and import the content under/var/www/to the version number: sudo svn import-m "first import"/var/www http: // 192.168.0.5/svn/project ==================================== ======= system prompt: certification field: Myproject subversion repository "root" Password: authentication domain: Myproject subversion repository username: test "test" Password: Add/var/www/index.html -----------------------------------------------------------------------
Note! Your password, for the authentication domain: Myproject subversion repository can only be stored on the disk in plain text! If possible, configure your system so that the Subversion can save the encrypted password. See the documentation for details. You can /. in subversion/servers, set "store-plaintext-passwords" to "yes" or "no" to avoid this warning again. ----------------------------------------------------------------------- Save the unencrypted password (yes/no )? Enter 'yes' or 'no': yes www.2cto.com. the submitted version is 1. ========================================================== = Finally, access through TortoiseSVN and web pages in windows, successful. ========================================================== = Version database error detected during the test: sudo svn co http://192.168.0.5 /Home/svn/project svn: Method OPTIONS fails to be http://192.168.0.5 /Home/svn/myproject ": 200 OK ( http://192.168.0.5 This error has been found on the Internet for a long time, and there is nothing to learn from. it may be that the user name and permissions are incorrect, so we will wait for the confirmation of sudo svn co. file://localhost/home/svn/projectsvn : Unable to open ra_local session svn for URL: unable to open version Library" file://localhost/home/svn/projcet "1. install SVN apt-get install subversion2. create svn repository 1 ). create the svn Directory: mkdir/home /. svn (use a hidden directory) 2 ). cd/home /. svn www.2cto.com 3 ). mkdir astar 4 ). create a repository astar: svnadmin create/home /. svn/astar. after execution, the astar directory contains the directories and files created by svnadmin 5 ). mkdir test 6 ). create a repository test: svnadmin create/home /. svn/test. after execution, the test directory contains the directories and files created by svnadmin. configure and manage svn 1 ). the configuration file for each repository is under $ repos/conf/, and vi svnserve. conf. the configuration item is under [general]: anon-access: Anonymous user permission, which can be read, wri Te and none; default value: read. Anonymous user access is not allowed: anon-access = none auth-access: permission for user authentication, which can be read, write, or none. the default value is write. Password-db: the path of the password database. remove the # authz-db from the front: the path of the authentication rule repository. remove the # from the front #. Note: the rows of these configuration items must be the top level; otherwise, an error is reported. After you modify the configuration, you need to restart svn to make it take effect. 2). configure the passwd file. this is the password file for each user. it is relatively simple, that is, "user name = password", with an explicit code. For example, allen = 111111 3 ). configure the authz File 1. [groups] section: to facilitate management, you can put some users in a group, such as: owner = allen, ellen 2. the sections under the groups table indicate the authentication rules for a directory. for example, the section of the authentication rules for the root directory is [/]. When setting authentication rules for a single user, a single user line is displayed, for example: [/] www.2cto.com allen = rw # allen has the permission to the root directory rw ellen = r # ellen has the permission to the root directory r. If the group is used, add @ Before the group name @, for example, @ owner = rw # all users in the group owner are rw, which is equivalent to the above two statements if the start is from/home /. svn/astar is started, and/is the astar Directory. use the above method to set permissions as the root of the astar directory. If it is started from/home/. svn/, the root of each warehouse is its own starting directory. You can set the astar permission in the preceding way, or use the following method: [astar:/] @ owner = rw to set the test permission: [test: /] @ harry_and_sally = rw in short, the root directory (/) of each warehouse is its own starting directory; [repos:/] This method is only applicable to multiple warehouses; [/] it is suitable for single warehouse and single warehouse. 3. permissions cannot be set across warehouses. 4. start and stop svn www.2cto.com 1 ). start: 1. start from the astar Directory, svnserve-d-r/home /. svn/astar. the root directory (/) is astar. use section [/] for rule configuration in authz. Access Method: svn: // 192.168.0.87/2. from. svn directory startup, svnserve-d-r/home /. svn, the root directory (/) is. for svn and authz, use section [astar:/] for the astar configuration, and use section [test:/] for the test configuration. The access method is svn: // 192.18.0.87/astar svn: // 192.18.0.87/test. if you need to start svn, add the command to/etc/rc. in local 2 ). check whether the svn server has been started (svn uses port 3690 by default): netstat-an | grep 3690 3 ). stop: killall svnserve5. TortoiseSVN is recommended for svn client, http://tortoisesvn.tigris.org/ Eclipse plug-in, http://subclipse.tigris.org/ Author t80t90s

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.