Version:
Debain: 5.0
Kernel: BRL. 26-1-686
Subversion: 1.5.6
Apache: 2.2.11 Server:
1. Install apt-Get install subversion-Tools
Apt-Get install apache2 libapache2-svn 2. Project mkdir/opt/linuxany-P
Svnadmin create/opt/linuxany/test1
Svnadmin create/opt/linuxany/test23, Configuration
1) vi/etc/apache2/httpd. conf # note that the following two lines may have been configured in apache2. If an error is found during restart, just comment out.
Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so
# The root directory after SVN is connected to the server, that is,/is equivalent to/opt/linuxany (for example, SVN list http: // ip/test1). If it is/SVN, /SVN is equivalent to/opt/linuxany (for example, SVN list http: // ip/SVN/test1)
[Location/]
Dav SVN
Svnparentpath/opt/linuxany # [project root directory]
Authzsvnaccessfile/opt/linuxany/authz. conf # [user permission configuration file]
Authtype basic
Authname "subversion. zoneyump"
Authuserfile/opt/linuxany/AuthFile # [user password configuration file]
Require valid-user
[/Location] 2) vi/opt/linuxany/authz. conf [test1:/] #[/opt/linuxany/test1 all files and directories]
* = [All users have no permissions]
Lb = RW [read and write permissions for LB users]
[Test2:/]
* = R # [All users only have read permission]
Lb = rw3) generate the AuthFile file and add the user htpasswd-C/opt/linuxany/AuthFile LB # [-C: Generate The AuthFile file]
Htpasswd/opt/linuxany/AuthFile username # [Add User] 4) add permission chmod 777/opt/linuxany-R4, start service/etc/init. d/apache2 start
Svnserve-D5, import data SVN import sourcedir file: // opt/linuxany/test1/targetdir-M "Import Info" 6, connection
Enter "http: // ip/test1" in the browser to view the targetdir directory.
[Or]
Enter "SVN list http: // ip/test1" on the terminal:
There are two methods to operate SVN server data: local and remote.
1. Local
1) copy the file to the Local CD/root/svndir
SVN checkout http: // ip/test12) Add the new file CP-A/root/datadir/root/svndir/test1
CD/root/svndir/test1
SVN add datadir
SVN commit-M "add info" # [Submit the changed file to the version library] 3) display SVN list datadir4) restore SVN Update-R 200 datadir # [restore the datadir directory to version 200] 5) delete SVN Delete datadir-M "del Info" 6) view the change history SVN log datadir7) view File details SVN info datadir2, remote
1) display SVN list http: // ip/test12) import data SVN import/root/datadir http: // ip/test1/datadir-M "Import Info" 3) delete SVN del http: // ip/test1/datadir-M "del Info" 4) view the svn log http: // ip/test1