There are many configurations for svn, here a some short instuctions to get a basic svn repository available over http.
- Install required packages:
apt-get install subversion apache2 libapache2-svn
- Create an Directory-Structure:
mkdir -p /var/svn/repos/
- Create a Repository:
cd /var/svn/repos/ svnadmin create --fs-type fsfs <your-repository>
- Now Create your Project-Struckture to import in the repository:
mkdir -p /tmp/myproject/trunk /tmp/myproject/tags /tmp/myproject/branches
- Import the Project to the Repository:
svn import /tmp/myproject file:///var/svn/repos/<your-repository> -m "initial import"
- Make it accesseable over http:
cd /etc/apache2/sites-available touch subversion.conf vim subversion.conf
- Now edit the empty file with this configuration:
NameVirtualHost *:80 <VirtualHost *:80> <Location /svn> ErrorDocument 404 default DAV svn SVNParentPath /var/svn/repos SVNListParentPath off Require valid-user AuthType Basic AuthName "subversion access" AuthUserFile /var/svn/.htpasswd AuthzSVNAccessFile /var/svn/authz </Location> </VirtualHost>
- enable dav_svn module for apache:
a2enmod dav_svn enable VHost configuration: a2ensite subversion.conf
- now restart the webserver:
/etc/init.d/apache2 restart
- Create an htpasswd:
htpasswd -c /var/svn/.htpasswd user
- Create the access control file for the repository:
touch /var/svn/authz
- edit the empty authz file:
vim /var/svn/authz
- Give read/write rights to for user:
[your-repository:/] user = rw Let's try to checkout the the repo over http: svn checkout http://your-server/svn/your-repository
No comments:
Post a Comment