On the Oracle Developer Day image, we have installed SVN so we can use it as our source control system. Lets find our svn.
[oracle@localhost ~]$ which svn /usr/bin/svn [oracle@localhost ~]$
We can check if we have the right modules installed for apache, which in this case is mod_dav_svn.
For this we need to make sure we have the proper SVN modules installed for apache. We can do this with Yum. (The default repositories should be enough)
[oracle@localhost ~]$ ls /usr/lib/httpd/modules/|grep svn [oracle@localhost ~]$
[oracle@localhost /]$ sudo yum install mod_dav_svn Loaded plugins: security Setting up Install Process Resolving Dependencies There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them. The program yum-complete-transaction is found in the yum-utils package. --> Running transaction check ---> Package mod_dav_svn.i386 0:1.6.11-7.el5_6.4 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: mod_dav_svn i386 1.6.11-7.el5_6.4 el5_latest 78 k Transaction Summary ================================================================================ Install 1 Package(s) Upgrade 0 Package(s) Total download size: 78 k Is this ok [y/N]: y Downloading Packages: mod_dav_svn-1.6.11-7.el5_6.4.i386.rpm | 78 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : mod_dav_svn 1/1 Installed: mod_dav_svn.i386 0:1.6.11-7.el5_6.4 Complete! [oracle@localhost /]$ cd /usr/lib/httpd/modules/ [oracle@localhost modules]$ ls *svn* mod_authz_svn.so mod_dav_svn.so
Now, we can create a repository somewhere to store some code which we'll save in here later. I've added two repositories, just to show you can :).
[oracle@localhost svn]$ svnadmin create /home/oracle/svn/repo1 [oracle@localhost svn]$ svnadmin create /home/oracle/svn/repo2 [oracle@localhost svn]$ ls repo1 conf db format hooks locks README.txt [oracle@localhost svn]$ cat repo1/README.txt This is a Subversion repository; use the 'svnadmin' tool to examine it. Do not add, delete, or modify files here unless you know how to avoid corrupting the repository. Visit http://subversion.tigris.org/ for more information. [oracle@localhost svn]$
Now since we're going to access this over apache, lets change the permissions
We want to be able to secure svn, and for now, lets use basic svn authentication. In order to do that, we need to configure subversion to allow users to connect. To do that, go to your new repo, identify your svnserve.conf file and uncomment the following 2 lines
[oracle@localhost svn]$ sudo chown -R apache:apache /home/oracle/svn/repo1/ [sudo] password for oracle: [oracle@localhost svn]$ ls -al total 16 drwxrwxr-x 3 oracle oracle 4096 Apr 9 21:53 . drwxr-xr-x 45 oracle oracle 4096 Apr 9 21:51 .. drwxrwxr-x 6 apache apache 4096 Apr 9 21:53 repo1 drwxrwxr-x 6 apache apache 4096 Apr 9 21:54 repo2 [oracle@localhost svn]$
auth-access = write password-db = passwd
[oracle@localhost svn]$ cd repo1 [oracle@localhost repo1]$ ls conf db format hooks locks README.txt [oracle@localhost repo1]$ cd conf/ [oracle@localhost conf]$ vi svnserve.conf [oracle@localhost conf]$ sudo vi svnserve.conf
Now setting up webdav for svn is relatively easy too. Since we have the dav svn installed, we just need to edit the httpd.conf in /etc/httpd/conf/httpd.conf.
After all this, we can add a user to svn so we can use it. Primarily, me :)
[sudo] password for oracle: [oracle@localhost conf]$ htpasswd -c /home/oracle/svn/repo1/ conf/ db/ format hooks/ locks/ README.txt [oracle@localhost conf]$ htpasswd -c /home/oracle/svn/repo1/conf/ authz passwd svnserve.conf [oracle@localhost conf]$ sudo htpasswd -c /home/oracle/svn/repo1/conf/passwd bamcgill New password: Re-type new password: Adding password for user bamcgill [oracle@localhost conf]$
Now we have users we can use svn. However, we need to let apache know that we want to use it. Rememeber the
<Location /repos> DAV svn SVNParentPath /home/oracle/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /home/oracle/svn/repo1/conf/passwd Require valid-user </Location>
Now, we restart the httpd daemon again
cd /etc/init.d sudo ./httpd stop sudo ./httpd start
And now we have authentication, albeit basic, but there are other blows to allow ldap and ypmaster access.
Need to check in something from the directory, which we will look at in another post. Today, we set up subversion on the Oracle Developer Day Virtual Machine. In later posts, we'll use this to check in some code and use it with Hudson to automate some integration tasks.