yum install -y subversion mod_dav_svn
groupadd svn
useradd svn
mkdir -pm700 /var/svn/projects
svnadmin create /var/svn/projects/test
chown -R svn:svn /var/svn/projects
mkdir -p /var/www/projects.example.com/httpdocs
edit httpd.conf
Listen 8080
LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Change the user and Group from apache:apache to svn:svn
User svn
Group svn
Add a virtual host.
ServerName projects.example.com
DocumentRoot /var/www/projects/httpdocs
DAV svn
SVNPath /var/svn/projects/test
AuthType Basic
AuthName "Test Subversion repository"
AuthUserFile /var/svn/projects/test/conf/users
Require valid-user
Order allow,deny
Allow from all
create a password for the user svnclient
htpasswd -cm /var/svn/projects/test/conf/users svnclient
edit lighttpd conf file
nano /etc/lighttpd/lighttpd.conf
mod_proxy
add in a redirect for svn requests
$HTTP["host"] == "svn.projects.com" {
server.document-root = "/var/www/projects/httpdocs"
proxy.server = (
"/svn/test" => (("host" => "127.0.0.1", "port" => 8080))
)
}
restart apache and lighttpd
test the svn client
svn import /var/www/projects/httpdocs file:///var/svn/projects/test -m "Initial import"
svn checkout --username svnclient http://projects.yoursite.com/svn/test
cd test
svn mkdir testbranches tags trunk
svn commit
to add a new repository to the SVN
svnadmin create /var/svn/projects/newdir
chown -R svn:svn /var/svn/projects
Then add a new location in the virtual host file
DAV svn
SVNPath /var/svn/projects/newdir
AuthType Basic
AuthName "Test Subversion repository"
AuthUserFile /var/svn/projects/test/conf/users
Require valid-user
Order allow,deny
Allow from all
Comments are closed.