Centos simple installation and configuration of SVN Server

Source: Internet
Author: User
Tags svn client password protection ssl connection

Centos simple installation and configuration of SVN Server

The previous SVN repository was configured by the headers, and I used it directly. Basically, I used checkout, update, commit, and occasionally show log to retrieve previous versions, today, I will simply configure a SVN server. I have prepared to install it through Apache + SVN. My Linux version is centos 5.4, by default, the subversion program is not installed. Therefore, you must first install the subversion program. The RPM installation package is available on the system image disc.

# Rpm-IVH subversion-1.4.2-4.el5_3.1.i386.rpm or yum install Subversion

After installation, you can. Because Apache + SVN requires two modules to be installed,

VI/etc/httpd/CONF. d/subversion. conf

Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so

The first is used to manage SVN, and the second is permission control. These two modules are not installed by default when Apache is installed here, but the installation packages for these two modules are already in the CD.

# Rpm-IVH mod_dav_svn-1.4.2-4.el5_3.1.i386.rpm or yum install mod_dav_svn

After installing this RPM package, the two modules have been installed. We need to configure the dav_svn module. The directory of our web server is/var/www/html, therefore, we recommend that you create a repos directory under/var/www/as the main directory of SVN repository based on the configuration file.

# Mkdir/var/www/Repos

The following describes how to configure/etc/httpd/CONF. d/subversion. conf. Of course, different system directories are also different. Modify the location part as follows. Note that the comment part should not be removed. If it is removed, it will be accessed through SSL.
Then configure.

VI/etc/httpd/CONF. d/subversion. conf

<Location/repos>
Dav SVN
Svnparentpath/var/www/Repos

# Limit write permission to list of valid users.
# <Limitaskt get PROPFIND Options Report>
# Require SSL connection for password protection.
# Sslrequiressl

Authtype basic
Authname "Authorization realm"
Authuserfile/var/www/repos/passwd
Require valid-user
# </Limit10000t>
</Location>

The option definition is relatively simple. If you do not understand it, you can view the manual. In the above configuration, I set the passwd file under repos for the user authentication file, so we will create this file now.

# Cd/var/www/Repos
# Htpasswd-C passwd test // here-c Indicates creating a passwd file, and "test" indicates adding a user named "test ".
// After the file is created, no-C option is required for the next user Addition
At this time, the system will require a prompt for the password, enter the password. In this case, passwd stores the information of the test user. We need to modify the file and add permission control to it. Example:

VI passwd

Test: ID/c3q6mz

[Groups]
Admin = test, test1
Develop = Test2
[/]
Test = RW
Test1 = RW
@ Develop = r

Groups indicates the group name = user name, and [/] indicates the user permissions under the root directory of the Repository. Here, test and test1 have the read and write permissions, while @ develop indicates the permissions of the group members, here is the read permission. Because the management permission of the svn repository must be handed over to Apache, the owner of this folder is handed over to Apache.

# Chown-r Apache. Apache/var/www/Repos

If both the user and group in HTTP. conf are daemon users, you must change them to Apache. Then restart the Apache server.

# Service httpd restart

Now let's create our first warehouse,

# Cd/var/www/Repos
# Svnadmin create myrepos

At this time, the myrepos warehouse has been established. We can use http: // localhost/repos/myrepos to access it. We will prompt you to enter the user name and password, and use the test user we created, then we can perform various operations locally through the svn client. If you are prompted that you do not have the commit permission, remember to check whether the warehouse owner is an Apache user. OK. This configuration is now available, configure SSL access next time.

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.