I am trying to configuring Subversion (SVN) on our Bluehost VPS server which has CentOS v6.5. So far, Installation went smoothly by following this guide -> http://wiki.centos.org/HowTos/Subversion

However, now I am stuck at its 4.2 step [Subversion's Apache configs].

Ok so here the story goes.

Mostly on web the guides to install Subversion (svn) on bluehost are for shared server for whom the steps on CentOS official wiki page of Subversion (let's call it A) doesn't work hence they follow this guide (let's call it B).

The module mod_dav_svn allows subverion to be served via Apache, because its installation is not allowed on shared server thats what I have learned. Hence many people fall for guide B, which can work for us by establishing svn connection over ssh (svn+ssh) however I am trying to bend the spoon to see if svn connection can be established over apache.

Following guide A

I have a url svn.domain.com pointing to /home/username/public_html/svn.domain.com/ in which I have setup the repositories named repos1

and have setup subversion.conf file in /etc/httpd/conf.d/subversion.conf as following

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /repos1>
        DAV svn
        SVNPath /home/username/public_html/svn.domain.com/repos1
        AuthType Basic
        AuthName "Subversion repos"
        AuthUserFile /etc/svn-auth-conf
        Require valid-user

and opening http://svn.domain.com/repos1 it displays plain contents of the directory located in /home/username/public_html/svn.domain.com/repos1.

Where I assume it should ask for password and display Revision 0 or at least trunk, branch and tag folders.

Any help or direction would be appreciated.

  • 1: repos1 folder is created by svnadmin create repos1 command.
  • 2: This setup has worked for us on different server but they have very very limited space.

Try this

<Location "/"> AuthType Basic AuthName "Subversion repos" AuthUserFile /etc/svn-auth-conf Require valid-user </Location> <Location /repos1> DAV svn SVNPath /home/username/public_html/svn.domain.com/repos1 </Location>

Don't forget to reload Apache.

  • tried but still same result – Abhishek Madhani Aug 13 '14 at 20:01
  • I think subversion.conf is not loaded at all, because I just enter invalid path for SVNPath variable, apache restarted without any errors. Anyways have raised the ticket with Bluehost, will wait for their response as well and update here. – Abhishek Madhani Aug 13 '14 at 20:04
  • finally I was able to sort it out with support from Bluehost, thanks for your help though. – Abhishek Madhani Aug 13 '14 at 23:52
  • Glad to hear it! – joeg1ff Aug 14 '14 at 12:51

Installing and Configuring Subversion (SVN) on BlueHost VPS Server (CentOS)

My all steps are just follow up of this beautiful wiki article at http://wiki.centos.org/HowTos/Subversion . The article has overall 8 steps, however for installation on BlueHost VPS an expansion is required for step 3 and step 4.2

Step 3 - While installing yum install mod_dav_svn subversion it will give error

Error: Missing Dependency: httpd-mmn = 20051115 is needed by package mod_dav_svn

To resolve it kindly do following steps

[$] find / -name "yum.conf"                 --- Note the path
[$] vim /path/yum.conf                          --- Edit the file

Remove the httpd* from the following line

exclude=apache* bind-chroot courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* perl* php* proftpd* pure-ftpd* ruby* spamassassin* squirrelmail*

Save the and exit the file :wq!

[$] yum install mod_dav_svn subversion      --- If Success, then you can revert back yum.conf file to its original.

Step 4 - Before proceeding to this step kindly create a domain or subdomain (svn.domain.com) preferable, and assign it to any folder (mostly /home/username/public_html/svn.domain.com)

/home/username/public_html/svn.domain.com     --- will be main folder under which I will have many repositories (not just one, but many)

Step 4.1 - Skip this step from the article, as BlueHost will take its care

Step 4.2 - By default Subversion will create a .conf file named as subversion.conf in /etc/httpd/conf.d/subversion.conf

For BlueHost, any files in this path are in-effective (took me four hours to figure out) because it uses C-Panel which has it own requirement to follow -> http://docs.cpanel.net/twiki/bin/view/EasyApache3/InsideVHost

So edit the /etc/httpd/conf/httpd.conf file in your favourite edit

[$] vim /etc/httpd/conf/httpd.conf`         --- Edit the main Apache config file
[Editor] /svn.domain.com                        --- Hit Enter and search for your domain configurations, scroll through up or down keys or n for next hit

Just above the for svn.domain.com you will come across something similar to below lines

# To customize this VirtualHost use an include file at the following location
#Include "/usr/local/apache/conf/userdata/std/2/username/svn.domain.com/*.conf"

Uncomment the Include by remove the hash (#) at the beginning and Copy the path between the Include until *.conf (remove *.conf) and paste as below in mkdir command

[$] mkdir -p /usr/local/apache/conf/userdata/std/2/username/svn.domain.com/             --- Creates all parents directory as well if they don't exist
[$] vim /usr/local/apache/conf/userdata/std/2/username/svn.domain.com/subversion.conf   --- Create subversion configuration file

In subversion.conf file while in edit mode (press i) paste the below and kindly change the path of SVNParentPath and AuthUserFile as required

Kindly note that DocumentRoot in VirtualHost configs and SVNParentPath in subversion.conf cannot have same directory path. SVNParentPath must supersede or be in located in different directory altogether, it cannot be under DocumentRoot path.

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location />
    DAV svn
    SVNParentPath /home/username/public_html/svn.domain.com/
    SVNListParentPath ON
    AuthType Basic
    AuthName "DFR Visualization Images Repository"
    AuthUserFile /home/username/public_html/svn.domain.com/svn-auth-conf
    Require valid-user

Now :wq! and save and exit the file.

Now execute below commands to create the authentication file in the path mentioned in AuthUserFile variable in subversion.conf file

In htpasswd command use -cm argument for first time creation of users and for subsequent users just use -m, else previous users data will be lost

[$] htpasswd -cm /home/username/public_html/svn.domain.com/svn-auth-conf username       --- Press enter and input password

One more last step. By Default Subversion installs the modules required to load for SVN to work properly in proper directory, but because BlueHost uses C-Panel it has different directory for same purpose, which Subversion will not realise.

Therefore we need to manually copy the Subversion modules installed in default module directory to C-Panel's modules directory.

First find where the Subversion has installed following two modules which we specified in subversion.conf file

[$] find / -name "mod_dav_svn.so"           --- Find and note subversion installation path
[$] find / -name "mod_authz_svn.so"         --- Find and note subversion installation path

Copy them to C-Panel modules folder (generally /usr/local/apache/modules/), kindly verify the path before copying.

[$] cp /subversion_modules_path/mod_dav_svn.so /usr/local/apache/modules/
[$] cp /subversion_modules_path/mod_authz_svn.so /usr/local/apache/modules/

Now Login to your C-Panel of bluehost and Restart the Apache Service located at C-Panel -> WHM -> Restart Services -> HTTP Server (Apache)

Follow the rest steps as in the article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.