subversion svn

subversion

Installation instructions for Subversion 1.0.3 server in Linux(in non-usual places)

Installation instructions for Subversion 1.0.3 server in Linux(in non-usual places)

The following programs are required to install Subversion server:
  • Autoconf 2.5 or newer
  • Libtool 1.4 or newer
  • Python 2.0
  • PkgConfig 0.15.0
  • OpenSSL 0.9.7d

These instructions will assume that all applications are installed in the $HOME/local directory and with the library path of $HOME/local/lib.
The $HOME/local/lib directory needs to be added to the LD_LIBRARY_PATH variable.

Installing Berkeley DB 4.2 (or newer)

  1. Go to http://www.sleepycat.com/download/db/index.shtml to download the latest version of Berkeley DB (db-4.X.X.tar.gz)
  2. Unpack it using the following command:
    tar zxvf db-4.X.X.tar.gz
    
  3. Download any new patches from the website and apply using the following:
    cd /path/to/db-4.X.X
    patch -p0 < patchfile
    
  4. Configure and compile using the following:
    cd /path/to/db-4.X.X/build_unix
    ../dist/configure --prefix=$HOME/local
    make
    make install
    

Installing Apache Server

  1. Go to http://httpd.apache.org/download.cgi to download the latest version of Apache server (httpd-X.X.X.tar.gz)
  2. Unpack it using the following command:
    tar zxvf httpd-X.X.X.tar.gz
    
  3. Build APR utilities using custom Berkeley DB path
    cd /path/to/httpd-2.X.X/srclib/apr
    ./configure --prefix=$HOME/local
    cd ../apr-util
    ./configure --prefix=$HOME/local --with-berkeley-db=$HOME/local --with-apr=../apr
    make
    make install
    
  4. Build Apache using the custom built APR utilities
    cd /path/to/httpd-2.X.X
    ./configure --prefix=$HOME/local --enable-dav --enable-http --enable-dav-fs --enable-so --enable-ssl --with-ssl=$HOME/local/lib --with-apr-util=$HOME/local
    make
    make install
    

Installing Neon

  1. Go to http://www.webdav.org/neon/ and download neon library 0.24.6 or better.
  2. Unpack it and rename the directory from "./neon-0.24.6/" to "./neon/".
  3. Configure and compile using the following:
    cd /path/to/neon
    ./configure --prefix=$HOME/local --with-ssl --with-lib=$HOME/local/openssl-0.9.7d
    make
    make install
    

Installing the Subversion Server

The following instructions describe the steps involved in setting up the subversion server with user authentication

Compiling Subversion

  1. Go to http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260 to download the latest source tar ball for Subversion (subversion-X.X.X.tar.gz
  2. Unpack it using the following command:
    tar zxvf subversion-X.X.X.tar.gz
    
  3. Configure and compile using the following:
    cd /path/to/subversion-X.X.X
    ./configure --prefix=$HOME/local --enable-maintainer-mode --with-ssl=$HOME/local/lib --enable-ssl --with-berkeley-db=$HOME/local --with-dbm=db42 --with-apxs=$HOME/local/bin/apxs
    make
    make install
    

Create a user's file using htpasswd (comes with Apache)

  1. Use the following command to enter a password for each user (-c to create the file)
    $HOME/local/htpasswd -cm /path/to/svn-auth-file username
    

Creating an Authorized SVN Access file

  1. The access file is used to determine which users have which access to which directories. The sections of the file is of the form [repos-name:path]. The following is an example file:
    #Gives harry read and write permissions to /branches/calc/bug-142 and all directories below
    #it in the calc repository
    #Gives sally read-only permissions
    [calc:/branches/calc/bug-142]
    harry = rw
    sally = r
    
    # give sally write access only to the 'testing' subdir
    [calc:/branches/calc/bug-142/testing]
    sally = rw
    	
    # Denies any permissions to harry
    [calc:/branches/calc/bug-142/secret]
    harry =
    	
    #Gives all users read access to all repositories
    [/]
    * = r
    	
    #Permissions can be given to entire groups by defining the members of groups
    [groups]
    calc-developers = harry, sally, joe
    paint-developers = frank, sally, jane
    everyone = harry, sally, joe, frank, sally, jane
    	
    [calc:/projects/calc]
    @calc-developers = rw
    
    [paint:/projects/paint]
    @paint-developers = rw
    jane = r
    

Configuring httpd.conf and ssl.conf

  1. Add the following lines to http.conf to instruct Apache to load the mod_dav_svn module. These lines must be added before any Subversion-related configuration items:
    LoadModule dav_svn_module     modules/mod_dav_svn.so
    
  2. Add the following lines to httpd.conf somewhere AFTER the LoadModule commands to tell Apache where you keep your Subversion repositories:
    # To access a repository type in the URL "SERVER/svn/REPOSITORYNAME"
    < Location /svn>
    DAV svn
    SVNParentPath /usr/local/svn
    	    
    # our access control policy
    AuthzSVNAccessFile /path/to/access/file
                
    # try anonymous access first, resort to real 
    # authentication if necessary.
    Require valid-user
                
    # how to authenticate a user
    AuthType Basic
    AuthName "Subversion repository"
    AuthUserFile /path/to/svn-auth-file
    </Location>
    
  3. Fix the ServerName, username, etc. as appropriate in both httpd.conf and ssl.conf
  4. Create an SSL certificate, get it signed, and add the following lines to httpd.conf to identify the location of server.key and server.crt:
    SSLCertificateFile /h/45/villegas/local/conf/ssl.crt/server.crt
    SSLCertificateKeyFile /h/45/villegas/local/conf/ssl.key/server.key
    

Starting Subversion server with SSL

  1. Start up Apache server with SSL option:
    $HOME/local/bin/apachectl -f $HOME/local/conf/httpd.conf -DSSL
    

Creating a Repository in Subversion

  1. To create a repository called "test_repos" (requires administrator privileges):
    svnadmin create /path/to/test_repos
    
  2. To import a tree of data called project into the repository:
    svn import /path/to/project https://domainname.com/svn/test_repos -m "Initial import"
    
  3. To checkout the files into a working directory called "project":
    svn checkout https://domainname.com/svn/test_repos/trunk project
    
The repository can now be viewed by pointing your web browser at https://domainname.com/repos/test_repos

$Id: subversion_linux.html,v 1.4 2004/06/22 15:51:40 wvillegas Exp $

posted on 2006-09-11 22:37 subversion 阅读(464) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。