Configuration and permission settings for apache2.2.9 + subversion1.5.5 (for apache2.2.x) in Windows

Source: Internet
Author: User
Tags tortoisesvn

1. Install apache2.2.9 (Http://httpd.apache.org/download.cgi)

Select:

  • Win32 binary without crypto (no mod_ssl) (MSI installer): apache_2.2.9-win32-x86-no_ssl-r2.msi [PGP] [MD5]

    Enter localhost in the first two items of network domain and server name during the installation process. The email below is free. If IIS is installed on the machine and started, stop the IIS service first. Otherwise, it will conflict with the Apache listening port.

    2. Download svn1.5 (if it is 1.4.6, there will be an EXE binary Installation File, while 1.5 currently only has the source version, which can be used after decompression)

  • (I installed version 1.5.5: http://subversion.tigris.org/files/documents/15/44589/svn-win32-1.5.5.zip)
    (First install the previous version: 1.4.6, and then copy 1.5.5 to overwrite the installed directory file)

    Copy the files mod_dav_svn.so and mod_authz_svn.so in the \ SVN installation path \ bin to the modules directory of Apache, copy % svn_home % \ bin \ libdb44.dll, libeay32.dll, and ssleay32.dll to % apache_home % \ bin

    Then, use a text editor such as NotePad to edit the Apache configuration file \ conf \ HTTD. conf and make the following changes:

    Remove the comments from the following line (delete the beginning ):

    #LoadModule dav_fs_module modules/mod_dav_fs.so
    #LoadModule dav_module modules/mod_dav.so

    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

    * After completing the preceding steps, the basic configuration of apache2.2.9 + svn1.5 is completed.
    Close the Apache server and restart the server. the status bar of the Apache console displays the Subversion information.
    For example: Apache/2.2.9 (win32) SVN/1.5 Dav/2
    This indicates that the subversion has been successfully integrated into Apache.

    3. Download and install tortoisesvn (http://tortoisesvn.tigris.org /)

  • (I installed version 1.5.7.15182)

    After the Wizard is installed, create the version library D: \ SVN version library \ repository, right-click-> tortoisesvn-> Create repository here... ", then you can select the version library mode. Here you can use the default mode, and then create a series of directories and files.

    4. Modify the Apache configuration file

    Add

    <Location/SVN>
    # The repository access path is specified here.
    Dav SVN
    # Specify the actual location of the repository on the hard disk
    Svnpath D:/SVN version Library/Repository
    # Basic approach
    Authtype basic
    # Title of the Authentication Window
    Authname "Subversion repository"
    # Authenticate the actual location of the user configuration file
    Authuserfile "D:/SVN version Library/passwords. Auth"
    # The actual location of the authentication permission configuration file
    Authzsvnaccessfile "D:/SVN version Library/access. Auth"
    # Set to require authentication
    Require valid-user
    </Location>

    Set Explanation
    <Location/SVN> The URL of the Subversion library is http: // myserver/SVN/
    Dav SVN Tell apache which module responds to the request of that URL-the Subversion module is used at the moment.
    Svnlistparentpath on For subversion1.3 or later, this indicates that all version Libraries under svnparentpath are displayed.
    Svnparentpath D: \ SVN Tell subversion that the version library to be viewed is under D: \ SVN
    Authtype basic Activate basic authentication, that is, the user name/Password
    Authname "Subversion repositories" Used to indicate when the authentication dialog box asking users to enter authentication information is displayed.
    Authuserfile passwd Authentication password file used
    Authzsvnaccessfile Path of the access control file of the Subversion Database
    Require valid-user Specify that only users with the correct user/password can access the URL


    * Next we will create two files required for authentication: User Files and permission files to create a file passwords under the D: \ SVN version library. auth and access. auth (you can use NotePad to create and modify the file name)

    * Configure passwords. auth in the authentication user file. The content is as follows:

    Tom: Tom
    Cat: Cat
    Hello: World

    The password is not encrypted here. If you set the password encryption, you can use the htpasswd.exe program in the bindirectory of the apacheinstallation directory to generate the password as follows:

    My Apache installation path is:
    D: \ Program Files \ Apache Software Foundation \ apache2.2 \
    Open the command window and enter D: \ Program Files \ Apache Software Foundation \ apache2.2 \ bin,
    Use the following command in the command line: htpasswd-c d: \ svnroot \ passwords. Auth Tom
    After you press enter, you will be prompted to enter the password, enter Tom, and then press Enter. Then you will be prompted to enter the confirmation password, and enter Tom again.
    The-C parameter in the command line indicates that a file is created. It is created after the first operation and then added to another user.
    Do not use this parameter any more, for example, I will add cat and hello users.
    Htpasswd D: \ svnroot \ passwords. Auth cat
    Htpasswd D: \ svnroot \ passwords. Auth hello
    In this way, the user password uses MD5 Encryption by default. After opening the file, you may see the following format:
    Tom: 7z/80al6 $ wtqvrbgshc/bxi6yykuga1 $ apr1 $
    Cat: knrg459t $ export az7mpgpfcdd2xp25stst1 $ apr1 $

    Now we have added three users Tom, cat, and hello. Their passwords are Tom, cat, and world.

    * Configure the authentication permission file access. auth
    Directly create the access. auth file under D: \ svnroot and enter the following content:

    [Groups]
    Dev1 = Tom, cat # developer Group 1
    Dev2 = hello # developer Group 2

    [/]
    * = R # Set all users to have the read permission on the root directory, that is, browsing permission.

    [/AAA]
    @ Dev1 = RW # Set members of dev1 to have read and write permissions on the AAA directory.
    @ Dev2 = # Set members of dev2 to have no permissions on the AAA directory.

    [/BBB]
    @ Dev1 = # Set members of dev1 to have no permissions on the BBB directory.
    @ Dev2 = RW # Set members of dev2 to have read and write permissions on the BBB directory.

    [/CCC]
    @ Dev1 = # Set members of dev1 to have no permission on the CCC directory.
    @ Dev2 = # Set members of dev2 to have no permission on the CCC directory.

    So far, we have defined permissions for different user groups. You can use different users.
    Test Browse/import/Checkout

    The access path is http: // localhost/SVN.

    * Configure user permissions for multiple repositories
    * Create a warehouse svn2 first
    * In the D: \ svnroot directory, Run D: \ svnroot \ mkdir svn2 to create the subdirectory svn2.
    * Run svnserve create d: \ svnroot \ svn2 to create the svn2 repository.

    Modify the httpd. conf file in the conf directory under the Apache installation directory, and move the cursor to the end of the file.
    The added code is modified as follows:

    <Location/SVN>
    Dav SVN
    # Modify svnpath to svnparentpath. The current directory is the parent directory.
    # Store svn1 and svn2 in this parent directory
    Svnparentpath D:/svnroot
    Authtype basic
    Authname "Subversion repository"
    Authuserfile "D:/svnroot/passwords. Auth"
    Authzsvnaccessfile "D:/svnroot/access. Auth"
    Require valid-user
    </Location>

    * You do not need to modify passwords. Auth to authenticate the user file.
    * Modify access. auth in the authentication permission file as follows:
    [Groups]
    Dev1 = Tom, cat # developer Group 1
    Dev2 = hello # developer Group 2

    [Svn1:/]
    * = R

    [Svn1:/AAA]
    @ Dev1 = RW # Set the members of dev1 to have read and write permissions on the AAA directory in the svn1 repository.
    @ Dev2 = # Set members of dev2 to have no permissions on the AAA directory in the svn1 repository.

    [Svn1:/BBB]
    @ Dev1 = # Set members of dev1 to have no permissions on the BBB directory in the svn1 repository.
    @ Dev2 = RW # Set the members of dev2 to have read and write permissions on the BBB directory in the svn1 repository.

    [Svn1:/CCC]
    @ Dev1 = # Set members of dev1 to have no permission for the CCC directory in the svn1 repository.
    @ Dev2 = # Set members of dev2 to have no permission for the CCC directory in the svn1 repository.

    [Svn2:/]
    @ Dev1 = # Set members of dev1 to have no permissions on the svn2 repository.
    @ Dev2 = # Set members of dev2 to have no permissions on the svn2 repository.

    By now, we have defined permissions for different user groups for different repositories. You can use different users.
    Test Browse/import/Checkout

    Repository 1 access path: http: // localhost/SVN/svn1
    Repository 2 access path: http: // localhost/SVN/svn2

    No user has any access permission to the parent directory http: // localhost/SVN/

    5. Summary

    After the introduction of the above sections, we initially implemented the configuration and permission settings for apache2.2.9 + subversion1.5.5 (for apache2.2.x) in windows, and based on the different situations of a single warehouse and multiple warehouse, the Analysis and configuration can basically meet the needs of daily development. In actual development, you can configure according to the permissions of the actual personnel and project.

  • After my own configuration experiment, the configuration is successful. You can use tortoisesvn to manage the version.

    Related Article

    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.