11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Server ConfigurationNote that if mod_dav was compiled as a shared object (instead of statically linked directlyto the httpd binary), you'll need a similar LoadModule statement for it, too. Be sure that itcomes before the mod_dav_svn line:LoadModule dav_moduleLoadModule dav_svn_modulemodules/mod_dav.somodules/mod_dav_svn.soAt a later location in your configuration file, you now need to tell Apache where you keepyour <strong>Subversion</strong> repository (or repositories). The Location directive has an XML-likenotation, starting <strong>with</strong> an opening tag and ending <strong>with</strong> a closing tag, <strong>with</strong> various other configurationdirectives in the middle. The purpose of the Location directive is to instructApache to do something special when handling requests that are directed at a given URLor one of its children. In the case of <strong>Subversion</strong>, you want Apache to simply hand off supportfor URLs that point at versioned resources to the DAV layer. You can instruct Apacheto delegate the handling of all URLs whose path portions (the part of the URL that followsthe server's name and the optional port number) begin <strong>with</strong> /repos/ to a DAV providerwhose repository is located at /var/svn/repository using the following httpd.confsyntax:DAV svnSVNPath /var/svn/repositoryIf you plan to support multiple <strong>Subversion</strong> repositories that will reside in the same parentdirectory on your local disk, you can use an alternative directive—SVNParentPath—to indicatethat common parent directory. For example, if you know you will be creating multiple<strong>Subversion</strong> repositories in a directory /var/svn that would be accessed via URLs such ashttp://my.server.com/svn/repos1, http://my.server.com/svn/repos2, andso on, you could use the httpd.conf configuration syntax in the following example:DAV svn# any "/svn/foo" URL will map to a repository /var/svn/fooSVNParentPath /var/svnUsing the previous syntax, Apache will delegate the handling of all URLs whose path portionsbegin <strong>with</strong> /svn/ to the <strong>Subversion</strong> DAV provider, which will then assume that anyitems in the directory specified by the SVNParentPath directive are actually <strong>Subversion</strong>repositories. This is a particularly convenient syntax in that, unlike the use of the SVNPathdirective, you don't have to restart Apache to create and network new repositories.Be sure that when you define your new Location, it doesn't overlap <strong>with</strong> other exportedlocations. For example, if your main DocumentRoot is exported to /www, do not export a<strong>Subversion</strong> repository in . If a request comes in for the URI /www/repos/foo.c, Apache won't know whether to look for a file repos/foo.c in theDocumentRoot, or whether to delegate mod_dav_svn to return foo.c from the <strong>Subversion</strong>repository. The result is often an error from the server of the form 301 Moved Permanently.Server Names and the COPY Request<strong>Subversion</strong> makes use of the COPY request type to perform server-side copies of files171

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!