Showing posts with label Subversion. Show all posts
Showing posts with label Subversion. Show all posts

Wednesday, April 28, 2010

How To Install Subversion with TRAC on CentOS 5.x

SkyHi @ Wednesday, April 28, 2010

In this howto i will describe how to install subversion with TRAC. Subversion is an open source version control system alternative to CVS and TRAC an enhanced wiki and issue tracking system for software development projects which provides an interface to Subversion. I install it on CentOS 5.4 which is already running as Web Server. I will use sohailriaz.com source to be maintain by Subversion and TRAC to track all development.


1) Installation


To install subversion and trac on CentOS 5.4 we will use dag repositories as it has latest packages (rpms) available for said softwares.


Red Hat Enterprise Linux / CentOS 5 / i386:


rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm


Red Hat Enterprise Linux / CentOS 5 / x86_64:


rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm


Now issue yum command to install subversion and trac with pre-requisites.


yum -y install subversion trac mod_dav_svn mod_python


where mod-dav_svn and mod_python are apache modules which will be use later on to access subversion and trac.


2) Configuring Subversion.


2.1) Creating directories for Subversion.


mkdir /var/www/svn/svnrepos

mkdir /var/www/svn/auth


2.2) User Authentication.


We will create a user to access SVN repositories


htpasswd -cb /var/www/svn/auth/svn.htpasswd svnuser1 passw0rd

Adding password for user svnuser1


2.3) Create Project Repository.


Now we will create a Project Repository. It can be user define name. I will choose site-sohailriaz.com name here for my Project Repository.


svnadmin create /var/www/svn/svnrepos/site-sohailriaz.com


svn mkdir file:///var/www/svn/svnrepos/site-sohailriaz.com/branches file:///var/www/svn/svnrepos/site-sohailriaz.com/tags file:///var/www/svn/svnrepos/site-sohailriaz.com/trunk -m “Creating directories for initial import”


Committed revision 1.


Change ownership and group member to apache (default user for web server)


chown -R apache:apache /var/www/svn/svnrepos/site-sohailriaz.com/


Generate configuration for svn to view from website.


vi /etc/httpd/conf.d/svn.conf


<Location /svn>

DAV svn

SVNListParentPath on

SVNParentPath /var/www/svn/svnrepos/


AuthType Basic

AuthName “SohailRiaz.com Site Repository”

AuthUserFile /var/www/svn/auth/svn.htpasswd

Require valid-user

</Location>


Start service to take the changes.


/etc/init.d/httpd restart


Now browse your site to see the SVN repository.


http://www.sohailriaz.com/svn/


It will ask the user/pass you created initially and after successful login you will see your repositories.


2.4) SVN Import for site files.


We will use svn import to import files from our site to repository to maintain the code.


svn import /home/sohail/public_html/ http://www.sohailriaz.com/svn/site-sohailriaz.com/trunk/

Authentication realm: SohailRiaz.com Site Repository

Password for ‘root’ : <enter root password>

Authentication realm: SohailRiaz.com Site Repository

Username : svnuser1

Password : passw0rd


Now browse your site and see the trunk folder, you will see your code listed there.


2.5) Branches


If you need to have multiple branches for your site then that is relatively very easy within subversion. All you need to copy from trunk to branches folder with user define name to recognized.


svn copy http://www.sohailriaz.com/svn/site-sohailriaz.com/trunk/ http://www.sohailriaz.com/svn/site-sohailriaz.com/branches/site-sohailriaz.com-branch-1 -m “1st Branch for Site SohailRiaz.com”


3) Configure Trac.


First configure trac instance using trac-admin command for svn repository site-sohailriaz.com


trac-admin /var/www/trac/site-sohailriaz.com initenv

Creating a new Trac environment at /var/www/trac/site-sohailriaz.com


Trac will first ask a few questions about your environment

in order to initalize and prepare the project database.


Please enter the name of your project.

This name will be used in page titles and descriptions.


Project Name [My Project]> Site SohailRiaz.com


Please specify the connection string for the database to use.

By default, a local SQLite database is created in the environment

directory. It is also possible to use an already existing

PostgreSQL database (check the Trac documentation for the exact

connection string syntax).


Database connection string [sqlite:db/trac.db]> <Enter>


Please specify the type of version control system,

By default, it will be svn.


If you don’t want to use Trac with version control integration,

choose the default here and don’t specify a repository directory.

in the next question.


Repository type [svn]> <Enter>


Please specify the absolute path to the version control

repository, or leave it blank to use Trac without a repository.

You can also set the repository location later.


Path to repository [/path/to/repos]> /var/www/svn/svnrepos/site-sohailriaz.com


Please enter location of Trac page templates.

Default is the location of the site-wide templates installed with Trac.


Templates directory [/usr/share/trac/templates]> <Enter>

…………………..

…………………..

…………………..

Congratulation!


Edit /etc/httpd/conf.d/trac.conf and change /var/trac to /var/www/trac at line starting from PythonOption TracEnvParentDir


vi /etc/httpd/conf.d/trac.conf


following line should be like this


PythonOption TracEnvParentDir /var/www/trac


Create user account for trac access


htpasswd -cb /var/www/trac/.htpasswd tracuser1 passw0rd


Change ownership and group member to apache of trac instances.


chown -R apache:apache /var/www/trac/site-sohailriaz.com


Restart webserver to take changes.


/etc/init.d/httpd restart


Now browse the site and you will see all available projects under trac and then open the project to browse by viewing source.


REFERENCES

http://www.sohailriaz.com/how-to-install-subversion-with-trac-on-centos-5-x/

Tuesday, April 27, 2010

Subversion replication at Atlassian

SkyHi @ Tuesday, April 27, 2010

It's cool working for an international company with an open philosophy, but our decentralised setup can cause some real headaches for sysadmins. One of these is giving fast access the source-code repository to our developers and support staff spread over 3 continents, all working on a common code base.

Subversion is the existing version-control system here, primarily for the tool support and well-understood workflow. But it's not without its problems, not least that its chatty-on-the-wire nature causes problems when latency is introduced. And when your developers are in Sydney and your servers in St. Louis that's about as high-latency as you're going to get on the internet.

