Use Apache + Svn in Windows
Apache version: apache_2.0.59
SVN: svn-1.4.2
Step 1: Install SVN
Step 2: Apache
Step 3:
Build a library under E's SVN
Svnadmin create -- FS-type fsfs E:/SVN/tesyrepository
Step 4: import the file directory
Import the two directories under E/proj to the library.
SVN import E:/proj/file: // E:/SVN/tesyrepository/-- message "init"
View Library Content
SVN list -- verbose file: // E:/SVN/tesyrepository/
View latest revisions
Svnlook info file: // E:/SVN/tesyrepository/
Directory structure
Svnlook tree E:/SVN/tesyrepository/-- show-IDS
Step 5: create a virtual directory named SVN on Apache and put it at the end of httpd. conf.
<Location/SVN>
Dav SVN
Svnpath E: // SVN // tesyrepository // directory location
Authtype basic
Authname "Subversion repositories" // display the login name
Authuserfile passwd // The file generated by htpasswd when the password of all users is stored
Require valid-user
</Location>
<Location/SVN>
Dav SVN
Svnpath E:/SVN/tesyrepository
Authtype basic
Authname "Subversion repositories"
Authuserfile E:/SVN/tesyrepository/CONF/Password
Authzsvnaccessfile E:/SVN/tesyrepository/CONF/authz1 // the location where the group's permissions are placed
Require valid-user
</Location>
Htpasswd command under Apache Bin
Htpasswd-CB password user1 password1 // used to generate outdoor and password
Htpasswd-B password user2 password2 // Add a user
Step 6: modify part of httpd. conf (remove two "#") and add the following two lines
# Loadmodule dav_module modules/mod_dav.so remove the previous one #
# Loadmodule dav_fs_module modules/mod_dav_fs.so
Add these two lines. mod_dav_svn.so and mod_authz_svn.so can be found in the svn package directory and copied at the same time.
Libeay32.dll
Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so
At this point, you can view all the files in the directory through http: // ip/SVN/. The following describes the permissions.
The basic usage is as follows:
Subversion designs an abstract network layer. After the version library is created, it can be published through various servers. Svnserve is a small server that comes with subversion. It uses independent protocols and clients. We can use
Start as inetd or
Start a service as a daemon. After the server is started, the client can access it through the absolute path. The above example can be accessedSVN: // server IP/etc/SVN/Repos. You can also specify some options, such-RTo specify the root path of the version library. For example, assume that the version library is located in/etc/SVN/repos:
The client can access the server through the following URL:SVN: // server IP Address/ReposTo effectively avoid exposing local paths. For example-- Listen-Port,-- Listen-hostYou can specify the bound address and port,-RYou can set it to read-only. In Windows, you can set the version Library to the C partition, as shown in figureC:/svnroot/ReposYou can useSVN: // server IP/svnroot/repos accessIn other partitions, you must pass-RTo specify the root location.
The following is how to write a permission group file:
# Create two groups group1 group2, which will be separated by "," in the file specified by "authuserfile E:/SVN/tesyrepository/CONF/password.
[Groups]
Group1 = xiajing12345
Group2 = user1, user2, user3
# SVN indicates the root of all directories, which can be read by everyone.
[SVN:/]
* = R
# A projit directory under SVN can only be accessed by group1, but not by group2.
[SVN:/projit]
@ Group1 = RW
@ Group2 =
# The following describes a projedu directory under SVN, which can only be accessed by Group2 and cannot be accessed by group1.
[SVN:/projedu]
@ Group1 =
@ Group2 = RW