11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Server Configurationand deduce what the client was doing—most operations look like a series of cryptic PROP-PATCH, GET, PUT, and REPORT requests. To make things worse, many client operationssend nearly identical series of requests, so it's even harder to tell them apart.mod_dav_svn, however, can come to your aid. By activating an “operational logging” feature,you can ask mod_dav_svn to create a separate log file describing what sort of highleveloperations your clients are performing.To do this, you need to make use of Apache's CustomLog directive (which is explained inmore detail in Apache's own documentation). Be sure to invoke this directive outside your<strong>Subversion</strong> Location block:DAV svn…CustomLog logs/svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTIONIn this example, we're asking Apache to create a special logfile, svn_logfile, in thestandard Apache logs directory. The %t and %u variables are replaced by the time andusername of the request, respectively. The really important parts are the two instances ofSVN-ACTION. When Apache sees that variable, it substitutes the value of the SVN-ACTION environment variable, which is automatically set by mod_dav_svn whenever itdetects a high-level client action.So, instead of having to interpret a traditional access_log like this:[26/Jan/2007:22:25:29 -0600] "PROPFIND /svn/calc/!svn/vcc/default HTTP/1.1" 207[26/Jan/2007:22:25:29 -0600] "PROPFIND /svn/calc/!svn/bln/59 HTTP/1.1" 207 449[26/Jan/2007:22:25:29 -0600] "PROPFIND /svn/calc HTTP/1.1" 207 647[26/Jan/2007:22:25:29 -0600] "REPORT /svn/calc/!svn/vcc/default HTTP/1.1" 200 60[26/Jan/2007:22:25:31 -0600] "OPTIONS /svn/calc HTTP/1.1" 200 188[26/Jan/2007:22:25:31 -0600] "MKACTIVITY /svn/calc/!svn/act/e6035ef7-5df0-4ac0-b…you can peruse a much more intelligible svn_logfile like this:[26/Jan/2007:22:24:20 -0600] - get-dir /tags r1729 props[26/Jan/2007:22:24:27 -0600] - update /trunk r1729 depth=infinity send-copyfrom-[26/Jan/2007:22:25:29 -0600] - status /trunk/foo r1729 depth=infinity[26/Jan/2007:22:25:31 -0600] sally commit r1730For an exhaustive list of all actions logged, see the section called “High-level logging”.Write-through proxyingOne of the nice advantages of using Apache as a <strong>Subversion</strong> server is that it can be set upfor simple replication. For example, suppose that your team is distributed across four officesaround the globe. The <strong>Subversion</strong> repository can exist only in one of those offices,which means the other three offices will not enjoy accessing it—they're likely to experiencesignificantly slower traffic and response times when updating and committing code. Apowerful solution is to set up a system consisting of one master Apache server and severalslave Apache servers. If you place a slave server in each office, users can check out aworking copy from whichever slave is closest to them. All read requests go to their localslave. Write requests get automatically routed to the single master server. When the commitcompletes, the master then automatically “pushes” the new revision to each slave serverusing the svnsync replication tool.182

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

Saved successfully!

Ooh no, something went wrong!