While Subversion 1.5 introduced the concept of a write-through proxy, the devil is in the details. The documentation of how to do this is sparse, and developing a robust method of replication is "left as an exercise to the reader". This post documents some of the considerations that need to be taken into account and the method we are using at Atlassian to get reliable high-speed Subversion servers in a distributed environment.

The basic replication architecture is straight-forward: the slave server serves up checkouts and meta-data from a local cache but transparently proxies checkins to the master server. The concept of how checkins are replicated to the slaves is also simple enough:

  1. A user checks-out a working copy from the slave and makes changes
  2. User issues 'svn commit' which pushes the changes to the slave
  3. The slave transparently pushes the commit to the master
  4. The master completes the commit and invokes its post-commit hook
  5. The post-commit hook contains code to push the update all the known slaves

However the devil is in the details. The exact method of push-to-slave operation is poorly documented; there is a brief suggested method in the readme file that is unfortunately highly synchronous. As already mentioned, an alternative method using svnsync is "left as an exercise to the reader". We need method method of doing this that minimises commit time while keeping all slaves up to date.

The problem

The problem with the documented SSH + dump/restore method is that it will tie up the committing client and the server for the entire time it takes to upload and import the incremental dump. But if that slave is unavailable for any reason it will hang until the TCP session times-out. Furthermore that slave will then be out of sync with the master repository and future commits will fail. What we need is a method where the slaves are updated asynchronously and will compensate for missed commits.

The solution

Enter svnsync. This allows mirroring of a subversion repository is a transaction-aware manner, only pulling down revisions it does not currently have. It performs its own local locking on the mirrored repository so collisions are not an issue.

However there is still the question of when to run the updates. We could just poll the repository with a cron-script, but this creates a window where the slaves are out of sync unless the sync is run constantly, which would be wasteful. However a purely event-driven system suffers from the some of problems as the SSH dump/restore system above; if an update is missed the slave is out of sync until the next update is received. Furthermore if the event is implemented synchronously the post-commit script is tied-up.

In the end I opted for a hybrid solution that where each slave runs a server that accepts a single UDP packet to trigger an update (allowing the post-commit script to fire-and-forget) with intermittent scheduled update to compensate for missed events.

Setting up the mirror

The first step is to initialise the svnsync mirror. This requires setting up new repository then initialising it from the master. To ensure repository integrity only a special svnsync user can write to the repository:

sudo su - svnsync
svnadmin create /opt/svn/repositories/atlassian/private-mirror

Before synchronisation property-revisions must be enabled on the mirror. Again, only the special user can perform this action. Create the file /opt/svn/repositories/atlassian.com/private-mirror/hooks/pre-revprop-change and add the following:

#!/bin/sh
USER="$3"

if [ "$USER" = "svnsync" ]; then
# Allow
exit 0;
fi

echo "Only the svnsync user can change revprops" >&2
exit 1

Then convert the repository to a synchronisable one by setting the remote source. Then perform the initial sync-up:

svnsync init file:///opt/svn/repositories/atlassian.com/private-mirror https://svn.atlassian.com/svn/private
svnsync sync file:///opt/svn/repositories/atlassian.com/private-mirror

This copies the entire history of the master to the slave, so depending on your repository size it may time some time. Once this is done the following will update the mirror to latest the master revision:

svnsync sync file:///opt/svn/repositories/atlassian.com/private-mirror

One problem you are likely to hit with this setup is that because we created a new repository from scratch it has a different UUID from the master. This is fine for checkouts but will fail on commits. However we can manually copy the UUID across from the master:

cd /opt/svn/repositories/atlassian.com/private-mirror/db/
scp svn.atlassian.com:/opt/svn/repositories/atlassian.com/private-mirror/db/uuid .

You should now have a working mirror which can be made available via the SVN 1.5 proxy in Apache (authentication is ignored in this example):

   
DAV svn
SVNPath /opt/svn/repositories/atlassian.com/private-mirror
SVNMasterURI https://svn.atlassian.com/svn/private

The next step is keep the mirror up-to-date ....

The Update Event Server

So we need a server that will accept UDP packets, fork off and monitor sub-processes, and trigger time-based events. We could probably monkey-up something with inetd and cron but I like to keep all the variables in one place so I implemented my own server that handles all the tasks in the same place. Of course, reinventing the wheel sucks so I turned to the Python Twisted framework which supplies all of the necessary pieces ...

import sys, re
from twisted.internet.protocol import DatagramProtocol, ProcessProtocol
from twisted.internet import reactor, task

cmdline = ['svnsync', 'sync', 'file:///opt/svn/repositories/atlassian.com/private-mirror']
lockmsg = "Failed to get lock"

_debug = False
def debug(msg):
if _debug:
print >> sys.stderr, msg
def error(msg):
print >> sys.stderr, msg
def log(msg):
print >> sys.stdout, msg

class SyncProcess(ProcessProtocol):
def __init__(self):
self.running = False

def connectionMade(self):
self.running = True
log("SVN sync process started")

def outReceived(self, data):
log("stdout> %s" % data)
if data.find(lockmsg) > -1:
error("ERROR: The mirror repo has a lock on it")

def errReceived(self, data):
log("stderr> %s" % data)

def inConnectionLost(self):
debug("inConnectionLost! stdin is closed! (we probably did it)")

def outConnectionLost(self):
debug("outConnectionLost! The child closed their stdout!")

def errConnectionLost(self):
debug("errConnectionLost! The child closed their stderr.")

def processEnded(self, status):
self.running = False
log("Sync process ended, status %d" % status.value.exitCode)


class SyncListener (DatagramProtocol):

def __init__(self):
self.prochandler = SyncProcess()
self.timeout = task.LoopingCall(self.runsync)

def startProtocol(self):
print "Starting UDP server and timeout"
self.timeout.start(120, now=False)

def datagramReceived(self, data, (host, port)):
log("Received packet from %s:%d" % (host, port))
self.runsync()

def runsync(self):
if self.prochandler.running:
log("Not running sync as another process is present")
else:
reactor.spawnProcess(self.prochandler, cmdline[0], cmdline, {})


reactor.listenUDP(9999, SyncListener())
reactor.run()

