CentOSSVN installation and configuration

Source: Internet
Author: User
Tags password protection ssl connection collabnet
Environment: Ubuntu10.10Virtualbox4.02CentOS5.5 has installed SVN on UbuntuServer before. I tried to install it on CentOS this time, isn't CentOS the most stable version of the server? I didn't install any servers when I installed the Virtual Machine. All services started from scratch. Step 1: Install apachesubversionyuminstal

Environment: Ubuntu10.10 Virtualbox4.02 CentOS5.5
I have installed SVN on Ubuntu Server before. I tried to install it on CentOS this time. Doesn't it mean that CentOS is the most stable version on the Server?
No servers have been installed before, and all services start from scratch.
Step 1: install apacheSuBversion
Yum installHttpd
Yum install httpd-devel // used to develop the Apache module
Yum install subversion
Yum install mod_dav_svn // interface between Subversion and Apache (through this interface, Apache can access the version library and allow clients to access it using the HTTP extension protocol WebDAV/DeltaV)
Yum install mod_auth_mysql // This item is used for user authentication. On the Internet, there is information saying that only user settings are required for mod_auth_mysql. We recommend that you do not install this item and use htPasswdI didn't install it here. I still plan to use htpasswd. I may try it next time.
Verify that the svn module (mod_dav_svn) is correctly installed
Ls/Etc/httpd/moDuLes |GrepSvn
System prompt:
Mod_authz_svn.so
Mod_dav_svn.so
Verify installation:
Svn -- version
The following shows that the installation is correct.
========================================================== ===
Svn, version 1.4.2 (r22196)
Compiled on Aug 10 2009,18: 00: 04

Copyright (C) 2000-2006 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product INcLudes software developEdBy CollabNet (http://www.Collab.Net /).

You can use the following archive access (RA) module:

* Ra_dav: the module that accesses the archives through the WebDAV (DeltaV) protocol.
-Handles 'HTTP 'scheme
-Handles 'https' scheme
* Ra_svn: the module that uses the svn network protocol to access the repository.
-Handles 'svn 'scheme
* Ra_local: The file library module that accesses the local disk.
-Handles'File'Scheme
========================================================== ====
Step 2: Create the SVN library and Project
Mkdir/Home/svn // create the SVN Library
Svnadmin create/home/svn/projcet // create a project
Step 3: Add group and member Permissions
GroupaDdSubversion // create a group named subversion as the directory that owns the Repository
UseRmOd-G subversion-a apache // Add yourself and Apache users to the group members
View:More/Etc/group | grep subversion
System prompt:Subversion: x: 500: apache
Step 4: Modify project Permissions

Chgrp-R subversion/home/svn/project
Chmod-R 777/home/svn/project

It is best to configure the corresponding permissions according to your own security requirements. I am a test environment, so I gave 777

Step 5: Configure httpd
Edit httpd. conf
Vim/etc/httpd/conf/httpd. conf
Check whether the LoadModule dav_svn_module modules/mod_dav_svn.so line exists. If not, add it to Apache to allow the client to access the SVN repository through Apache. Apache needs to load the mod_dav_svn module. If Apache is installed in accordance with the preset directory, the mod_dav_svn module should be installed in the modules subdirectory of the Apache installation location (the default path is/etc/httpd. At the same time, in the Apache configuration file httpd. conf (default path: etc/httpd/conf/) has loaded this module using the LoadModule command (if not, manually add) note that this command must appear before other Subversion commands. Also load the mod_authz_svn.so Module
For example:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Generally, apache2 has loaded these two modules normally.
Start httpd
/Etc/init. d/httpd start
Open the browser to check whether the apache page is displayed. (Note that if the firewall is enabled, open port 80)
Step 6: Configure SVN
Edit subversion. conf
Vim/etc/httpd/conf. d/subversion. conf
Change the Code as follows (Li Hong is the modified Code ):
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

CatIon/svn>
DAV svn
SVNParentPath/home/svn
#
# Limit WritePermission to list of val IdUsers.
#
# Require SSL connection for password protection.
# SSLRequireSSL
#
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile/home/svn/passwd
Require valid-user
#

Step 7: create a user
# Htpasswd-c/home/svn/passwd test // Add the user to use the "-c" parameter for the first time and then add it again.
System prompt:
New password: // enter the New password
Re-type new password: // confirm the password
Adding password for user test
Restart apache
Access through the web page. The user logon verification is displayed. The access is successful (note that port 3690 of the firewall is enabled)

========== Problems During the test====================
An error occurs when you restart apach after httpd. con is configured.
/Etc/init. d/httpd restart
System prompt:
Start httpd:
[Mon Jan 31 18:45:03 2011] [warn] module dav_svn_module is already loaded, skip Ping
[Mon Jan 31 18:45:03 2011] [warn] module authz_svn_module is already loaded, skipping
[Mon Jan 31 18:45:03 2011] [warn] module dav_svn_module is already loaded, skipping
[Mon Jan 31 18:45:03 2011] [warn] module authz_svn_module is already loaded, skipping
NowIt seems that it is not correct. The prompt is that the module has been loaded and has already been repeated. Check it carefully in/etc/httpd/conf. d/subversion. con does include the dav_svn_module and authz_svn_module modules. I already added the deletion ......, But I did not see the statements loaded by the two modules in httpd. conf, but the prompt is that they have been loaded.You have to delete it, restart it, and go back to the directory to view it. In the etc/httpd/conf. d/module/does exist in these two modules, but httpd. in conf, I did not see the loaded statement. Where did I load it? 2011-02-21

Enter http: // 192.168.0.5/svn/projcet on the web:
The requested URL/svn/project was not found on this server.
The service cannot be found, but the apache page can be opened. It should be in the/etc/httpd/conf. d/subversion. conf setting error. I checked it again and found that the error is" "In this sentence, we should not refer to the project, but to the file warehouse. It should be" "

Open the web Input http: // 192.168.0.5/svn/projcet and the verification window is displayed. The prompt is not displayed after the input:
Forbidden
You don't have permission to access/svn/project on this server.
It should be the user's permission to access the file warehouse, or solve the permission problem.
The main reason is: The/home/svn/project directory does not have permissions for svn users (such as svnroot). It may be because svnadmin create runs as root, mod_dav_svn has no permissions.
Svn permission modified:
Chown-R test/home/svn/project
Chgrp-R subversion/home/svn/project
Chmod-R 777/home/svn/project
Open the web, enter the web site, and directly enter the project directory, very depressed, directly go to, verify where to go?
Restart httpd and enter again. The verification window is displayed and entered correctly.

Open the web browser, enter the user name and password, but always require verification. After three times, the prompt is displayed:
This server cocould not verify that you are authorized to access the document requested. either you supplied the wrong credentials (e.g ., bad password), or your browser doesn't understand how to supply the credentials required.
Permission? Wrong Password? It cannot be a Password error. Try again. After you create a new user and try again, the result will be the same. It must be a permission problem. Today, I am tired of coming to an end.

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.