Home » Linux OS and Software » How-To » install svn on Centos 5
Mon, 08 February 2010 17:34
Registered: February 2010
Messages: 1
I recently installed subversion on a Villiage VPS running Centos 5 default. It's running well and does not seem to have any problems with the small memory footprint. After 5 days, privvmpages.maxheld is only 27608 4k blocks (<108 MB) so it doesn't seem to be bumping into the 128MB maximum. Below are the steps I used to install svn. I would appreciate noting any error corrections that need to be made and then if staff would turn it into a template.

The following steps will set up subversion on Centos 5 accessed through apache using https protocol and create an empty repository named “rep01” at the location /usr/local/svn.

1. As root, install yum. Note: yum is already installed on Centos 5 by default.
2. As root, install subversion
yum install subversion
yum install mod_dav_svn
yum install mod_ssl

3. As root, create a place for repositories
mkdir /usr/local/svn
chown apache:apache /usr/local/svn

4. As root, create a new repository
svnadmin create /usr/local/svn/rep01
chown –R apache:apache /usr/local/svn/rep01

5. As root, create the authorization files
htpasswd –cm /usr/local/svn/svn-passwd <username>
echo “#authorization file” > /usr/local/svn/svn-authz

6. You will need to edit svn-authz as needed (format is explained in svn documentation) and add more passwords to svn-passwd by using the following command and entering the new password twice.
htpasswd –m /usr/local/svn/svn-passwd <username>

7. Update self-signed SSL certificate. For CentOS 5, the default SSL key file is /etc/pki/tls/private/localhost.key and the default certificate is /etc/pki/tls/certs/localhost.crt. The following command will create a new certificate file /etc/pki/tls/certs newcert.crt having a 999 day lifetime with your actual “Distinguished Name” (DN). This is explained somewhat at: http://nixcraft.com/getting-started-tutorials/1431-linux-cre ate-self-signed-ssl-certificate-apache-httpd-server.html

openssl req -new -key /etc/pki/tls/private/localhost.key -x509 -days 999 -out /etc/pki/tls/certs/newcert.crt

then you will be asked to enter some information that defines your DN. Answer the questions as appropriate:

Country Name (2 letter code) [GB]:<my_country (two UC letters)>
State or Province Name (full name) [Berkshire]:<my_state>
Locality Name (eg, city) [Newbury]:<my_city>
Organization Name (eg, company) [My Company Ltd]:<my_company>
Organizational Unit Name (eg, section) []:<my_department>
Common Name (eg, your name or your server's hostname) []:<my_ip_address>
Email Address []:<my_email@host.com>

You should see the new certificate file /etc/pki/tls/certs newcert.crt.

8. Edit apache configuration file “httpd.conf”. For CentOS 5, this file is located in directory /etc/httpd/conf.

After the line
LoadModule dav_module modules/mod_dav.so
add the lines:
#begin custom LoadModue lines added for subversion access
#httpd sometimes complains that modules are already loaded
# even if they are not listed in httpd.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule ssl_module modules/mod_ssl.so
#end custom adds

After the WebDAV module configuration section
# WebDAV module configuration section.
<IfModule mod_dav_fs.c>
# Location of the WebDAV lock database.
DAVLockDB /var/lib/dav/lockdb
create a subversion section by adding the lines
# subversion repository locations
<Location /svn >
DAV svn
SVNParentPath /usr/local/svn
# SVNPath /absolute/path/to/repository
# SVNPath /usr/local/svn/test
AuthType Basic
AuthName "subversionn repository"
AuthUserFile /usr/local/svn/svn-passwd
AuthzSVNAccessFile /usr/local/svn/svn-authz
Require valid-user

After the lines
# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. A new
# certificate can be generated using the genkey(1) command.
Comment out the old certificate name and add the line with the new certificate name like this:
#SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateFile /etc/pki/tls/certs/newcert.crt

9. As root, restart httpd to use new httpd.conf
service httpd restart

Previous Topic:Meta Trader4 on VPS
Next Topic:mail() php not working on VPS
Goto Forum:

Current Time: Tue Oct 23 01:09:18 EDT 2018
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2006 FUD Forum Bulletin Board Software