This server runs constantly on the slave server listening on port 9999. On receiving a packet it forks off an svnsync process (unless one is already running). Additionally, every two minutes it runs a sync regardless. The server is started via daemontools, which ensures that if the server quits for any reason is restarted.

Triggering updates

When the master receives a commit it triggers an update on each slave by sending a UDP packet to them. This is done in the post-commit script using the netcat network tool:

echo 1 | nc -w1 -u svn.sydney.atlassian.com 9999

And that's it, with the exception of some caveats ...

Locking

It's not clear how locking interacts with replication; however distributed locking is not something that should be taken lightly. For this reason I've disabled locking on both the master and slave repositories. This is just a matter of putting the following in the pre-lock hook:

#!/bin/sh

# Disable locking as we are doing replication and it's not clear how
# they will interact.
echo "Locking is disabled due to replication" >&2
exit -1

This will return a meaningful error message if someone attempts to lock a file.

Client version issue

There is a known issue with some versions of Subversion clients when adding files to replicated slaves. The list of clients I've tested is below:

ClientVersionWorking
Subversion commandline1.4.*Yes
Subversion commandline1.5.0Yes
Subversion commandline1.5.\[1-4\]No
TortoiseSVN 1.4.*Yes
TortoiseSVN 1.5.*No
IDEA7.0.*Yes
IDEA8.0M1Yes

Distributed VCS

The elephant in the room here is that none of this should really be necessary. There are now a number of version-control systems, commercial and open-source, that are distributed in nature and so don't need this special treatment. With these systems commits are two phase, with a local checkin followed (optionally) by a merge to a remote repository (or a pull depending on your development model). This is undoubtedly the way of the future and there has already been discussion about trialling them internally at Atlassian. However there are two short-term issues that prevent an immediate migration:

  • Tool support. Fisheye, Crucible, Maven, IDEA; until these parts of our tool-chain have native support for these next-gen systems our workflow would have to be severely modified.
  • Developer process. Because a local commit does not automatically propagate changes to the master repository more discipline is required from developers. In practice this would probably require creating the role of a merge-master on each team who would make sure all working trees are regularly merged and conflicts resolved.

Neither of these problems are insurmountable though, and I expect that in time distributed source-control will become the norm rather than the niche it currently is.


REFERENCES

http://blogs.atlassian.com/developer/2008/11/subversion_replication_at_atla.html






How To Setup Subversion Replication on CentOS5?

SkyHi @ Tuesday, April 27, 2010

If you want to setup two subversion server , one master and another
as read only slave with password and acl protected so keep reading.
Let's suppose you have two subversion server , as below...

SVN-M(master)
Hostname: svn-m.example.com
IPAddress: 10.10.10.1/24

SVN-S (slave)
Hostname: svn-s.example.com
IPAddess: 10.10.10.2/24


Setup yum repository:

Download any one RPM according to your OS and system architecture .....

(for RHEL5 32 bit version)
wget
http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm

OR

(for RHEL5 64 bit version)
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

Setup Master SVN Server:

1) Install Apache Webserver and Subversion .

yum install httpd httpd-devel subversion mod_dav_svn -y


2) Create SVN Repository:

I
like fsfs filesystem based SVN repository over BDB based . To know more
difference between fsfs and BDB go through following article

http://svnbook.red-bean.com/en/1.1/ch05.html#svn-ch-5-sect-1.3

(Read "
Repository Data-Stores" section )

mkdir -p /var/www/svn ( -p to create parent directory if it doesn't exist)

svnadmin create --fs-type=fsfs /var/www/svn/repos

Note:check
httpd.conf User and Group section to know user and group by which
apache is running as follows and then change owner and group owner
according to that )

grep ^User /etc/httpd/conf/httpd.conf

OutPut: User apache

grep ^Group /etc/httpd/conf/httpd.conf

OutPut: Group apache

chown -R apache:apache /var/www/svn/repos


3) Configure Apache Webserver for Master subversion:

Enable name based virtual hosting in

vi /etc/httpd/conf/httpd.conf

NameVirtualHost *:80


vi /etc/httpd/conf.d/subversion.conf
-------------------------------------------------------------------------------------------------------------------------------------
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<VirtualHost *:80>
ServerName svn-m.example.com
<Location /repos>
DAV svn

SVNPath /var/www/svn/repos
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /var/www/svn/.htpasswd
AuthzSVNAccessFile /etc/svn-acl-conf
Require valid-user

</Location>
</VirtualHost>
-------------------------------------------------------------------------------------------------------------------------------------


4) Create SVN user :

htpasswd -cm /var/www/svn/.htpasswd test

Note:
-c to create file first time and -m for md5 hashed password. Don't use
-c second time while creating user otherwise it will overwrite existing
file.

5) Create Subversion Access control list file for Master:

vi /etc/svn-acl-conf
-------------------------------------------------------------------------------------------------------------------------------------
[repos:/]
administrator = rw
* = r
-------------------------------------------------------------------------------------------------------------------------------------
Note: Only administrator can write to repository and everyone else can only read to repository.

6) Create SVN Repository Layout:

mkdir -p /tmp/productname/{trunk,stable,branches,releases}

svn import /tmp/productname/ file:///var/www/svn/repos/productname -m "Creating Productname Layout"

To know more about SVN Repository Layout , Please go through following link...

http://svnbook.red-bean.com/en/1.4/svn.tour.importing.html#svn.tour.importing.layout


Now make host entry as follows in /etc/hosts on client side and point http://svn-m.example.com/repos in your browser and you will get username password box.Now login by previously created usernane.

10.10.10.1 svn-m.example.com

Here your master SVN server is ready...... :)


Setup Slave SVN Server:

Step 1 and 2 same as Master.

3) Configure Apache Webserver for Slave subversion:

Enable name based virtual hosting in

vi /etc/httpd/conf/httpd.conf

NameVirtualHost *:80


vi /etc/httpd/conf.d/subversion.conf
-------------------------------------------------------------------------------------------------------------------------------------
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<VirtualHost *:80>
ServerName svn-s.example.com

<Location /repos>
DAV svn

SVNPath /var/www/svn/repos
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /var/www/svn/.htpasswd
AuthzSVNAccessFile /etc/svn-acl-conf
Require valid-user

