Introduction to installing and deploying SVN server (Linux + subversion + Apache)

Source: Internet
Author: User
1. Install the APR dependency Library (Apache Portable Runtime module)

Http://apache.mirror.phpchina.com/apr/apr-1.2.11.tar.gz
./Configure
Make
Make install

Http://apache.mirror.phpchina.com/apr/apr-util-1.2.10.tar.gz
./Configure -- With-Apr =/home/chenmin/apr-1.2.11
Make
Make install

Ii. recompile httpd

Check whether the installed apache2 has mod_dav installed.

If Apache has been installed successfully, use httpd-m to check whether dav_module has been installed, if not, append the '-enable-dav'-enable-Dav-Fs' parameter to re-compile Apache. Otherwise, Apache cannot be started even if SVN is compiled.

Wget http://apache.mirror.phpchina.com/httpd/httpd-2.2.6.tar.gz
./Configure -- enable-Dav-FS
Make
Make install

Iii. Install Subversion

The latest version of subversion can be found here: http://subversion.tigris.org/project_packages.html
Http://subversion.tigris.org/downloads/subversion-1.4.5.tar.gz

Download the neon library to enable SVN to support WebDAV and HTTPS encrypted links.
After downloading it, place it in the Subversion installation directory and rename it. Subversion is automatically monitored and configured. Currently, only 0.25.5 is supported.

; CD subversion-SVN-LAST-VERSION-DIR
CD subversion-1.4.5
Wget http://www.webdav.org/neon/neon-0.25.5.tar.gz
Tar xzf neon-0.25.5.tar.gz
MV neon-0.25.5 neon

. /Configure -- With-apxs =/usr/local/apache2/bin/apxs -- With-Apr =/home/chenmin/apr-1.2.11 -- With-Apr-util =/home/chenmin/ apr-util-1.2.10 -- With-SSL

Because Berkeley dB is not installed, fsfs is used.
Make
Sudo make install

4. Configure subversion and Apache

Copy the svn module to the Apache Module Directory.
CP/data/subversion-1.4.5/subversion/mod_dav_svn/. libs/mod_dav_svn.so/usr/local/apache2/modules/
CP/data/subversion-1.4.5/subversion/mod_authz_svn/. libs/mod_authz_svn.so/usr/local/apache2/modules/

Edit httpd. conf
Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so

<Location/SVN>
Dav SVN
Svnparentpath/data/SVN
</Location>

Run htpasswd to add user and password
/Usr/local/apache2/bin/htpasswd-CM/data/SVN-auth-file chenmin
/Usr/local/apache2/bin/htpasswd-M/data/SVN-auth-file Admin

Edit httpd. conf again
<Location/SVN>
Dav SVN
Svnparentpath/data/SVN
Authtype basic
Authname "Subversion repository"
Authuserfile/data/SVN-auth-File
Require valid-user
Authzsvnaccessfile/data/SVN-access-File
</Location>

Svn-auth-file is the authentication file, the storage user name and password, and svn-access-file is the access permission file, which specifies the access permissions of visitors to each directory, the format of the file for permission assignment is as follows.
[Groups]
Admin = John, Kate
Devteam1 = John, Rachel, Sally
Devteam2 = Kate, Peter, Mark
Docs = Bob, Jane, Mike
Training = Zak
# Default access rule for all Repositories
# Everyone can read, admins can write, Dan German is excluded.
[/]
* = R
@ Admin = RW
Dangerman =
# Allow developers complete access to their project Repos
[Proj1:/]
@ Devteam1 = RW
[Proj2:/]
@ Devteam2 = RW
[Bigproj:/]
@ Devteam1 = RW
@ Devteam2 = RW
Trevor = RW
# Give the doc people write access to all the docs folders
[/Trunk/DOC]
@ Docs = RW
# Give trainees write access in the training repository only
[Trainingrepos:/]
@ Training = RW
In the permission configuration file, the key concepts are: Target and permission, that is, who is assigned what permissions. Read as R and write as W. If you do not have the permission, do not write anything.

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.