Subversion on Ubuntu 8.10
Access methods
- file:/// - direct access on local machine
- http:// - using WebDAV
- https:// - SSL-encrypted
- svn:// - access via svnserve machine
- svn+ssh:// - SSH-tunneled
- Install the necessary packages:
$ sudo apt-get install apache2 subversion libapache2-svn
- Create the group (to contain subversion users)
$ sudo groupadd subversion
- Create the repository folders
$ sudo mkdir /srv/svn
$ cd !$
$ sudo mkdir new_project
$ sudo chown -R www-data:subversion new_project
$ sudo chmod g+rws new_project - Tell subversion to create subversion repository. I"t will create new files.
$ sudo svnadmin create /srv/svn/new_project
- (Optional) If you want to use the WebDAV (http, https) methods, you will need to repeat the last two commands in § 3, and apply these to the new files generated by § 4.
$ sudo chown -R www-data:subversion new_project
$ sudo chmod -R g+rws new_project
- Now, edit the /etc/apache2/mods-available/dav_svn.conf file, and add the following lines:
<Location "/svn/new_project">
You may also point it to the "root" subversion folder /srv/svn if you wish to view the repositories of all projects that you are hosting.
DAV svn
SVNPath /srv/svn/new_project
AuthType Basic
AuthName "My Project Subversion Repository"
AuthUserFile /etc/subversion/passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location> - Restart the web server.
$ sudo /etc/init.d/apache2 restart
- (Optional) If you want to use WebDAV with SSL, simply follow standard Apache SSL certificate use.
- Add the subversion users.
$ sudo htpasswd -c /etc/subversion/passwd first_user
$ sudo htpasswd /etc/subversion/passwd subsequent_users - Check if the passwd file exists.
$ cat /etc/subversion/passwd
- Check if we can access the repository.
$ svn co http://hostname/svn/new_project new_project \
--username first_user
- Edit the configuration file, /srv/svn/new_project/conf/svnserve.conf
- Uncomment the these lines in the configuration file:
[general]
N.B. These lines must not contain spaces before them.
password-db = passwd - Edit the passwd file in the same folder and add a new user using this syntax:
username = password
- Now, run the svnserver with this command:
$ sudo svnserve -d --foreground -r /srv/svn
- Now, try to access the SVN using:
$ svn co svn://hostname/new_project new_project \
--username first_user - You can now use SVN sub-commands to add/edit/delete files here.
- After enabling the SVN protocol above, enable SSH on the SVN server and create accounts for people who are given access.
- Check the access to the SVN using this command:
$ svn co svn+ssh://hostname/srv/svn/new_project new_project \
--username first_user N.B. You must use the full path of the SVN repository.
Subversion, Ubuntu Documentation, accessed 2009 January 23.
Labels: apache, ssl, subversion, webdav
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home