</Location>
</VirtualHost>


-------------------------------------------------------------------------------------------------------------------------------------
4) Step 4 is same as master

5) Create Subversion Access control list file for Slave:
-------------------------------------------------------------------------------------------------------------------------------------
[repos:/]
svnmirror = rw
* = r
-------------------------------------------------------------------------------------------------------------------------------------
Imp Note: Please don't give write access to anyother user than svnmirror , only svnmirror should be able to write on slave no one else.

6) Make Mirror Repository Revision Properties Modifiable by Synchronizing User:

cd /var/www/svn/repos/hooks
vi pre-revprop-change
-------------------------------------------------------------------------------------------------------------------------------------
#!/bin/sh

USER="$3"

if [ "$USER" = "svnmirror" ]; then exit 0; fi

echo "Only the svnmirror user may change revision properties as this is a read-only, mirror repository." >&2

exit 1
-------------------------------------------------------------------------------------------------------------------------------------

7) Create svnmirror user on master

htpasswd -bm /var/www/svn/.htpasswd svnmirror svn


Note:
-b option is used to supply password on command line, here svnmirror
user password is "svn". You can just remove -b option can type when it
will ask for password.

8)
Register mirror repository for synchronization

svnsync initialize file:///var/www/svn/repos http://svn-m.example.com/repos --username=svnmirror

It will ask svnmirror password that we created on master in our case this is "svn"

If everything is configured properly, you should see some output like this

Copied properties for revision 0.

Now
we have registered our svn-s , slave i.e. mirror repository with master
repository , now we should do initial synchronization so that mirror
(slave) and master repository are synchronized .

svnsync synchronize file:///var/www/svn/ repos --username=svnmirror

you should see output like this.

Committed revision 1.
Copied properties for revision 1.

9) Create SVN user on Slave:

htpasswd -bm /var/www/svn/.htpasswd svnslavetest svnslavetest
Now
make host entry in /etc/hosts on client side and point your
http://svn-s.example.com/repos in your browser.You should get username
and password pop-up just use previously created username and password

UserName: svnslavetest
Password: svnslavetest

10.10.10.2 svn-s.example.com

9) Automate Synchronization with cron

vi /etc/crontab

*/5 * * * * root svnsync synchronize file:///var/www/svn/ repos --username=svnmirror --password=svn > /tmp/svnsync.log

Now every 5 minute mirror repository will synchronize with master.

cool :)

Please send me your feedback and suggestions.

Thanks









3
comments:







windsword
said...

Abhishek,
Great job, best description I've found.

help: one key step for newbies like is, should I be in su mode or 'sudo' each time?

Secondly: I want to set this for now locally on my PC. so I'm setting the server name as 'localhost' does this work?

//windsword







windsword
said...

If you allow me a question, why create this under /var/?

and
on step 8 I get an error when I type: "sudo svnsync initialize
file:///var/www/svn/repos http://localhost:8080/repos
--username=svnmirror"

svnsync: 'pre-revprop-change' hook failed with error output:

To start out without an svnmirror, do I need the same an abridged version of the instructions?

Lastly, step 3 also talks about setting: "NameVirtualHost *:80" but I already have the following, 'Listen 8080'
should I append to the
"/etc/httpd/conf/httpd.conf" the line you mentioned: "NameVirtualHost *:80" ??

// windsword







TuxBuddy
said...

I followed the doc http://abhishekkumarsingh.blogspot.c...cation-on.html for SVN Replication.
I followed line by line but stuck with this error :

Code:

[root@askr hooks]# svnsync initialize file:///var/www/svn/repos http://10.14.236.92/repos --username=svnmirror
svnsync: Revprop change blocked by pre-revprop-change hook (exit code 255) with no output.

REFERENCES
http://abhishekkumarsingh.blogspot.com/2008/05/how-to-setup-subversion-replication-on.html

Easily develop and deploy web applications from subversion

SkyHi @ Tuesday, April 27, 2010

Updated 2008-28-10.
Proper version control is a must for everyone who programs more than a
few lines of code. Even if you develop your applications all by
yourself it is very handy to be able to branch and merge your code, be
able to roll back to previous versions or undo changes you made in the
past. It works great for regular applications, but managing web
applications or websites is a tad harder for two reason: You need a
webserver to get your application going and you usually have to manage
database revisions as well.



Keeping database revisions in sync with your code revisions is a
complex subject that I will leave until another time. In this article I
will show you how you can configure your own computer or development
server in such a way that checking out or deploying a web application
is just as easy as any other piece of code.



First I will show you how to configure Apache
on your development server so that it picks up your checked out working
copies as separate subdomains. Using this, you can simply make a
checkout of your project and it will automagically be up and running.
No need to touch the Apache configuration. After that I will show you
how to use dnsmasq
so you can achieve the same effect on your own development machine.
That way you can develop your web applications locally and you won't
need a central development server. In my examples I will be assuming
you use subversion for your version control, but it works virtually the
same with other version control packages, such as git or bazaar.



Creating subdomains for every working copy



Here is what we want to achieve. Suppose that you have a development server at http://dev.example.org
where you develop your websites. We want that every working copy is
it's own subdomain on that server. If I check out a working copy and
name it “foobar” then it should be available on http://foobar.dev.example.org. In order for this to work, you need a wildcard DNS entry so that all subdomains of dev.example.org
go to your development server. I won't cover how you do that. If you do
not run your own DNS server, ask your network administrator about it or
use dnsmasq as explained in the second part of this article.



Start by creating a directory where all your working copies will live. For this article I will assume that this is /home/checkout. Every directory under this directory will become a subdomain on your development server. Create a trunk directory under the checkouts directory (/home/checkout/trunk). This is where the main dev.example.org
domain will go to. When a subdomain does cannot resolve to a directory
under /home/checkouts we want to show an error page. I created /home/checkouts/error.html containing some useful information, but you could also redirect it to a 404 error if you want.



Then create a new virtual host configuration for Apache.



  1. <VirtualHost *:80>
  2.         DocumentRoot /home/checkout/trunk
  3.         ServerName dev.example.org
  4.         ServerAlias *.dev.example.org
  5.  
  6.         LogLevel warn
  7.         ErrorLog /var/log/apache2/error.log
  8.         CustomLog /var/log/apache2/access.log combined
  9.         ServerSignature On
  10.  
  11. </VirtualHost>


