I have materials on the Internet, but there are always some problems, so I recorded them myself.
Some miscellaneous, but basically solved all the problems. For other information, see the reference page (see the structure of this article from page 1)
1. Download and install apache2. The installation file can be found on the official website.
Http:/www.apache.org
Download.
Tar xvzf httd-2.2.16.tar.gz
CD httpd-2.2.16
/Install APR and APR-UTIL
CD srclib/APR
./Buildconf
./Configure -- prefix =/opt/SVN/data/APR
Make & make install
CD ../APR-util
./Buildconf
./Configure -- prefix =/opt/SVN/data/APR -- With-Apr =/opt/SVN/data/APR
Make & make install
CD ../..
. /Configure -- enable-Dav -- prefix =/opt/SVN/data/apache2 -- With-Apr =/opt/SVN/data/APR -- With-Apr-util =/opt/ SVN/data/APR -- enable-so -- enable-Rewrite
Make & make install
Ii. Install Subversion
1. Compile and install the installation file on the official website
Http:/www.subversion.org.cn
Download.
Tar zvxf subversion-1.6.12.tar.gz
Tar zvxf subversion-deps-1.6.12.tar.gz
CD./subversion-1.6.12.
. /Configure -- prefix =/opt/SVN/data/Subversion -- With-Apr =/opt/SVN/data/APR -- With-Apr-util =/opt/SVN/data/ APR -- With-apxs =/opt/SVN/data/apache2/bin/apxs
Make & make install
After compilation, it is automatically added to apache2/CONF/httpd. conf.
Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so
2. Create a subversion Library
Mkdir-P/opt/SVN/data/SVN
/Opt/SVN/data/subversion/bin/svnadmin create/opt/SVN/data/SVN/myproject
Mkdir/opt/SVN/data/SVN/Access
Mkdir/opt/SVN/data/SVN/root1
Mkdir/opt/SVN/data/SVN/root2
3. Modify the setting file of the SVN version Library
VI/opt/SVN/data/SVN/myproject/CONF/svnserve. conf
Remove "#" in front of a [general] line, and there is no space symbol.
4. Create an authentication user and authentication group for Apache
/Opt/SVN/data/apache2/bin/htpasswd-CB/opt/SVN/data/SVN/access/http_auth_userfile admin Admin
/Opt/SVN/data/apache2/bin/htpasswd-B/opt/SVN/data/SVN/access/http_auth_userfile user01
/Opt/SVN/data/apache2/bin/htpasswd-B/opt/SVN/data/SVN/access/http_auth_userfile user02 user02
5. Edit the Subversion database permission Control File
$> VI/opt/SVN/data/SVN/access/svn_auth_groups
# Subversion database group permission Control
#
[Groups]
Myprojects = user01, admin, user02
[/]
Admin = RW
[Root1:/]
Usersgroup01 = RW
Usersgroup02 = r
[Root2:/]
Usersgroup01 = r
Usersgroup02 = RW
$> VI/opt/SVN/data/SVN/access/http_auth_groupfile
Sys-users: liuliu
Tech-users: You
6. Modify File Access Permissions
Chown-r nobody/opt/SVN/data/SVN
Chmod-r 777/opt/SVN/data/SVN
3. Add the following code to httpd. conf of apache2:
<Location/SVN>
Dav SVN
Svnparentpath/opt/SVN/data/SVN
# Our access control policy
Authzsvnaccessfile/opt/SVN/data/SVN/access/svn_auth_groups
# How to authenticate a user or group
Authtype basic
Authname "Subversion repository"
Authuserfile/opt/SVN/data/SVN/access/http_auth_userfile
Authgroupfile/opt/SVN/data/SVN/access/http_auth_groupfile
Require group usersgroup01 usersgroup02
</Location>
4. Start the Subversion server
/Opt/SVN/data/subversion/bin/svnserve-d-r/opt/SVN/data/SVN
5. Check whether the permission settings are correct:
You can enter the http:/IP/SVN/address/version library path in the address bar of your browser. A verification window is displayed.
6. Import the version library and obtain a copy of the version Library
SVN import/opt/SVN/data/SysAdmin/readme.txt http:/IP/SVN/myproject (-M "Initial import "? Note: I directly used tortoisesvn and Eclipse plug-ins for access)
Back up previous SVN Databases
# Svnadmin dump/data/SVN/repos/myproject/>/root/Tony. Tang
Recover the backup data to the local device.
# Svnadmin load/data/SVN/repos/myproject/
References:
Http://www.sudu.cn/info/html/edu/20060102/295979.html (lost and something wrong)
Http://blog.csdn.net/leishiwei/archive/2009/11/27/4888837.aspx (good but somehow complex)