Configure and manage SVN + Apache in Windows

Source: Internet
Author: User
Tags password protection tortoisesvn

For version control, I have always been optimistic about SVN, which has more advanced features than CVs, and it is very convenient to make it accessible on the Wide Area Network through configuration. At the same time, you can use tortoisesvn to manage the client well, and use Apache to manage various tasks well. The following describes the configuration process:

1. Preparation: svn-win32-1.6.0.zip (binary, apache2.2); apache_2.2.11-win32-x86-no_ssl.msi; TortoiseSVN-1.6.0.15855-win32-svn-1.6.0.msi

These software can be found on the network, search for images and download images. svn-win32-1.6.0.zip can be directly decompressed to a directory (for example, D:/program files/SVN). Apache is installed by default, and tortoisesvn is installed by default.

2. Configuration

2.1 SVN configuration: add the bin directory address (D:/program files/SVN/bin) of SVN and directory to the system variable path.

2.2 create a resource library (two types ):

2.2.1 single resource library. This method is used if you plan to create only one resource library. Open a command prompt and enter cvsadmin
Create E:/resources/SVN/repositories/AAA, and press Enter. E:/resources/SVN
/Repositories/AAA is your resource library path.

2.2.2 multi-resource library. If you want to create multiple resource libraries, use this method. Open a command prompt and enter cvsadmin
Create E:/resources/SVN/repositories/AAA, press ENTER; enter cvsadmin
Create E:/resources/SVN/repositories/BBB, press enter...

2.3 Apache configuration:

Ensure that Apache runs properly. Copy the mod_dav_svn.so and mod_authz_svn.so files under the bin directory of the svn root directory to the modules directory under the Apache root directory. Open the Apache configuration file httpd. conf and find

 

# Loadmodule dav_fs_module modules/mod_dav_fs.so

# Loadmodule dav_module modules/mod_dav.so

Remove the previous # and add two rows:

 

Loadmodule dav_svn_module modules/mod_dav_svn.so

Loadmodule authz_svn_module modules/mod_authz_svn.so

Add at the end:


For a single resource library:


<Location/SVN>


Dav SVN


Svnpath E:/resources/SVN/Repositories


Authtype basic


Authname "Subversion reporsitory"


Authuserfile E:/resources/SVN/CONF/passwd


Authzsvnaccessfile E:/resources/SVN/CONF/authz


Require valid-user


</Location>


Multi-resource library:


<Location/SVN>


Dav SVN


Svnlistparentpath on


Svnparentpath E:/resources/SVN/Repositories


Authtype basic


Authname "Subversion reporsitory"


Authuserfile E:/resources/SVN/CONF/passwd


Authzsvnaccessfile E:/resources/SVN/CONF/authz


Require valid-user


</Location>


Where: <location
/SVN> refers to the instance path of the svn service. You must use the formula http://xxx.xxx.xxx.xx/svn/to renew e:/resources.
/SVN/repositories is the main directory of the resource library; E:/resources/SVN/conf is the directory for storing user files and permission files; E:
/Resources/SVN/CONF/passwd Save the user information file, which is a file without any extension. Use htpasswd.exe of apachefor dimension.
Password protection: encrypts the user's password into a dark text using MD5; E:/resources/SVN/CONF/authz is the file storing access permissions, and it is also a text without a suffix
Files can be edited directly using text tools; authtype basic is the authentication type, which adopts the basic type, that is, the user name + password; authname
"Subversion reporsitory" refers to the expression in the authentication era, which plays a prompting role; Require
Valid-user indicates that SVN can be accessed only by providing the user and password.


Restart Apache and check whether the status bar of APACHE service monitor contains "SVN/1.6.0 Dav/2. In the browser, enter http: // *******/SVN/(******* for your host domain name address or IP address) to verify the configuration.

3. Management

3.1 User Management: add the bin directory path of the Apache installation directory to the path of the system environment variable, open the command prompt, and locate E:/resources/SVN/CONF/


Create user: Enter htpasswd-C passwd Sean and press Enter. The system will prompt you to enter the password. after entering the password twice, the user will be added successfully. If in E: if the passwd file already exists in/resources/SVN/CONF/, remove the-C parameter.


Delete user: Enter htpasswd-D passwd Sean and press Enter.

3.2 permission management: You can copy the passwd file under E:/resources/SVN/CONF/, paste it, and rename it to authz (or copy the authz file from the conf directory of the resource library to E: /resources/SVN/CONF/), which is maintained in the file:

 


[Groups]


Everyone = admin, Sean, Jack


Aaaer = Sean


Bbber = Jack


Manager = Admin

 


[AAA:/]


@ Everyone = r


@ Aaaer = RW


@ Manager = RW

 


[BBB:/]


@ Everyone = r


@ Bbber = RW


@ Manager = RW

 


[Groups] indicates the Group Definition: "group name = user 1, user 2... "; [AAA:/] indicates the AAA resource library, and @ everyone = r indicates that all users in the Everyone group have read permission. There are four types of permissions: R, W, RW, and null. You can configure the permissions according to the actual situation.

4. tortoisesvn usage: select a directory on another machine (for example, F:/SVN/AAA, remember to make sure it is an empty directory), right-click the directory, and select "SVN
"Checkout", fill in the resource library URL (such as http: // myremotehost/SVN/AAA), and click "OK". You will be prompted to enter the user password.
The rest is the normal use of SVN, which should not be clear.

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.