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