We will use mod_rewrite to tell Apache about all the subdomains. The
following mod_rewrite rules extract the subdomain from the request, see
if a directory exists in /home/checkout that matches the subdomain and then redirects the request to that directory (hat-tip to Stuart).



  1.         RewriteEngine On
  2.  
  3.         # If the request contains a subdomain and the directory exists, redirect
  4.         RewriteCond %{HTTP_HOST} ^([^\.]+)\.dev\.example\.org
  5.         RewriteCond /home/checkout/%1 -d
  6.         RewriteRule ^(.*) /home/checkout/%1/$1 [L]


Next, we add some more rules to redirect any non-existing subdomains to the error page:



  1.         # Redirect non-existing subdomains to the error page
  2.         RewriteCond %{HTTP_HOST} ^([^\.]+)\.dev\.example\.org
  3.         RewriteRule ^(.*) /home/checkout/error.html [L]


Update: Kevin points out in this comment that using the VirtualDocumentRoot directive is an even nicer solution than these rewrite rules.



Finally we want to hide the .svn directories that subversion creates
when you make a new checkout. If you use a different version control
system such as git, then replace .svn with .git in the configuration
below:



  1.         # Hide .svn directories in checkouts
  2.         <Directory ~ "/\.svn/">
  3.                 order allow,deny
  4.                 deny from all
  5.         </Directory>


Restart Apache and you're done. Now you can simply log into the development server, make a new checkout in the /home/checkout directrory and you can immediately browse to it. After executing the example below, you can simply browse to http://my-working-copy.dev.example.org and see your website.



  1. $ ssh dev.example.org
  2. Last login: Wed Aug  6 09:36:33 2008 from 10.0.0.99
  3.  
  4. dev$ cd /home/checkout
  5. dev$ svn checkout https://svn.example.org/project/trunk my-working-copy


The full Apache configuration file now looks like this (download):



  1. <VirtualHost *:80>
  2.         DocumentRoot /home/checkout/trunk
  3.         ServerName dev.example.org
  4.         ServerAlias *.dev.example.org
  5.  
  6.         LogLevel warn
  7.         ErrorLog /var/log/apache2/error.log
  8.         CustomLog /var/log/apache2/access.log combined
  9.         ServerSignature On
  10.  
  11.         RewriteEngine On
  12.  
  13.         # If the request contains a subdomain and the directory exists, redirect
  14.         RewriteCond %{HTTP_HOST} ^([^\.]+)\.dev\.example\.org
  15.         RewriteCond /home/checkout/%1 -d
  16.         RewriteRule ^(.*) /home/checkout/%1/$1 [L]
  17.  
  18.         # Redirect non-existing subdomains to the error page
  19.         RewriteCond %{HTTP_HOST} ^([^\.]+)\.dev\.example\.org
  20.         RewriteRule ^(.*) /home/checkout/error.html [L]
  21.  
  22.         # Hide .svn directories in checkouts
  23.         <Directory ~ "/\.svn/">
  24.                 order allow,deny
  25.                 deny from all
  26.         </Directory>
  27.  
  28. </VirtualHost>


Developing locally with dnsmasq



Developing your websites on a central development server works, but
most often it's easier to develop on your local machine instead. It's
usually faster and there are quite a few handy tools out there that
don't work transparently over an ssh connection. When you have a Linux
desktop or laptop it's dead easy to do. Simply install Apache, PHP,
MySQL or whatever server-side tools you need on your desktop, copy the
configuration files from the server and modify them.



The only problem with using the above Apache configuration locally
is the DNS wildcard. Unless your desktop is assigned a hostname by your
network's DNS server and you can set the wildcard there, you will have
to make do with your localhost address. You can install dnsmasq
to act as a local caching DNS server and put the wildcard on your own
machine. As a bonus, the DNS caching can also speed up your web
browsing (hat-tip to Carthik).
If you want, you can replace localhost with another name (like your
hostname) in the commands below. The commands below are for Debian
Lenny, but should be similar on other distributions. Let's start my
installing dnsmasq.



  1. # apt-get install dnsmasq


Now we edit /etc/dnsmasq.conf So that it listens on 127.0.0.1 for our DNS requests and tell it to point all subdomains of localhost to 127.0.0.1. Near line 92 you will find the listen-address configuration, which tells dnsmasq to listen for DNS requests. Add the following line:

  1. listen-address=127.0.0.1


You can force domains to resolve to a certain IP with the address
directive, which you find near line 63. Add the following line to make
localhost have all it's subdomains pointing to 127.0.0.1:



  1. address=/localhost/127.0.0.1


Most likely your machine connects to the network via DHCP and gets
it's nameservers from the DHCP server. We need to configure DHCP so
that it always asks the local dnsmasq server first before trying the
other DNS servers. Open up /etc/dhcp3/dhclient.conf and uncomment the following line:



  1. prepend domain-name-servers 127.0.0.1;


The next time you connect to the network, the DHCP client will add 127.0.0.1 as a nameserver to /etc/resolv.conf,
before the other nameservers. If you do not want to reconnect to the
network to get this change, you can add it manually for now. Open up /etc/resolv.conf and add the following line before the nameserver directives, but after the search directive:



  1. nameserver 127.0.0.1


Restart dnsmasq for the changes to take effect:



  1. # /etc/init.d/dnsmasq restart
  2. Restarting DNS forwarder and DHCP server: dnsmasq.


Now you can configure Apache according to the first part of this article, replacing dev.example.org with localhost. Do not forget to remove Apache's default virtual host, which also listens on localhost.



  1. # rm /etc/apache2/sites-enabled/001-default


Reload Apache and now you can simply make a checkout of your website
to your local machine and immediately view it in your browser by going
to my-working-copy.localhost. Happy coding!

References


  1. http://en.wikipedia.org/wiki/Wildcard_DNS_record
  2. http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
  3. http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/
  4. http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/
  5. http://www.jejik.com/articles/2008/08/easily_develop_and_deploy_web_applications_from_subversion/#18

Wednesday, February 17, 2010

Install Subversion on CentOS 5 with Apache

