Build SVN server under Ubuntu (Mint)

Source: Internet
Author: User
Tags 403 forbidden error
Create an SVN server in Ubuntu (Mint. install Subversion1www. 2cto. comsudoapt-getinstallsubversion2. create a repository. assume that the parent directory of our repository is/home/svn12cd/home/svnsudosvnadmincreate/home/svn/test... 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. install apache If apache is not installed, you need to first install apache and libapache2-svn 1 sudo apt-get install apache libapache2-svn2. integrate SVN to modify/etc/apache2/mod-available/dav_svn.conf DAV svn SVNParentPath/home/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile/etc/subversion/dav_svn.passwd AuthzSVNAccessFile/etc/subversion/dav_svn.authz Require valid-user Note: 1. SVNParentPath indicates the parent directory of all databases. Only one directory can be enabled for SVNParentPath and SVNPath. 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/ You can view the results. Additional Instructions: 1. SVN integration error: 12 Invalid command 'authzsvnaccessfile', perhaps misspelled or defined by a module not supported 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: DAV svn SVNParentPath/home/svn SVNListParentPath On AuthType Basic AuthName "Subversion Repository" AuthUserFile/etc/subversion/login AuthzSVNAccessFile/etc/subversion/dav_svn.authz Require valid-userNote the preceding changes. % lt; Location/svn/> adds the tail slash, and 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
Related Article

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.