Build SVN server under Ubuntu (Mint)

Source: Internet
Author: User
Tags 403 forbidden error

Create an SVN server in Ubuntu (Mint. install Subversion1 www.2cto.com sudo apt-get install subversion2. create a repository. Assume that the parent directory of our repository is/home/svn 12cd/home/svnsudo svnadmin create/home/svn/test. You can see/home/Repository. several files 3. start svn Server 1 sudo svnserve-d-r/home/svn4. test svn server 12svn co file: // localhost/home/svn/test output: checked out revision 0 indicates that the installation is successful. If you want to access it through a browser, you need to work with apache: 1. if apache is not installed, Install apache and libapache2-svn 1 sudo apt-get install apache libapache2-svn2 first. integrated SVN modification/etc/apache2/mod-available/dav_svn.conf <Location/svn> DAV svn SVNParentPath/home/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile/etc/subversion/unzip AuthzSVNAccessFile /etc/subversion/dav_svn.authz Require valid-user </Location> description: 1. SVNParentPath indicates the parent directory of all databases. Only one SVNParentPath and SVNPath can be enabled. SVNPath can only create one repository, while SVNParentPath can create multiple repositories. Because there is usually not only one repository, SVNParentPath2.AuthUserFile is usually selected as the svn user configuration file and its location can be customized, files also need to be created by yourself, but ensure that apache has access permissions. 3. authzSVNAccessFile is the svn permission control file, and others are the same as AuthUserFile 3. add SVN user 1 sudo htpasswd-c/etc/subversion2/dav_svn.passwd username and press enter to enter the password twice. It is said that the-c parameter file will overwrite the original information, but after testing, it does not overwrite the original user information. Therefore, run the 12 sudo htpasswd-c/etc/subversion2/dav_svn.passwd user1sudo htpasswd-c/etc/subversion2/dav_svn.passwd logs file. There are still user1 and user2 users in the file. In addition, the/etc/subversion2/dav_svn.passwd file must be consistent with the file location defined in step 3. Then we can see that dav_svn.passwd contains fragments similar to 1 xiao: $ apr1 $ wq1l1SCM $ scheme, xiao is the user name, followed by the encrypted password 4. modify SVN access permissions edit/etc/apache2/dav_svn.authz if you want to open all permissions, you can directly 12 [/] * = rw indicates that users have read and write permissions 5. restart apache1sudo/etc/init. d/apache2 restart access http: // 127.0.0.1/svn/test/can view the results. Additional instructions: 1. SVN integration error: 12 Invalid command 'authzsvnaccessfile', perhaps misspelled or defined by a mo Dule not authorized ded in the server configurationAction 'configtest' failed. cause: No auth module is imported. Solution: Add 1 LoadModule authz_svn_module/usr/lib/apache2/modules/mod_authz_svn.so2 to 1/etc/apache2/mod-enabled/dav_svn.load. to access the repository list, you can modify/etc/apache2/mod-available/dav_svn.conf as follows: <Location/svn/> DAV svn SVNParentPath/home/svn SVNListParentPath On AuthType Basic AuthName "Subversion Repository" AuthUse RFile/etc/subversion/dav_svn.passwd AuthzSVNAccessFile/etc/subversion/dav_svn.authz Require valid-user </Location> note the above changes. % lt; Location/svn/> added the tail slash, SVNListParentPath On is newly added. After apache is restarted, access http: // 127.0.0.1/svn/(with a slash (/) at the end of the command. Expected result 3 is displayed. permission control Description: An Example of/etc/apache2/dav_svn.authz permission control [groups] # used to group users group1 = xiao, xegroup2 = user1, user2 [test:/] # repository name, [/] indicates all repositories @ group1 = rw # indicates that group1 users (xiao, xe) have read and write permissions on test @ group2 = r # indicates group2 users (user1, user2) only has the read permission on test, and has no write permission * = # indicates that all users do not have the permission, that is, they cannot read or write [test2: /] * = rw # indicates that all users have read and write permissions. 4. permission error: Can't open directory '/home/svn': Permission denied or 403 forbidden error, indicating apache (usually www-data account) you do not have the permission to document to the directory where svn is located. In this case, you need to check the permissions of/home/svn and its subfolders, for example, 1 sudo chown-R www-data/home/svn and then access http: // 127.0.0.1/svn/test/to view result 5. if Permission denied: make_sock: cocould not bind to address 0.0.0.0: 80 appears when you restart apache, add sudo

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.