Windows Apache-based svn server configuration

Source: Internet
Author: User
Tags tortoisesvn

Referring to http://bbs.iusesvn.com/thread-158-1-1.html article, after the washing of SVN, finally put it successfully configured, now put the method I configured, recorded, for other needs of friends reference, need to improve the place, please advise!

An environment

Operating system: WINDOWS2003 server

Apache Version: 2.0.55

Subversion version: Setup-subversion-1.5.3.msi

TortoiseSVN version: Tortoisesvn-1.5.5.14361-win32-svn-1.5.4.msi

Two installation steps

1. Installing Apache

If you already have an Apache installer, you can double-click the installer to start the installation process. Make sure you enter the correct server URL (if your server does not have a DNS name, you can enter the IP address directly). I recommend that you install Apache as a for all Users,on Port 80,as a service. Note: If you already have an IIS or other program that uses port 80, the installation may fail. If so, you can find the file httpd.conf in the Apache Group "Apache2" conf directory under the program directory andchange the Listen 80 to a unused port, such as Listen 81. Then rerun the installer and this time there should be no more problems.
Test if Apache is installed successfully?
You can type Http://loccalhost in your browser, and if you present a website that is already configured, your Apache will be installed successfully.

2. Install Subversion and configure

A, double-click the Subversion Installer to complete the installation, after installation. We go to the Subversion file directory (the default installation location is: C:\Program files\subversion), and in the Bin folder of the directory, locate Httpd/mod_dav_svn.so, Mod_ Authz_svn.so and Libdb44.dll, copy them to the Apache modules directory (usually C:\Program Files\apache group\apache2\modules).

b, open the Apache configuration file httd.conf (typically C:\Program Files\apache group\apache2\conf\httd.conf) and modify the following:

#LoadModule Dav_fs_module modules/mod_dav_fs.so

#LoadModule Dav_module modules/mod_dav.so

Modified to:

LoadModule Dav_fs_module modules/mod_dav_fs.so

LoadModule Dav_module modules/mod_dav.so

In fact, it is to remove the two lines of comments.

Then add the following two lines at the end of the LoadModule section:

LoadModule Dav_svn_module modules/mod_dav_svn.so
LoadModule Authz_svn_module modules/mod_authz_svn.so

* Note: The code order of these two lines can not be wrong, so as not to cause unnecessary trouble.

C, and then configure it at the bottom of the file so that the client tortoisesvn and the browser know how to access:

<Location/svn> #意味着可以通过像这样的URL (HTTP://MYSERVER/SVN) to access the Subversion repository
DAV SVN # tell Apache which The module is responsible for the service like that url--here is the Subversion module
Svnparentpath C:\svn #告诉Subversion在目录C: \SVN under Search for repository
AuthType Basic #启用基本的验证, using username/password Authentication
AuthName "Test" # Test for Repository
AuthUserFile c:\svn\passwd #passwd问密码和用户文件, used to authenticate user's username and password
Authzsvnaccessfile C:\svn\svnaccessfile #权限控制文件 to restrict the access rights of individual users or groups to directories in the repository
Require Valid-user #限定用户只有输入正确的用户名及密码后才能访问这个路径
</Location>

D, below, we'll create the passwd file, you open the command line (DOS window), switch the current directory to the Apache2 directory (typically C:\Program Files\apache group\apache2), and then enter the following command to create the file:

Bin\htpasswd-c passwd <username>

For example: bin\htpasswd-c c:\svn\passwd admin
Command analysis:
C:\SVN\PASSWD indicates that a passwd file will be created in the: C:\SVN directory
Admin indicates user name

This command executes the HTPASSWD in the bin directory of the Apahce. exe to create a password file, after the creation is complete, restart the Apache service.

E, permission control file creation

To create a svnaccessfile file in the C:\SVN directory and open it for configuration, you can refer to the following example:

#组配置 Group = user name
[Groups]
@admin = Admin
@user = Test #test用户还需要按照上面d步骤来创建它和它的密码

# Specify default access rules for all libraries
# everyone can read
[/]
* = R

# Setting permissions for the test repository
#admin组拥有读写权限
#user组只有读取权限
[Test:/svn/test]
@admin = RW
@user = R

Windows Apache-based svn server configuration

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.