Set up the Subversion service in Linux

Source: Internet
Author: User
Tags svn client

I. Prepare the tool
Apache Web Server: httpd-2.2.4.tar.bz2
Subversion source package and dependency package: subversion-1.4.3.tar.bz2, subversion-deps-1.4.3.tar.bz2
(Assume that Apache and SVN source code are decompressed to/home/tmp)

Ii. install Apache
Apache installation is similar to normal installation of Apache. You must enable the Dav module and dynamic module options. The installation command is as follows:

Reference tar xfj httpd-2.2.4.tar.bz2
CD httpd-2.2.4
./Buildconf
./Configure -- enable-Dav -- enable-so
Make
Make install

 

3. Install Subversion

Note the following before installing SVN:

 

* The APR version on which SVN depends must be correct. If Apache is 2.0.x, the corresponding APR version should be 0.9.x; Apache is 2.2.x, and the corresponding APR version should be 1.2.x. Because the APR in the subversion-deps package is 0.9.x, You need to delete the APR and APR-util extracted from deps during SVN compilation. Instead, you can use the APR and APR-util provided in Apache 2.2.

* If Apache is not installed in the default path, the -- with-apxs option must be added to configure, for example,./configure -- With-apxs =/home/apache2/bin/apxs.

The installation command is as follows:

Reference tar xfj subversion-1.4.3.tar.bz2
Tar xfj subversion-deps-1.4.3.tar.bz2
# The subversion-deps file will be decompressed to the subversion-1.4.3 directory.
CD subversion-1.4.3
Rm-RF APR
Rm-RF Apr-util
Ln-S/home/tmp/httpd-2.2.4/srclib/APR
Ln-S/home/tmp/ httpd-2.2.4/srclib/APR-util Apr-util
./Configure & amp; Make & make install

After the installation is complete, check whether the file $ apache_home/modules/mod_dav_svn.so exists (default/usr/local/apache2/modules/mod_dav_svn.so ). In addition, if the old version of SVN is installed on the machine, delete the "/usr/local/lib/libsvn *" file.

4. Configure Svn in Apache

Create SVN Library:

Reference CD/home/SVN
Svnadmin create repo1

Add the following code to the Apache configuration file httpd. conf. In Apache, you can configure a virtual host svn.mydomain.net and configure the root path under the domain name to subversion. Use the authzsvnaccessfile and authuserfile commands to configure the svn user name and password files respectively.

Reference <virtualhost *: 80>
DocumentRoot/home/SVN/htdocs
<Directory>
Options shortdes
AllowOverride all
Order allow, deny
Allow from all
</Directory>

<Location>
Dav SVN
Svnparentpath/home/SVN/svnroot
Authzsvnaccessfile/home/SVN/svnroot/CONF/accessfile
Require valid-user
Authtype basic
Authname "Subversion System"
Authuserfile/home/SVN/svnroot/CONF/passwdfile
</Location>

Servername svn.mydomain.net
Directoryindex index.html
</Virtualhost>

Create a file/home/SVN/svnroot/CONF/accessfile:

Reference [groups]
User = Jarod
Anonymous = guest
[/]
* = R
@ User = RW
@ Anonymous = r

Use the htpasswd command to create the/home/SVN/svnroot/CONF/passwdfile file:

Reference htpasswd-C/home/SVN/svnroot/CONF/passwdfile Jarod
# Enter the password.

Finally, set the owner of the/home/SVN directory as the user who starts the apache service. APACHE-2.2 will be started by the daemon user by default:

Reference chown daemon. Daemon-r/home/SVN
Chmod 777/home/SVN-R

Test http://svn.mydomain.net/repo1 through a browser or SVN client.
The new SVN Library added under/home/SVN/svnroot will automatically use the same permission configuration.

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.