$> apt-get install perl apache2 subversion libapache2-svn
/srv/svn/auth as authentication folder and /srv/svn/repos for the repositories. If you want to use different directories feel free to use them but rembember to use them all throughout instead of mine. So now we create them:
$> mkdir /srv/svn
$> mkdir /srv/svn/auth
$> mkdir /srv/svn/repos
Later the apache process will have to read and write in those directories, so we let the user und group of apache own the directories. Usually the user and the group are called www-data but you might want to check that in your apache configuration. On the commandline you can easilly change the ownership by the following commands:
$> cd /srv
$> chown -R www-data svn
$> chgrp -R www-data svn
$> cd /srv/svn/auth
$> touch passwords access
$> htpasswd passwords user
Password:
/var/www/insurrection as the document root of our new virtual server, but perhaps you want to place it somewhere else. Just remember to use your path instead of this one, whenever it occures.
$> svn co http://svn.code-host.net/svn/Insurrection/trunk /var/www/insurrection
.htauth browser-tests rewrite-test screenshots .svn_index httpd.conf.patch insurrection.conf
www-data but again you might want to check that in your apache configuration.
$> cd /var/www/insurrection
$> chown -R www-data *
$> chgrp -R www-data *
We also have to make sure that all scripts are executable. So we have to set the executable flag for the files by running the following command in the insurrection folder:
$> chmod u+x *.pl *.cgi
/srv/svn/repos or whatever you named it./srv/svn/auth or the direcotry you created for this./var/log/apache2/usr/bin
Line 31: <img src="/subfolder/Logo.gif" ...
Line 41: <link href="/subfolder/favicon.ico" ...
Line 42: <link href="/subfolder/styles.css" ...
Line 43: <script src="/subfolder/insurrection.js" ...
Line 44: <script src="/subfolder/svnindex.js" ...
Line 45: <script src="/subfolder/log.js" ...
<xsl:template name="closedicon-path">/subfolder/closed.gif</xsl:template>
etc...
/srv/svn/auth/passwords.
80: RewriteCond /home/subversion/www/%{HTTP_HOST}.gif !-f
/var/www/insurrection this has to be:
80: RewriteCond /var/www/insurrection/%{HTTP_HOST}.gif !-f
http://%{HTTP_HOST}/ to have the directory included. For example: http://%{HTTP_HOST}/subfolder/, replacing "subfolder" with the name of your acutal subfolder.
/etc/apache2/mods-enabled to their correspoding .conf and .load file in /etc/apache2/mods-available. As this is already the case for subversion webdav module, we only have to add the other two modules:
$> cd /etc/apache2/mods-enabled
$> ln -s ../mods-available/rewrite.load
$> ln -s ../mods-available/proxy.conf
$> ln -s ../mods-available/proxy.load
/etc/apache2/sites-available/. So we put a new file called insurrection there. In this file we write the following configuration, in which I explain the most important lines:
# use the domainname you configured in your DNS server, or _default_
<VirtualHost svn.mycompany.com:80>
ServerName svn.mycomapny.com
# create own logfiles for subversion (and Insurrection)
CustomLog /var/log/apache2/svn_error_log common
ErrorLog /var/log/apache2/svn_error_log
#
# The Insurrection tree lives here...
#
DocumentRoot /var/www/insurrection
<Directory "/var/www/insurrection">
Options FollowSymLinks ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
# This is needed because we do many things with the .htaccess file.
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Never show our internal .svn directories
<DirectoryMatch "^/.*/\.svn">
Order allow,deny
Deny from all
</DirectoryMatch>
<Location /svn>
DAV svn
# this is the root under which all our repositories lie
SVNParentPath /srv/svn/repos
SVNIndexXSLT "/insurrection.xsl"
# If insurrection is in a subfolder you should use the next line instead
# but remember to replace "subfolder&qout; with the name of your actual subfolder
# SVNIndexXSLT "/subfolder/insurrection.xsl"
# our access control policy
AuthzSVNAccessFile /srv/svn/auth/access
# try anonymous but require a user if needed
Satisfy Any
Require valid-user
# how to authenticate a user
AuthType Basic
AuthName "Code-Host Repository"
# our previously created file containing all usernames and passwords
AuthUserFile /srv/svn/auth/passwords
</Location>
</VirtualHost>
/etc/apache2/sites-enabled folder:
$> cd /etc/apache2/sites-enabled
$> ln -s ../sites-available/insurrection
$> svnadmin create /srv/svn/repos/myFirstRepository
$> /etc/init.d/apache2 restart