How-To: Set up SVN with Apache2 in Linux (Ubuntu)

How-To: Set up SVN with Apache2 in Linux (Ubuntu)

Initially I didn’t plan on writing anything up about this, since its pretty basic to setup. But I ran into a slight problem, which I imagine others might run into also. I guess most would have Apache running already, so all that is needed is SVN:

Code:
> apt-get install subversion libapache2-svn

Say you have a domain already set up, call it abc.com. You want to be able to checkout a repository from abc.com/svn.

Open the following file (/etc/apache2/mods-available/dav_svn.conf) in an editor and follow the instructions. In the most basic form (with no authentication) you’ll have something like this when your done:

Code:
< Location /abc.com/svn >
DAV svn
SVNPath /svn
< /Location>

Inside the < Location /abc.com/svn > that path must point to a directory in your web server which does NOT exist. abc.com will exist, but make sure svn doesn’t. The SVNPath will point to the actual repository which MUST be outside your web server space.

This way, if you go to a browser and type: http://www.abc.com/svn nothing will show up, but when you checkout your repository, you will be re-directed to the actual svn directory (in this case /svn).

Now create the SVN repository, in directory /svn

Code:
> svnadmin create /svn

Be sure to change the permissions on this directory, so the web server can write to the folder:

Code:
> chown -R www-data /svn

Restart Apache2:

Code:
> /etc/init.d/apache2 -k restart

Now from a remote computer, you should be able to type:

Code:
svn co http://xxx.xxx.xxx.xx/abc.com/svn < name >

(were xxx.xxx.xxx.xxx is your server ip and name is what you want to call the local folder)

你可能感兴趣的:(apache,linux,SVN,ubuntu,UP,subversion)