SkyHi @ Wednesday, February 17, 2010

Setup Subversion and Trac on CentOS 5

Recently I set up a virtual server to use as a development machine. It runs on CentOS 5 and hosts several Subversion repositories with associated Trac projects.
There are many guides and plenty of help on the net to help you setup such a system. However, when I tried to do it I came across a few problems and I hope this post may help at least a few people trying to do the same as me. I am not going to rewrite the great tutorials out there, I will just point you to them and note what things I did differently.
This ‘guide’ should get you from a fresh install of CentOS 5 linux to one or more working Subversion (SVN) repositories and associated Trac wiki’s. Apache/WebDAV is used as the network layer. I have only tested this on a fresh install of CentOS 5.

The Environment

I am aiming for the following:
  • CentOS 5, SVN installed. Apache2 as the network layer using mod_dav_svn.
  • Trac running on Apache with mod_python
  • SVN repositories located at: /srv/svn (e.g. /srv/svn/my-project), accessible via http://server/svn/my-project
  • Trac projects located at: /srv/trac (e.g /srv/trac/my-project) accessible via http://server/trac/my-project

How I did it

Not all the steps are vital (probably) but this is how I got it working. Feel free to skip any non-relevant steps (i.e. there is probably no need for a fresh install). Replace any occurence of with the name of your first project.
1. Fresh install of CentOS. I followed most of the Perfect Setup Guide, except the mail and ISPConfig stuff. The important part is setting up the Apache2 web server.
2. Make sure SVN and mod_dav_svn are installed. As root:
yum install subversion mod_dav_svn
vim /etc/httpd/conf/httpd.conf
If the following two lines are not present, add them:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
3. Install Trac: Follow Nick’s guide with the alternative Clearsilver installation below. Skip the Apache Configuration part.
Follow all of parts 1 and 2. Instead of part 3 do:
wget http://dag.wieers.com/rpm/packages/clearsilver/clearsilver-0.10.4-1.el5.rf.i386.rpm
rpm -i clearsilver-0.10.4-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/clearsilver/python-clearsilver-0.10.4-1.el5.rf.i386.rpm
rpm -i python-clearsilver-0.10.4-1.el5.rf.i386.rpm
Continue with parts 4.1 and 4.2 of Nick’s guide. Remember, leave out Apache configuration section.
4. Create your first SVN Repository:
svnadmin create --fs-type fsfs /srv/svn/
5. Initialise a Trac project for your new repository:
trac-admin /srv/trac/ initenv
For the trac-admin command use the defaults if not sure, giving a descriptive name for the project. The `Path to repository` is: /srv/svn/.
6. Set the correct file permissions for apache
chown -R apache.apache /srv/svn/
chown -R apache.apache /srv/trac/
7. Tell apache where to find the new repository. Here we create an additional Apache configuration file specifically for the SVN repositories.
vim /etc/httpd/conf.d/subversion.conf
Add the following directive:
>
 DAV svn
 SVNPath /srv/svn/
 AuthType Basic
 AuthName " Repository"
 AuthzSVNAccessFile /srv/svn/svn-acl-conf
 AuthUserFile /srv/svn/.htpasswd
 Require valid-user
8. Add a repository user:
touch /srv/svn/.htpasswd
htpasswd -m /srv/svn/.htpasswd 
9. Create the Access Control List for the SVN Repository
vim /srv/svn/svn-acl-conf
Add the following directives:
[:/]
 =  rw
Where represents the username of the repository user you created earlier.
10. Tell apache where to find the new Trac project. Here we create an additional Apache configuration file specifically for the Trac projects.
vim /etc/httpd/conf.d/trac.conf
Add the following directives:
>
 SetHandler mod_python
 PythonHandler trac.web.modpython_frontend
 PythonOption TracEnv /srv/trac/
 PythonOption TracUriRoot /trac/


/login">
 AuthType Basic
 AuthName "trac"
 AuthUserFile /srv/trac/.htpasswd
 Require valid-user
