ApacheSubversionRecipe » History » Revision 1
Revision 1/16
| Next »
admin, 2006-03-07 15:49
Inital revision
This recipe shows how to setup an example subversion repository using Apache 2.2, mod_dav_svn, and lighttpd 1.4.11.
We will create a subversion repository hosted at the example address: `http://projects.example.com/svn/test/`.
Before you continue, make sure you have installed:
- Apache (running at port 8080)
- Subversion (including mod_dav_svn)
- Lighttpd 1.4.11
- An daemon system account with user and group id `svn`
=== Create test repository ===
Create the subversion repository, and set its owner and group to `svn`:
{{{
mkdir -pm700 /var/svn/projects.example.com
svnadmin create /var/svn/projects.example.com/test
chown -R svn:svn /var/svn/projects.example.com
}}}
=== Setup Apache ===
Create the directory for the `projects.example.com` domain public files:
{{{
mkdir -p /var/www/projects.example.com/httpdocs
}}}
Setup a virtual host inside `httpd.conf`:
{{{
<VirtualHost *:8080>
ServerName projects.example.com
DocumentRoot /var/www/projects.example.com/httpdocs
<Location /svn/test>
DAV svn
SVNPath /var/svn/projects.example.com/test
AuthType Basic
AuthName "Test Subversion repository"
AuthUserFile /var/svn/projects.example.com/test/conf/users
Require valid-user
</Location>
</VirtualHost>
}}}
Create a users database for the `example` user:
{{{
htpasswd -cm /var/svn/projects.example.com/test/conf/users example
}}}
=== Setup Lighttpd ===
Setup LightTPD to use mod_proxy to proxy requests to Apache at port 8080:
{{{
$HTTP["host"] == "projects.example.com" {
server.document-root = "/var/www/projects.example.com/httpdocs"
proxy.server = (
"/svn/test" => (("host" => "127.0.0.1", "port" => 8080))
)
}
}}}
=== Test the setup ===
Restart Apache and Lighttpd.
Checkout the test repository, and commit some stuff:
{{{
svn checkout --username example http://projects.example.com/svn/test
cd test
svn mkdir testbranches tags trunk
svn commit
}}}
And you should be up and running!
If you have any question, contact us using our Forum!
Updated by admin over 18 years ago · 1 revisions