Configure Apache2 + SVN _ installation configuration on CentOS

Source: Internet
Author: User
Due to server management, I have been putting SVN on my PC (7 × 24 has been running for several months). These days I have finally configured a dedicated SVN server. The operating system of the server is a 64-bit CentOS. Here we record the SVN configuration process on CentOS. The following operations are performed with the root permission. I. install Apache and SVN. Before installation, check that SVN has been put on my PC (7 × 24 has been running for several months) for server management reasons ), the dedicated SVN server has been configured in the last few days.

The operating system of the server is a 64-bit CentOS. Here we record the SVN configuration process on CentOS. The following operations are performed with the root permission.

1. install Apache and SVN

Before installation, check whether the software has been installed in the operating system.CommandInstallation:

>Yum installHttpd

When running this command, the files to be installed and the dependent packages are listed. Enter y and press Enter.

> Yum install mod_dav_svnSuBversion

If you have installed the tool, a prompt is displayed.

Ii. Configure Apache

First, run the service command to start apache,

> Service apache start

Sometimes the system prompts that the service command cannot be found. You can use/sbin/service to replace the service.

Then, configure the httpd service that can be started with the system,

>SetUp

Here is a system configuration interface:

 

Select System services from the list.IdBefore the c.com auto-Restart service is[*]. Find httpd from the list, select it, and click OK to save it.

Iii. Configure SVN

After configuring Apache, you must combine them. Follow these steps:

1. Create a repository directory:

>Cd/Var/www

If there is no svn directory, create

>MkdirSvn

Use svnadmin to create a code library:

> Svnadmin create repos

Modify apache's access to repos

>ChownApache. apache-R repos

2. Modify the subversion. conf configuration file.

> Cd/etc/httpd/conf. d

> Vim subversion. conf

Details of subversion. conf:

  1. # Skip annotations
  2. LoadMoDuLe dav_svn_module modules/mod_dav_svn.so
  3. LoadModule authz_svn_module modules/mod_authz_svn.so
  4. #
  5. # Skip annotations
  6. <LoCatIon/Svn/repos>
  7. DAV svn
  8. SVNPath/var/www/svn/repos
  9. Location>

Restart the httpd service

> Service httpd restart

The content of this configuration is the most basic and no authentication method is specified, so it can be accessed anonymously. The path used for access is http: // host: port/svn/repos.

4. Complete SVN configuration and add user control

In actual use, we do not want the code library to be accessed anonymously, so we need to increase user access control.

1. Add a user

> HtPasswd-Cm/etc/svn-auth-FileTester

The system prompts you to enter the password twice, and then prompts you to add the User Password successfully.

2. Modify subversion. conf to add Access Control

> Vim subversion. conf

Location after modification:

  1. <Location/Svn/repos>
  2. DAV svn
  3. SVNPath/var/www/svn/repos
  4. AuthType Basic
  5. AuthName "Subversion repository"
  6. Require valid-user
  7. Location>

Restart httpd and then access http: // host: port/svn/repos. A prompt is displayed, indicating the user name and password.

5. More information

1. In the above configuration, a code repository is specified through SVNPath. However, in practical applications, there are often multiple repositories that store different project codes. In this case, you can change SVNPath:

SVNParentPath/var/www/svn

2. When you use htpasswd to add a user, when the authentication file svn-auth-file does not exist, use:

Htpasswd-cm/etc/svn-auth-file tester01

Creates a file and adds the tester01 user. After that, users will be added to use:

Htpasswd/etc/svn-auth-file tester02

3. After the new code library is added, you must modify the folder permission. Otherwise, the client will get the PeRmIssion DeniEd.

4. Restart the httpd service every time you modify the configuration file.

[Content navigation]
Page 1: Installation Configuration Page 2nd: precisely control Directory Access

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.