11. Add a Trac user:
touch /srv/trac/.htpasswd
htpasswd -m /srv/trac/.htpasswd 
12. Give admin permissions to the Trac user you just created:
trac-admin /srv/trac/ permission add  TRAC_ADMIN
Where represents the username of the Trac user you just created.
13. Restart Apache:
service httpd restart
You should now have SVN and Trac installed. You will have an SVN repository setup (http://server/svn/) and the Trac wiki (http://server/trac/) associated with the repository.
Please let me know if this helped you. If you come across any problems I will be happy to try and help.


Official guide: http://svnbook.red-bean.com/nightly/en/svn.serverconfig.httpd.html
Here is a good place to start: http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06...
Also: http://wiki.centos.org/HowTos/Subversion
http://drup.org/install-subversion-centos-5-apache





Friday, September 25, 2009

mod_security subversion conflict

SkyHi @ Friday, September 25, 2009
Trying to check out an SVN repository is answered with a '400 Bad Request'

Error: PROPFIND request failed on '/repos/myproject/!svn/vcc/default'
Error: PROPFIND of '/repos/myproject/!svn/vcc/default':
400 Bad Request (https://name.ofmyserver.com)


http://troublesdeath.blogspot.com/

Tuesday, August 18, 2009

Upgrading Subversion to 1.5 on CentOS 5.2 Using Yum

SkyHi @ Tuesday, August 18, 2009
Irakli:

Default CentOS 5.2 yum repositories are still on Sybversion 1.4.x branch, so if you need the latest Subversion client, you are out of luck... or not, if you read this blog post :) This quick tutorial will show you how to upgrade in less than 5 minutes.

We will use RPMForge repos for the upgrade.

* Download and install proper RPMForge repo RPM for your server architecture (64bit or 32bit) from RPMForge website.
* Edit /etc/yum.repos.d/rpmforge.repo and change enabled=1 to "0". We do not want this repo to be enabled by default, because an accidental "svn update" will update all your packages to bleeding-edge, test-quality versions. RPMForge has many experimental rpms.
* Run: yum --enablerepo=rpmforge check-update subversion and make sure the version of subversion you are looking for is available. It should show you something like:

rpmforge 100% |=========================| 1.1 kB 00:00
subversion.x86_64 1.5.5-0.1.el5.rf rpmforge

* Check for existing subversion clients:

# rpm -qa | grep -i subversion
subversion-1.4.2-2.el5
subversion-1.4.2-2.el5

* Apparently there're two rpms installed (happens sometimes) so we need to add special flag to rpm -evf to safely remove it:

rpm -evf --allmatches subversion-1.4.2-2.el5

* Obviously, in your case there may not be previous installation or the version may be different.
* Run install:

yum --enablerepo=rpmforge --disablerepo=base install subversion

Please note that we are enabling rpmforge repo and disabling "base" repo that has 1.4.x version of Subversion, since yum would try to install it, as well. If yum finds other repos with 1.4.x, you may need to disable them as well.

cheers

Git and subversion setup on CentOS 5

SkyHi @ Tuesday, August 18, 2009
http://www.lamolabs.org/blog/401/git-and-subversion-setup-on-centos-5/

Subversion on CentOS

SkyHi @ Tuesday, August 18, 2009
Subversion isn't just for coders and programmers...I know because I'm not one. I've begun to use it lately for many things, such as, backing up Nagios configurations, documents, and pretty much anything text based. I don't know why I didn't start using it sooner, but none the less, here I am. This document quickly explains how to install, configure, and use subversion locally, as well as across Apache on a network. For complete and complex configurations and installations seek the documentation provided. There is plenty of well written documentation on the subject, that far exceeds my knowlegde of the tool. This just helps get you started quickly, for those like me that just like to jump in head first into new things.

Contents

1. System
2. References
3. Installation
4. Configurations
5. Using Subversion
6. Access control lists
7. Afterthought
8. Further reading

1. System

CentOS 4.x/RHEL 4
CentOS 5.1/RHEL 5

2. References

Subversion: http://subversion.tigris.org/
Version Control with Subversion: http://svnbook.red-bean.com/

3. Installation

[root@lucifer ~]# yum install mod_dav_svn subversion

The first thing to do is to install the packages I mentioned above. If you don't have Apache installed already, it'll go ahead and drag that down as well.

When you install from yum, there's a longer list than the two packages above that will automatically resolve themselves. Some other things will be installed automatically. Depending on your packages, your mileage may vary.

4. Configurations

4.1. Apache

Before you delve into the deep end, you need to ensure Apache is set up first. I'm assuming this is a virgin installation, so if you already have Apache things going...be careful what you change. I'm also going to explain setting this up with basic password protection. You can easily let this out, however, if you want to allow access to the repos from everyone.

First thing is make sure you open up /etc/httpd/conf/httpd.conf and at least change the ServerName directive. If you need more help or more complex configurations, then consult the Apache docs please.

[root@lucifer ~] vim /etc/httpd/conf/httpd.conf -- Edit what you need and save the file
[root@lucifer ~] service httpd start
[root@lucifer ~] chkconfig httpd on

Browse to your machine on the network and see if you get your test page, which you should: http://yourmachine. Working? Great, let's move along to more fun things.

4.2. Subversion's Apache configs

The next step is to setup some settings within Apache so Subversion and Apache play nice together. Get yourself to the example configuration file Subversion installed for you.

[root@lucifer ~] cd /etc/httpd/conf.d/
[root@lucifer ~] vim subversion.conf

# Make sure you uncomment the following if they are commented out
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

# Add the following to allow a basic authentication and point Apache to where the actual
# repository resides.
<Location /repos>
DAV svn
SVNPath /var/www/svn/repos
AuthType Basic
AuthName "Subversion repos"
AuthUserFile /etc/svn-auth-conf
Require valid-user
</Location>

The location is what Apache will pass in the URL bar. For instance: http://yourmachine/repos points to the SVNPath that you have specified. My examples are just that, so feel free to put things where you want. Make sure you save the file when you are finished editing.

Next we have to actually create the password file that you specified in the previous step. Initially you'll use the -cm arguments. This creates the file and also encrypts the password with MD5. If you need to add users make sure you simply use the -m flag, and not the -c after the initial creation.

[root@lucifer ~] htpasswd -cm /etc/svn-auth-conf yourusername
New password:
Re-type new password:
Adding password for user yourusername
[root@lucifer ~] htpasswd -m /etc/svn-auth-conf anotherusername
New password:
Re-type new password:
Adding password for user anotherusername

4.3. Configure your repository

The next thing you need to do is to create the actual repository from which you will check in and out your files. This is simple to do with some of the included svn tools.

[root@lucifer ~] cd /var/www/ -- Or wherever you placed your path above
[root@lucifer ~] mkdir svn
[root@lucifer ~] cd svn
[root@lucifer ~] svnadmin create repos
[root@lucifer ~] chown -R apache.apache repos
[root@lucifer ~] service httpd restart

Go test out whether or not you can access your repository from a web browser: http://yourmachine/repos. You should get a popup box asking for a username and password. If so, type in your credentials and you should be displayed with a Revision 0:/ page. If so, that's it for setting up a repo. If you want multiple repos, check out the docs from the links provides above. This sets up one repository and shows you how to start using them. Speaking of, let's move on to just that.

5. Using Subversion

5.1. Layout Your Repo

If all went well above, you're now ready to start using the repository that you created. Subversions svn tool is the command line client that you will use to talk to the database. To see the use of the tool:

[root@lucifer ~] svn --help

The most common arguments you will most likely be using are: svn import, svn commit (ci), and svn checkout (co). With these you will initially import files into your repository with import, you'll check them out to work on them with checkout, and you'll commit the changes back into the database with commit. It's pretty simple once you see them in use a few times.

Before I continue I'd like to explain about directory structure layouts. Almost all of the documentation talks about creating a certain layout for your directories. They specifically mention about making sure you have a branches, tags, and trunk underneath the root directory structure, where trunk holds all your files. For instance:

.
|-- project1
| |-- branches
| |-- tags
| `-- trunk
`-- project2
|-- branches
|-- tags
`-- trunk

The book explains why in a bit more detail, and I mainly don't bother using this type of layout...because I'm not doing coding and maintaining "projects" per se. I'm mainly using it to store configuration files, and text items that aren't as complex. Set things up for whatever works for you.

As an example, I'm going to just create some dummy directories and throw some files in them. This is from the actual SVN server. Play along.

[root@lucifer ~] cd /tmp
[root@lucifer ~] mkdir mytestproj
[root@lucifer ~] cd mytestproj
[root@lucifer ~] mkdir configurations options main
[root@lucifer ~] vim configurations/testconf1.cfg -- Add whatever you want to these files.
[root@lucifer ~] vim options/testopts1.cfg
[root@lucifer ~] vim main/mainfile1.cfg

Keep in mind that you can layout anything anyway you'd like. Once you have the initial layout of what you want, let's go ahead and import this up to Subversion.

5.2. Importing

[root@lucifer ~] svn import /tmp/mytestproj/ file:///var/www/svn/repos/mytestproj -m "Initial repository layout for mytestproj"
Adding /tmp/mytestproj/main
Adding /tmp/mytestproj/main/mainfile1.cfg
Adding /tmp/mytestproj/configurations
Adding /tmp/mytestproj/configurations/testconf1.cfg
Adding /tmp/mytestproj/options
Adding /tmp/mytestproj/options/testopts1.cfg

5.3. Checking Out

Now, just to check it out across the web browser: http://yourmachine/repos. You'll get whatever you have imported showing up to peruse. Once you upload your original layout from the local SVN server, you're now free to use it remotely on another machine. As long as you are connecting to the Subversion server with the user account(s) that you created earlier. Let's give it a shot.

[me@mylappy ~] cd /tmp
[me@mylappy ~] svn co http://yoursvnserver/repos/mytestproj
Authentication realm: <http://yoursvnserver:80> Subversion repos
Password for 'youruser':
A mytestproj/main
A mytestproj/main/mainfile1.cfg
A mytestproj/configurations
A mytestproj/configurations/testconf1.cfg
A mytestproj/options
A mytestproj/options/testopts1.cfg
Checked out revision 1.

5.4. Edit & Commit

As you can see, you've checked out revision 1 from the Subversion server. Now you can edit some things and commit the changes back to the Subversion server.

[me@mylappy ~] cd mytestproj
[me@mylappy ~] vim configurations/testconf1.cfg -- Add or delete something and save.
[me@mylappy ~] svn commit -m "Added a line to testconf1.cfg."
Sending configurations/testconf1.cfg
Transmitting file data .
Committed revision 2.

The nice thing about this then, is that you can delete all of the directories that you just checked out on your machine. The only reason you checked them out, was to edit them, and then send them back up the line. Web browse to your server to check out the different files.

5.5. Adding/Deleting Items

Now this is all fine and dandy, but how do you add more files to an already existing repo directory? Easy, with the add argument. Go ahead and checkout your latest and greatest, copy a file over to a directory, add, then commit the changes.

[me@mylappy ~] svn co http://yoursvnserver/repos/mytestproj
A mytestproj/main
A mytestproj/main/mainfile1.cfg
A mytestproj/configurations
A mytestproj/configurations/testconf1.cfg
A mytestproj/options
A mytestproj/options/testopts1.cfg
Checked out revision 2.

[me@mylappy ~] cd mytestproj
[me@mylappy ~] cp /etc/yum.repos.d/CentOS-Base.repo configurations/
[me@mylappy ~] svn add configurations/CentOS-Base.repo
A configurations/CentOS-Base.repo

[me@mylappy ~] svn commit -m "Added the CentOS Yum repo file."
Adding configurations/CentOS-Base.repo
Transmitting file data .
Committed revision 3.

To delete items simply use delete instead of add. Commit your changes back up, and you're good to go. It's as simple as that. Go back over to your web browser again and you'll notice the revision number should say 3. You'll be able to click through the files to pick our your differences as well.

5.6. Reverting Back

Ok, this is all great but how do I revert back to an older revision...isn't this the point of Subversion? Yep, it's easy. If you're not sure as to what revision you're at...check out the log command. This is why you put a message in every commit. Short and to the point, but enough information to ring a bell that you perhaps forgot about.

[me@mylappy ~] svn log http://yoursvnserver/repos -- For the entire repository
[me@mylappy ~] svn log http://yoursvnserver/repos/mytestproj -- For the specific project

You'll get a nice complete list of revision numbers along with the comments, like I mentioned above. This allows you to pick which revision you want to check back out now.

[me@mylappy ~] svn co -r 1 http://yoursvnserver/repos/mytestproj

This command will drag down revision number 1.

6. Access control lists

Usually, you don't want to give every user access to every repository. You can restrict repository access per user by using ACLs. ACLs can be enabled with the AuthzSVNAccessFile file option, which takes a file name as its parameter. For instance:

AuthzSVNAccessFile /etc/svn-acl-conf

You can add this to the relevant Location section:


DAV svn
SVNParentPath /var/www/svn/repos
AuthzSVNAccessFile /etc/svn-acl-conf
AuthType Basic
AuthName "Subversion repos"
AuthUserFile /etc/svn-auth-conf
Require valid-user


You can then create /etc/svn-acl-conf. This file consist of sections of the following form:

[reponame:repopath]
user = access

Where access can be r (read), rw (read-write), or empty (no access at all). The default ACL is to give users no access to a repository. Suppose that there is a repository named framework to which you would like to give john read access, and joe read and write access. You could then add the following section:

[framework:/]
john = r
joe = rw

It is also possible to create groups in a section named groups, groups are then prefixed with the 'at' sign (@) in the access control lists. For instance:

[groups]
staff = joe, george

[framework:/]
john = r
@staff = rw

If you would like to make all repositories readable to all users, you can add a section for the root directory of every repository:

[/]
* = r

7. Afterthought

This is only a very very small part of the power of what Subversion can offer you. This quick guide will get you going, and show you how to use it a bit to understand how it's working. You can do all kinds of things with the Subversion tools, so make sure you check the docs out to learn about different options that might assist you in your tasks. Also remember that the Apache installation might be overkill for your needs. You can completely use the Subversion tools locally on a machine by specifying file:///path/to/repo, instead of my examples across Apache as http://yoursvnserver/repos/whatever. From what I read, many folks use it on their local boxes just to keep their minds straight for huge projects and configurations file. Good luck

8. Further reading

*

Version Control with Subversion