I am working with a number of Ruby on Rails projects versioned with Subversion. Each time I checkout a new project into my workspace, I need to edit the Apache config so that it sees the project. Rails applications contain a public folder that the webserver needs to serve up. I would like to do the following:

Each time I checkout an SVN repo, I would like a subdomain to be created automatically. This does not need to be in the cpanel account (i.e., it could be added to the httpd.conf file directly). When I check out a repo to the directory: /home/user/projects/development/samplesvncheckout

I should be able to access it (since it is a Rails app, I would actually need to access /home/user/projects/development/samplesvncheckout/public) at samplesvncheckout.domain.com.

If I check the repo out as jeff-project then I should access it as jeff-project.domain.com. Or if I check it out as jeff_project then it should be accessed at jeffproject.domain.com (since I cannot use underscores in the domain).

Quite separately, I need to have another path:

/home/user/projects/production/newproject.com

When I checkout a repo to the production folder, I should be able to access it as newproject-live.domain.com.