Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Install Subversion on Ensim (RHEL 3 or 4)

Posted by plattapuss on November 23rd, 2005

Here is how I now install subversion on my RHEL 3 and RHEL 4 servers. It may not be the best way or even the correct way, but it works well for me. I also use the webdav version of accessing my repos which is included here.

Let's get going now: approximate time: 30 minutes.

As root:

RHEL 3 specific
--------------
Goto your /usr/local/src/ direcory and do mkdir subversion. Then cd subverision and goto http://summersoft.fay.ar.us/pub/sub...est/rhel-3/bin/ to download the following RPM's:

subversion
subversion-devel
subversion-debuginfo
mod_web_dav

Then install them on the main box

rpm -ivh *.rpm

RHEL 4 specific
--------------

up2date subversion subversion-devel subversion-debuginfo mod_web_dav

The rest is the same for both RHEL 3 and RHEL 4
-------------------------------------------------------
Using addpkg, we will now add the items we need for the domainname that you want to store your repos under:

addpkg domainname subversion
addpkg domainname mod_dav_svn

Now create a user in the Ensim control panel for for your domainname for subversion called 'svn'. Give this user a really bizarre password, as you will NEVER access this user directly.

Now ssh into the box and navigate to /home/virtual/domainname/home/svn and remove everything in this folder (I don't think you have to, but it looks cleaner this way). Next add a directory called 'repos' within /home/virtual/domainname/home/svn. So you now have /home/virtual/domainname/home/svn/repos

Next create 2 files in /home/virtual/domainname/etc. First one is called 'svn-access-file' and the second one is called 'svn-auth-file'. These files control who has access to your repos.

The file called svn-auth-file is similar to a .htpasswd file and you can use htpasswd to add users here.

The file called svn-access-file has the following format:

[repos_name1:/]
username1 = rw
username2 = rw

[repos_name2:/]
username1 = r    

So, if you have two users, username1 and username1 and two repos named repos_name1 and repos_name2. The above file says that username1 and username2 both have read write access to repos_name1. It also tells us that username1 has read only access to repos_name2.

Next, go to the http config directory for your site number. So if the domainname is site23 goto /etc/httpd/conf/site23 and add the following code and save it as 'subversion':

<Location /svn>
    DAV svn
    SVNParentPath /home/virtual/domainname/home/svn/repos
    # our access control policy
    AuthzSVNAccessFile /home/virtual/domainname/etc/svn-access-file

    # only authenticated users may access the repository
    Require valid-user

    # how to authenticate a user
    AuthType Basic
    AuthName "Subversion repository"
    AuthUserFile /home/virtual/domainname/etc/svn-auth-file
</Location>

Be sure to replace domainname with your real domain name. Note that you can change the filename and path to the svn-access-file and svn-auth-file.

Test and restart httpd with

/etc/init.d/httpd configtest

Be sure there were no errors and you get the response of Syntax OK. If you got errors, then you made a mistake in the site23 subversion file. Assuming you got no errors, now do this:

/etc/init.d/httpd reload

You should be all set to test svn and create your first repository now. To test the installation, chroot yourself to the site with the repos and try out svn

/usr/sbin/chroot /home/virtual/domainame
svn help

You should see some output about help in svn. If you get another error, let me know. No guarantees I can help but I am always happy to help out.

I am in the middle of a large project and sort of zipped this howto together in 5 minutes, so if there are errors, please forgive me, and then let me know

On my RHEL4 box with the latest version of Ensim I was missing libcom-3, which I simply borrowed from a kerberos installation on my RHEL3 box. Not sure how safe that was, but it worked.

To access the repository from a browser, goto http://www.domainname.com/svn/repo_name/, where repo_name is the name of the repo you gave it when you created it. Assuming you have modified the svn-auth-file and svn-access-file, you will need to login with the username and password you entered there.

You should be able to access your repos through https with no problems. I think.



Reader Comments

I am thinking to try your install method on an ensim 10.1 centos 4.4 box. Have you tried installing on the newer platform yet?

Rick, I haven’t tried on an Ensim 10.1 box, but that won’t make a difference. Subversion is control panel independent. As for Centos I am not sure.

I would love to hear any feedback you have though.

Well, I have installed onto my ensim pro x (centos 4.4) box, and used ensimpkg tools to install into a medium security site.

Your guide worked out quite well for the basic install.

I am able to browse the repo from the web, but am unable to import. When I try to import I get an error like:

216.99.99.99 – - [05/Mar/2007:20:14:46 -0500] “PUT /svn/dev/!svn/wrk/ca576d4a-3f6e-fc43-a9b4-e1a8ce7e47fb/test.pl HTTP/1.1″ 403 355 “-” “SVN/1.4.3 (r23084) neon/0.26.3″

I am using the tortoise svn client and using a web connection. http://www.domain.com/svn/reponame as my path to repo..

I tried moving the apache svn modules from the site config to the main httpd.conf file. I have verified permissions are correct on the repo.. Any suggestions?

Any ideas where I should look to resolve this?

kaynos, what command are you using to import files? You mentioned that you can browse the repos, so I am assuming you have already done an initial import.

Are you attempting to checkin more files with svn ci?

Is a little late to write in thsi post, but i hope to helps somebody in th next, when you run apachectl this may be from user “root” to bind port 80, so after that, another user takes the control of the daemon, in httpd.conf find

User xxxx
Group xxxx

this user and group must be read write rights on svn repository folder. if not an operation denied error will happen.

Thx