Subversion with Apache
One of the greatest featurse with nowodays SVC systems, in particular Subversion, is its accessibility through a banch of network protocols, as HTTP, when SVN is coupled with Apache web server. When making my own install on my lapotop, and as I’m very sensitive to keep each peace of software in it’s own containing folder, I came to these points :
- It was impossible for me to avoid copying required SVN dlls to Apache bin folder. That’s the most annoying part of the installation especially when the 2 official tutorials are not really explicit. In fact, including the bin directory of SVN installation into the PATH system variable is not working. And copying only intl3_svn.dll and libdb44.dll is not working eather. I finally come across the solution consisting of copying intl3_svn.dll as well as all the lib*.dll to the Apache/bin folder, without overrwiting the existing ones. It’s about 12 dll files.
- The SVN official documentation states that the stylesheet files (necessary if we want to visualize a well-presented web page when accessing to the repository URL) shall be put in the DocumentRoot of the Apache server. That’s also an annoying point for me as I always want to avoid putting any extra document or file in the standard Apache installation. This time, I found a little hack to avoid this, without even playing with VirtualHosts configuration. The main part to add to httpd.conf is the following :
<Location /svn> DAV svn SVNListParentPath on SVNParentPath D:\svnrepo SVNIndexXSLT /svnindex.xsl AuthType Basic AuthName "Subversion repositories" AuthUserFile "auth/__users.txt" Require valid-user </Location>
wich makes the SVN repository accessible at http://localhost/svn. Now we want the SVN stylesheets material to be placed outside the Apache DocumentRoot, for example in the folder D:/www/svn-web-content/, we have just to add the following configuration to httpd.conf :
Alias /svn-web "D:/www/svn-web-content/" <Directory "D:/www/svn-web-content/"> AllowOverride None Order Deny,Allow Allow from all </Directory>
And then change the directive SVNIndexXSLT to point at /svn-web/svnindex.xsl instead of /svnindex.xsl. Now if we open the page http://localhost/svn, we unfortunately see the same unformatted basic page. However, after looking to the Apache acess log file, we can understand the trick :
“GET /svn-web/svnindex.xsl HTTP/1.1″ 200 3558
“GET /svnindex.css HTTP/1.1″ 404 1950
“GET /menucheckout.ico HTTP/1.1″ 404 1950
So XSL file is correctly found and sent by the server, but not the CSS/ICO file. The solution is really simple by editing the XSL file and replacing each occurrence of href=”/svnindex.css with href=”/svn-web/svnindex.css, and the same for the file menucheckout.ico. It’s up and running.
