Consolidates Apache and SVN, allowing clients to browse the repository using a browser

Source: Internet
Author: User

Prior to migrating SVN, because of the time problem, no Apache integration, can only use SVN to access and not like before can be accessed with HTTP, colleagues reacted a bit unaccustomed.

So after the data is migrated, get started with the integration of Apache and SVN. Also a simple record:


1. Install Apache and SVN modules

#yum –y Install httpd mod_dav_svn

#httpd –version View the Apache version number under installation

#ls/etc/httpd/modules/| grep SVN to see if Apache has loaded into the SVN module
Mod_authz_svn.so
Mod_dav_svn.so

#vim /etc/httpd/conf/httpd.conf? If not loaded, go to httpd.conf to add it yourself

LoadModule dav_svn_module???? Modules/mod_dav_svn.so
LoadModule authz_svn_module?? Modules/mod_authz_svn.so

2. Configure Apache:

#chown Apache.apache/opt/svn/repos–r??? Allow Apache to access svn

[Email protected]/]# CD/OPT/SVN
[[email protected] svn]# ls
passwd? Repos? Restartsvnserve.sh? Svn-authz.conf? Svnserve.conf? Svn-user.conf
key-generation.sh Users
[email protected] ~]# cat key-generation.sh
#!/bin/sh
#密码批量生成
#2018-5-30
#根据svn原有的明文密码记录文件userlist. txt to htpasswd generate an encrypted password


For i in ' cat userlist.txt ';
Do
???? echo "$i" > users;
???? user=$ (awk-f ' = ' {print $} ' users)
???? userpass=$ (awk-f ' = ' {print $} ' users)
???? Htpasswd-b passwd $user $userpass
Done

[Email protected] ~]#

[Email protected] svn]# cat/etc/httpd/conf.d/subversion.conf? SVN and Apache integrated configuration

LoadModule dav_svn_module???? Modules/mod_dav_svn.so
LoadModule authz_svn_module?? Modules/mod_authz_svn.so

<Location/svn>
??? DAV SVN
??? svnparentpath/opt/svn/repos/???? SVN repository Directory
?????? AuthType Basic
?????? AuthName "Authorization svn"
Authzsvnaccessfile/opt/svn/svn-authz.conf?? SVN permissions File
?????? AUTHUSERFILE/OPT/SVN/PASSWD???????? SVN user password (encrypted for Apache, different from SVN's own plaintext file svn-user.conf)
?????? Require Valid-user
</Location>
[Email protected] svn]#/etc/init.d/httpd restart?? Restart Apache

3. Testing

Access test via browser: http://ip:85/svn/library name? (This sets Apache's listening port to 85)


Complete the integration!

Ps:? The password on the passwd can be different from the password on the svn-user.conf.

passwd HTTP Access Service svn-user.conf for SVN access Service

Consolidates Apache and SVN, allowing clients to browse the repository using a browser

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.