红联Linux门户
Linux帮助

Subversion over Apache 2 on Ubuntu

发布时间:2008-05-26 00:53:42来源:红联作者:zhania
If your one of my regular readers (ha!), then you’ll know I’m starting a Group Project for University. We have 7 members in the group and without some sort of version control - managing the code we’re about to produce would be hell! So I’m setting up Subversion on my home server as a repository. Following are the steps I used to set-up Subversion over Apache 2 on my Ubuntu server.

I’m assuming you have Apache 2 already set-up. The only extra packages to download and install are subversion and libapache2-svn.

sudo apt-get install subversion libapache2-svnThis will download and install Subversion and the SVN module for Apache 2. The module itself uses WebDAV to transmit files between Subversion - so this means everything can go across port 80 without the hassle of having to worry about a firewall.

The install should automatically enable the module, but just to check:

sudo a2enmod dav_svnIt should come up saying it’s already enabled. If not, it will enable it for you.

You’ll need to configure Apache now:

sudo nano /etc/apache2/mods-enabled/dav_svn.confEdit the file to look something like this:

DAV svn SVNPath /home/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-userChange /home/svn to whatever the location of your repository is. If you haven’t created one yet, then do:

sudo mkdir /home/svnsudo svnadmin create /home/svnNow, you need to make Apache the owner of the repository:

sudo chown -R www-data /home/svnTo secure Subversion, do the following to create a password file:

sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd bobReplace bob with whatever username you want to use, and then when prompted enter a password.

Now restart Apache:

sudo /etc/init.d/apache2 restartThat should now all be set-up. You can try it by visiting your server http://you.server/svn. You should get a username/password dialog which you enter the details you created.
文章评论

共有 0 条评论