1 ====================================== 2 INSTALLING SUBVERSION 3 A Quick Guide 4 ====================================== 5 6$LastChangedDate: 2015-07-26 23:03:10 +0000 (Sun, 26 Jul 2015) $ 7 8 9Contents: 10 11 I. INTRODUCTION 12 A. Audience 13 B. Dependency Overview 14 C. Dependencies in Detail 15 D. Documentation 16 17 II. INSTALLATION 18 A. Building from a Tarball 19 B. Building the Latest Source under Unix 20 C. Building under Unix in Different Directories 21 D. Installing from a Zip or Installer File under Windows 22 E. Building the Latest Source under Windows 23 24 III. BUILDING A SUBVERSION SERVER 25 A. Setting Up Apache 26 B. Making and Installing the Subversion Server 27 C. Configuring Apache for Subversion 28 D. Running and Testing 29 E. Alternative: 'svnserve' and ra_svn 30 31 IV. PLATFORM-SPECIFIC ISSUES 32 A. Windows XP 33 B. Mac OS X 34 35 V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA) 36 37 38 39I. INTRODUCTION 40 ============ 41 42 A. Audience 43 44 This document is written for people who intend to build 45 Subversion from source code. Normally, the only people who do 46 this are Subversion developers and package maintainers. 47 48 If neither of these labels fits you, we recommend you find an 49 appropriate binary package of Subversion and install that. 50 While the Subversion project doesn't officially release binary 51 packages, a number of volunteers have made such packages 52 available for different operating systems. Most Linux and BSD 53 distributions already have Subversion packages ready to go via 54 standard packaging channels, and other volunteers have built 55 'installers' for both Windows and OS X. Visit this page for 56 package links: 57 58 http://subversion.apache.org/packages.html 59 60 For those of you who still wish to build from source, Subversion 61 follows the Unix convention of "./configure && make", but it has 62 a number of dependencies. 63 64 65 B. Dependency Overview 66 67 You'll need the following build tools to compile Subversion: 68 69 * autoconf 2.59 or later (Unix only) 70 * libtool 1.4 or later (Unix only) 71 * a reasonable C compiler (gcc, Visual Studio, etc.) 72 73 74 Subversion also depends on the following third-party libraries: 75 76 * libapr and libapr-util (REQUIRED for client and server) 77 78 The Apache Portable Runtime (APR) library provides an 79 abstraction of operating-system level services such as file 80 and network I/O, memory management, and so on. It also 81 provides convenience routines for things like hashtables, 82 checksums, and argument processing. While it was originally 83 developed for the Apache HTTP server, APR is a standalone 84 library used by Subversion and other products. It is a 85 critical dependency for all of Subversion; it's the layer 86 that allows Subversion clients and servers to run on 87 different operating systems. 88 89 * SQLite (REQUIRED for client and server) 90 91 Subversion uses SQLite to manage some internal databases. 92 93 * libz (REQUIRED for client and server) 94 95 Subversion uses zlib for compressing binary differences. 96 These diff streams are used everywhere -- over the network, 97 in the repository, and in the client's working copy. 98 99 * libserf (OPTIONAL for client) 100 101 The Serf library allows the Subversion client to send HTTP 102 requests. This is necessary if you want your client to access 103 a repository served by the Apache HTTP server. There is an 104 alternate 'svnserve' server as well, though, and clients 105 automatically know how to speak the svnserve protocol. 106 Thus it's not strictly necessary for your client to be able 107 to speak HTTP... though we still recommend that your client 108 be built to speak both HTTP and svnserve protocols. 109 110 * OpenSSL (OPTIONAL for client and server) 111 112 OpenSSL enables your client to access SSL-encrypted https:// 113 URLs (using libserf) in addition to unencrypted http:// URLs. 114 To use SSL with Subversion's WebDAV server, Apache needs to be 115 compiled with OpenSSL as well. 116 117 * Berkeley DB (OPTIONAL for client and server) 118 119 There are two different repository 'back-end' 120 implementations. One implementation stores data in a flat 121 filesystem (known as FSFS); the other implementation stores 122 data in a Berkeley DB database (known as BDB). When you 123 create a repository, you have the option of specifying a 124 storage back-end. The Berkeley DB back-end will only be 125 available if the BDB libraries are discovered at compile 126 time. The Berkeley DB back-end has been deprecated and 127 is not recommend. 128 129 * libsasl (OPTIONAL for client and server) 130 131 If the Cyrus SASL library is detected at compile time, then 132 the svn client (and svnserve server) will be able to utilize 133 SASL to do various forms of authentication when speaking the 134 svnserve protocol. 135 136 * Python, Perl, Java, Ruby (OPTIONAL) 137 138 Subversion is mostly a collection of C libraries with 139 well-defined APIs, with a small collection of programs that 140 use the APIs. If you want to build Subversion API bindings 141 for other languages, you need to have those languages 142 available at build time. 143 144 * KDELibs, GNOME Keyring (OPTIONAL for client) 145 146 Subversion contains optional support for storing passwords in 147 KWallet (KDE 4) or GNOME Keyring. 148 149 * libmagic (OPTIONAL) 150 151 If the libmagic library is detected at compile time, 152 it will be used to determine mime-types of binary files 153 which are added to version control. Note that mime-types 154 configured via auto-props or the mime-types-file option 155 take precedence. 156 157 * Googlemock aka Gmock (OPTIONAL) 158 159 This optional package is used by the tests for Subversions' 160 C++ bindings. 161 162 163 C. Dependencies in Detail 164 165 Subversion depends on a number of third party tools and libraries. 166 Some of them are only required to run a Subversion server; others 167 are necessary just for a Subversion client. This section explains 168 what other tools and libraries will be required so that Subversion 169 can be built with the set of features you want. 170 171 On Unix systems, the './configure' script will tell you if you are 172 missing the correct version of any of the required libraries or 173 tools, so if you are in a real hurry to get building, you can skip 174 straight to section II. If you want to gather the pieces you will 175 need before starting out, however, you should read the following. 176 177 If you're just installing a Subversion client, the Subversion 178 team has created a script that downloads the minimal prerequisite 179 libraries (Apache Portable Runtime, Sqlite, and Zlib). The script, 180 'get-deps.sh', is available in the same directory as this file. 181 When run, it will place 'apr', 'apr-util', 'serf', 'zlib', and 182 'sqlite-amalgamation' directories directly into your unpacked Subversion 183 distribution. With the exception of sqlite-amalgamation, they will 184 still need to be configured, built and installed explicitly, and 185 Subversion's own configure script may need to be told where to find 186 them, if they were not installed in standard system locations. 187 188 Note: there are optional dependencies (such as openssl, swig, and httpd) 189 which get-deps.sh does not download. 190 191 Note: Because previous builds of Subversion may have installed older 192 versions of these libraries, you may want to run some of the cleanup 193 commands described in section II.B before installing the following. 194 195 196 1. Apache Portable Runtime 1.3 or newer (REQUIRED) 197 198 Whenever you want to build any part of Subversion, you need the 199 Apache Portable Runtime (APR) and the APR Utility (APR-util) 200 libraries. 201 202 203 **************************************************************** 204 ** IMPORTANT ISSUE ABOUT APR VERSIONS: READ THIS ** 205 ** IF UPGRADING FROM MUCH OLDER SUBVERSION ** 206 **************************************************************** 207 | | 208 | APR 0.9.X and 1.X are binary-incompatible. | 209 | | 210 | This means: | 211 | | 212 | - if you are already using Subversion with APR 0.9.X, and | 213 | then upgrade your libapr to 1.X without rebuilding | 214 | Subversion, things will break and segfault. | 215 | | 216 | - if your Subversion server libraries are linked to one | 217 | version of APR, but your Apache server is linked to a | 218 | different version, things will break and segfault. | 219 | | 220 | Subversion distribution dependencies: | 221 | ------------------------------------- | 222 | | 223 | For a long time, Subversion's main distribution contained | 224 | APR and APR-UTIL (both 0.9.x), plus a few other things that | 225 | we couldn't count on the installation system having. But | 226 | nowadays, Subversion's requirements are no longer exotic, | 227 | and so our main distribution contains just the Subversion | 228 | source code itself -- people compiling Subversion are | 229 | expected to either have the APR libraries already installed | 230 | on their system, or to be capable of fetching them easily. | 231 | | 232 | Note that it's *perfectly* safe to use APR 1.X from the | 233 | beginning. In fact, we recommend it. If you're building | 234 | Subversion for the first time, there's no compatibility | 235 | issue to worry about, so grab the latest version of APR. | 236 | | 237 | If you already have a Subversion installation using APR | 238 | 0.9.x, it's still possible to move to APR 1.X safely. Just | 239 | be sure to recompile Subversion (and Apache httpd if | 240 | necessary) after upgrading APR! | 241 |______________________________________________________________| 242 243 244 If you do not have a pre-installed APR and APR-util, you will need 245 to get these yourself: 246 247 http://apr.apache.org/download.cgi 248 249 On Unix systems, if you already have the APR libraries compiled and do 250 not wish to regenerate them from source code, then Subversion needs to 251 be able to find them. 252 253 There are a couple of options to "./configure" that tell it where 254 to look for the APR and APR-util libraries. By default it will try 255 to locate the libraries using apr-config and apu-config scripts. 256 These scripts provide all the relevant information for the APR and 257 APR-util installations. 258 259 If you want to specify the location of the APR library, you can use 260 the "--with-apr=" option of "./configure". It should be able to find 261 the apr-config script in the standard location under that directory 262 (e.g. ${prefix}/bin). 263 264 Similarly, you can specify the location of APR-util using the 265 "--with-apr-util=" option to "./configure". It will look for the 266 apu-config script relative to that directory. 267 268 For example, if you want to use the APR libraries you built 269 with the Apache httpd server, you could run: 270 271 $ ./configure --with-apr=/usr/local/apache2 \ 272 --with-apr-util=/usr/local/apache2 ... 273 274 Be sure to use a native Windows SVN client (as opposed to 275 Cygwin's version) so that the .dsp files get carriage-returns at 276 the ends of their lines. Otherwise Visual Studio will complain 277 that it doesn't recognize the .dsp files. 278 279 If you use APR libraries checked out from svn in an Unix 280 environment, you need to run the 'buildconf' script in each 281 library's directory, to regenerate the configure scripts and 282 other files required for compiling the libraries: 283 284 $ cd apr; ./buildconf; ./configure ...; make; make install; cd .. 285 286 $ cd apr-util; ./buildconf; ./configure ...; make; make install; cd .. 287 288 Configure build and install both libraries before running Subversion's 289 configure script. 290 291 292 2. Zlib (REQUIRED) 293 294 Subversion's binary-differencing engine depends on zlib for 295 compression. Most Unix systems have libz pre-installed, but 296 if you need it, you can get it from 297 298 http://www.zlib.net/ 299 300 301 3. autoconf 2.59 or newer (Unix only) 302 303 This is required only if you plan to build from the latest source 304 (see section II.B). Generally only developers would be doing this. 305 306 307 4. libtool 1.4 or newer (Unix only) 308 309 This is required only if you plan to build from the latest source 310 (see section II.B). 311 312 Note: Some systems (Solaris, for example) require libtool 1.4.3 or 313 newer. The autogen.sh script knows about that. 314 315 316 5. Serf library 1.3.4 or newer (OPTIONAL) 317 318 If you want your client to be able to speak to an Apache 319 server (via a http:// or https:// URL), you must link against 320 serf. Though optional, we strongly recommend this. 321 322 In order to use ra_serf, you must install serf, and run Subversion's 323 ./configure with the argument --with-serf. If serf is installed in a 324 non-standard place, you should use 325 326 --with-serf=/path/to/serf/install 327 328 instead. 329 330 Serf can be obtained via your system's package distribution 331 system or directly from http://code.google.com/p/serf/. 332 333 For more information on serf and Subversion's ra_serf, see the file 334 subversion/libsvn_ra_serf/README. 335 336 6. OpenSSL (OPTIONAL) 337 338 ### needs some updates. I think serf automagically handles 339 ### finding OpenSSL, but we may need more docco here. and w.r.t 340 ### zlib. 341 342 The Serf library has support for SSL encryption by relying on the 343 OpenSSL library. 344 345 a. Using OpenSSL on the client through Serf 346 347 On Unix systems, to build Serf with OpenSSL, you need OpenSSL 348 installed on your system, and you must add "--with-ssl" as a 349 "./configure" parameter. If your OpenSSL installation is hard 350 for Serf to find, you may need to use "--with-libs=/path/to/lib" 351 in addition. In particular, on Red Hat (but not Fedora Core) it 352 is necessary to specify "--with-libs=/usr/kerberos" for OpenSSL 353 to be found. You can also specify a path to the zlib library 354 using "--with-libs". 355 356 Under Windows, you can specify the paths to these libraries by 357 passing the options --with-zlib and --with-openssl to gen-make.py. 358 359 b. Using OpenSSL on the Apache server 360 361 You can also add support for these features to an Apache httpd 362 server to be used for Subversion using the same support libraries. 363 The Subversion build system will not provide them, however. You 364 add them by specifying parameters to the "./configure" script of 365 the Apache Server instead. 366 367 For getting SSL on your server, you would add the "--enable-ssl" 368 or "--with-ssl=/path/to/lib" option to Apache's "./configure" 369 script. Apache enables zlib support by default, but you can 370 specify a nonstandard location for the library with the 371 "--with-z=/path/to/dir" option. Consult the Apache documentation 372 for more details, and for other modules you may wish to install 373 to enhance your Subversion server. 374 375 If you don't already have it, you can get a copy of OpenSSL, 376 including instructions for building and packaging on both Unix 377 systems and Windows, at: 378 379 http://www.openssl.org/ 380 381 382 7. Berkeley DB 4.X (OPTIONAL) 383 384 Berkeley DB is needed to build a Subversion server that supports 385 the BDB repository filesystem, or to access a BDB repository on 386 local disk. If you will only use the FSFS repository filesystem, 387 or if you are building a Subversion client that will only speak 388 to remote (networked) repositories, you don't need it. 389 390 The current recommended version is 4.4.20 or newer, which brings 391 auto-recovery functionality to the Berkeley DB database 392 environment. 393 394 If you must use an older version of Berkeley DB, we *strongly* 395 recommend using 4.3 or 4.2 over the 4.1 or 4.0 versions. Not 396 only are these significantly faster and more stable, but they 397 also enable Subversion repositories to automatically clean up 398 database journal files to save disk space. 399 400 You'll need Berkeley DB installed on your system. You can 401 get it from: 402 403 http://www.oracle.com/technology/software/products/berkeley-db/index.html 404 405 If you have Berkeley DB installed in a place not searched by default 406 for includes and libraries, add something like this: 407 408 --with-berkeley-db=db.h:/usr/local/include/db4.7:/usr/local/lib/db4.7:db-4.7 409 410 to your `configure' switches, and the build process will use the 411 Berkeley DB header and library in the named directories. You may 412 need to use a different path, of course. Note that in order for 413 the detection to succeed, the dynamic linker must be able to find 414 the libraries at configure time. 415 416 If you are on the Windows platform and want to build Subversion, 417 a precompiled version of the Berkeley DB library is available for 418 download at the Subversion web site "Documents & files" area: 419 420 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688 421 422 Look in the "Releases > Windows > Windows BDB" section. 423 424 425 8. Cyrus SASL library (OPTIONAL) 426 427 If the Simple Authentication and Security Layer (SASL) library 428 is detected on your system, then the Subversion client and 429 svnserve server can utilize its abilities for various forms of 430 authentication. To learn more about SASL or to get the source 431 code, visit: 432 433 http://freshmeat.net/projects/cyrussasl/ 434 435 436 9. Apache Web Server 2.2.X or newer (OPTIONAL) 437 438 (http://httpd.apache.org/download.cgi) 439 440 The Apache httpd server is one of two methods to make your Subversion 441 repository available over a network - the other is a custom server 442 program called svnserve, which requires no extra software packages. 443 Building Subversion, the Apache server, and the modules that Apache 444 needs to communicate with Subversion are complicated enough that there 445 is a whole section at the end of this document that describes how it 446 is done: See section III for details. 447 448 449 10. Python 2.7 or newer (http://www.python.org/) (OPTIONAL) 450 451 If you want to run "make check" or build from the latest source 452 under Unix/Windows as described in section II.B, II.E and III.D, 453 install Python 2.7 or higher on your system. The majority of the 454 test suite is written in Python, as is part of Subversion's build 455 system. 456 457 Note that Python 3.x is not supported and most likely won't work. 458 459 460 11. Perl 5.8 or newer (Windows only) (OPTIONAL) 461 462 To build Subversion under any of the MS Windows platforms, you 463 will also need Perl 5.8 or newer to run apr-util's w32locatedb.pl 464 script. 465 466 467 12. SQLite (REQUIRED) 468 469 Subversion requires SQLite version 3.7.12 or above. You can meet this 470 dependency several ways: 471 * Use an SQLite amalgamation file. 472 * Specify an SQLite installation to use. 473 * Let Subversion find an installed SQLite. 474 475 To use an SQLite-provided amalgamation, just drop sqlite3.c into 476 Subversion's sqlite-amalgamation/ directory, or point to it with the 477 --with-sqlite configure option. This file also ships with the Subversion 478 dependencies distribution, or you can download it from SQLite: 479 480 http://www.sqlite.org/download.html 481 482 483 13. pkg-config (Unix only, OPTIONAL) 484 485 Subversion uses pkg-config to find appropriate options used 486 at build time. 487 488 489 14. D-Bus (Unix only, OPTIONAL) 490 491 D-Bus is a message bus system. D-Bus is required for support for KWallet 492 and GNOME Keyring. pkg-config is needed to find D-Bus headers and library. 493 494 495 15. Qt 4 (Unix only, OPTIONAL) 496 497 Qt is a cross-platform application framework. QtCore, QtDBus and QtGui 498 modules are required for support for KWallet. pkg-config is needed 499 to find Qt headers and libraries. 500 501 502 16. KDELibs 4 (Unix only, OPTIONAL) 503 504 Subversion contains optional support for storing passwords in KWallet. 505 KDELibs contains core KDE libraries. Subversion uses libkdecore and libkdeui 506 libraries when support for KWallet is enabled. kde4-config is used to get 507 some necessary options. pkg-config, D-Bus and Qt 4 are also required. 508 If you want to build support for KWallet, then pass the '--with-kwallet' 509 option to `configure`. If KDE is installed in a non-standard prefix, then 510 use: 511 512 --with-kwallet=/path/to/KDE/prefix 513 514 17. GLib 2 (Unix only, OPTIONAL) 515 516 GLib is a general-purpose utility library. GLib is required for support 517 for GNOME Keyring. pkg-config is needed to find GLib headers and library. 518 519 520 18. GNOME Keyring (Unix only, OPTIONAL) 521 522 Subversion contains optional support for storing passwords in GNOME Keyring. 523 pkg-config is needed to find GNOME Keyring headers and library. D-Bus and 524 GLib are also required. If you want to build support for GNOME Keyring, 525 then pass the '--with-gnome-keyring' option to `configure`. 526 527 528 19. Ctypesgen (OPTIONAL) 529 530 Ctypesgen is Python wrapper generator for ctypes. It is used to generate 531 a part of Subversion Ctypes Python bindings (CSVN). If you want to build 532 CSVN, then pass the '--with-ctypesgen' option to `configure`. If ctypesgen.py 533 is installed in a non-standard place, then use: 534 535 --with-ctypesgen=/path/to/ctypesgen.py 536 537 For more information on CSVN, see subversion/bindings/ctypes-python/README. 538 539 20. libmagic (OPTIONAL) 540 541 Subversion's configure script attempts to find libmagic automatically. 542 If it is installed in a non-standard location, then use: 543 544 --with-libmagic=/path/to/libmagic/prefix 545 546 The files include/magic.h and lib/libmagic.so.1.0 (or similar) 547 are expected beneath this prefix directory. If they cannot be 548 found Subversion will be compiled without support for libmagic. 549 550 If libmagic is installed but support for it should not be compiled 551 in, then use: 552 553 --with-libmagic=no 554 555 If configure should fail when libmagic is not present, but only 556 the default locations should be searched, then use: 557 558 --with-libmagic 559 560 21. Googlemock (OPTIONAL) 561 562 Googlemock can be installed and built in-tree by invoking 563 564 $ ./get-dep.sh gmock 565 566 D. Documentation 567 568 The primary documentation for Subversion is the free book 569 "Version Control with Subversion", a.k.a. "The Subversion Book", 570 obtainable from http://svnbook.red-bean.com/. 571 572 Various additional documentation exists in the doc/ subdirectory of 573 the Subversion source. See the file doc/README for more information. 574 575 576 577II. INSTALLATION 578 ============ 579 580 A. Building from a Tarball 581 ------------------------------ 582 583 1. Building from a Tarball 584 585 Download the most recent distribution tarball from: 586 587 http://subversion.apache.org/download/ 588 589 Unpack it, and use the standard GNU procedure to compile: 590 591 $ ./configure 592 $ make 593 # make install 594 595 You can also run the full test suite by running 'make check'. Even 596 in successful runs, some tests will report XFAIL; that is normal. 597 Failed runs are indicated by FAIL or XPASS results, or a non-zero exit 598 code from "make check". 599 600 601 B. Building the Latest Source under Unix 602 ------------------------------------- 603 604 These instructions assume you have already installed Subversion 605 and checked out a working copy of Subversion's own code -- 606 either the latest /trunk code, or some branch or tag. You also 607 need to have already installed whatever prerequisites that 608 version of Subversion requires (if you haven't, the ./configure 609 step should complain). 610 611 You can discard the directory created by the tarball; you're 612 about to build the latest, greatest Subversion client. This is 613 the procedure Subversion developers use. 614 615 First off, if you have any Subversion libraries lying around 616 from previous 'make installs', clean them up first! 617 618 # rm -f /usr/local/lib/libsvn* 619 # rm -f /usr/local/lib/libapr* 620 # rm -f /usr/local/lib/libserf* 621 622 Start the process by running "autogen.sh": 623 624 $ sh ./autogen.sh 625 626 This script will make sure you have all the necessary components 627 available to build Subversion. If any are missing, you will be 628 told where to get them from. (See the 'Dependency Overview' in 629 section I.) 630 631 Note: if the command "autoconf" on your machine does not run 632 autoconf 2.59 or later, but you do have a new enough autoconf 633 available, then you can specify the correct one with the 634 AUTOCONF variable. (The AUTOHEADER variable is similar.) This 635 may be required on Debian GNU/Linux, where "autoconf" is 636 actually a Perl script that attempts to guess which version is 637 required -- because of the interaction between Subversion's and 638 APR's configuration systems, the Perl script may get it wrong. 639 So for example, you might need to do: 640 641 $ AUTOCONF=autoconf2.59 sh ./autogen.sh 642 643 Once you've prepared the working copy by running autogen.sh, 644 just follow the usual configuration and build procedure: 645 646 $ ./configure 647 $ make 648 # make install 649 650 (Optionally, you might want to pass --enable-maintainer-mode to 651 the ./configure script. This enables debugging symbols in your 652 binaries (among other things) and most Subversion developers use it.) 653 654 Since the resulting binary depends on shared libraries, the 655 destination library directory must be identified in your 656 operating system's library search path. That is in either 657 /etc/ld.so.conf or $LD_LIBRARY_PATH for Linux systems and in 658 /etc/rc.conf for FreeBSD, followed by a run of the 'ldconfig' 659 program. Check your system documentation for details. By 660 identifying the destination directory, Subversion will be able 661 to dynamically load repository access plugins. If you try to do 662 a checkout and see an error like: 663 664 subversion/libsvn_ra/ra_loader.c:209: (apr_err=170000) 665 svn: Unrecognized URL scheme 'https://svn.apache.org/repos/asf/subversion/trunk' 666 667 It probably means that the dynamic loader/linker can't find all 668 of the libsvn_* libraries. 669 670 671 C. Building under Unix in Different Directories 672 -------------------------------------------- 673 674 It is possible to configure and build Subversion on Unix in a 675 directory other than the working copy. For example 676 677 $ svn co https://svn.apache.org/repos/asf/subversion/trunk svn 678 $ cd svn 679 $ # get SQLite amalgamation if required 680 $ chmod +x autogen.sh 681 $ ./autogen.sh 682 $ mkdir ../obj 683 $ cd ../obj 684 $ ../svn/configure [...with options as appropriate...] 685 $ make 686 687 puts the Subversion working copy in the directory svn and builds 688 it in a separate, parallel directory obj. 689 690 Why would you want to do this? Well there are a number of 691 reasons... 692 693 * You may prefer to avoid "polluting" the working copy with 694 files generated during the build. 695 696 * You may want to put the build directory and the working 697 copy on different physical disks to improve performance. 698 699 * You may want to separate source and object code and only 700 backup the source. 701 702 * You may want to remote mount the working copy on multiple 703 machines, and build for different machines from the same 704 working copy. 705 706 * You may want to build multiple configurations from the 707 same working copy. 708 709 The last reason above is possibly the most useful. For instance 710 you can have separate debug and optimized builds each using the 711 same working copy. Or you may want a client-only build and a 712 client-server build. Using multiple build directories you can 713 rebuild any or all configurations after an edit without the need 714 to either clean and reconfigure, or identify and copy changes 715 into another working copy. 716 717 718 D. Installing from a Zip or Installer File under Windows 719 -------------------------------------------------------- 720 721 Of all the ways of getting a Subversion client, this is the 722 easiest. Download a Zip (*.zip) or self-extracting installer 723 (*-setup.exe) file from: 724 725 http://subversion.apache.org/packages#windows 726 727 For a Zip file, run your unzipping utility (WinZIP, ZipGenius, 728 UltimateZIP, FreeZIP, whatever) and extract the DLLs and EXEs to 729 a directory of your choice. Included in the download is the SVN 730 client, the SVNADMIN administration tool, and the SVNLOOK 731 reporting tool. 732 733 Note that if you need support for non-English locales you'll have 734 to set the APR_ICONV_PATH environment variable to the path of the 735 iconv directory in the folder that contains the Subversion install. 736 737 You may also want to add the bin directory in the Subversion folder 738 to your PATH environment variable so as to not have to use the full 739 path when running Subversion commands. 740 741 To test the installation, open a DOS box (run either "cmd" or 742 "command" from the Start menu's "Run..." menu option), change to 743 the directory you installed the executables into, and run: 744 745 C:\test>svn co https://svn.apache.org/repos/asf/subversion/trunk svn 746 747 This will get the latest Subversion sources and put them into the 748 "svn" subdirectory. 749 750 If using a self-extracting .exe file, just run it instead of 751 unzipping it, to install Subversion. 752 753 E. Building the Latest Source under Windows 754 ---------------------------------------- 755 756 E.1 Prerequisites 757 758 * Visual Studio 6 and service pack. It can be built with later versions 759 of Visual Studio (Visual Studio.NET 2005-2015, Visual C++ Express 760 2005-2010, Visual Studio Express 2012-2013 and Visual Studio Community 761 2013-2015) but these instructions assume VS6. 762 * A recent Windows SDK. (Not needed with Visual Studio 2005 and later) 763 If you are using Visual Studio 6, you need the latest SDK which 764 is compatible with VC6, which is the one from February 2003. 765 You can get it from MSDN: 766 https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/e1147034-9b0b-4494-a5bc-6dfebb6b7eb1/download-and-install-microsoft-platform-sdk-febuary-2003-last-version-with-vc6-support?forum=windowssdk 767 * Python 2.7 or higher, downloaded from http://www.python.org/ which is 768 used to generate the project files. 769 Note that Python 3.x is not supported (yet). 770 * Perl 5.8 or higher from http://www.activestate.com/ 771 * Awk (from http://www.cs.princeton.edu/~bwk/btl.mirror/awk95.exe) is 772 needed to compile Apache or APR. Note that this is the actual awk 773 program, not an installer - just rename it to awk.exe and it is 774 ready to use. 775 * Apache apr, apr-util, and optionally apr-iconv libraries, version 776 1.3 or later. Included in both the Subversion dependencies ZIP file 777 and the Apache 2 source zip. If you are building from a Subversion 778 checkout and have not downloaded Apache 2, then get these 3 libraries 779 from http://www.apache.org/dist/apr/. 780 * SQLite 3.7.12 or higher from http://www.sqlite.org/download.html 781 * ZLib 1.2 or higher is required and is included in the Subversion 782 dependencies zip file or can be obtained from http://www.zlib.net/ 783 * Either a Subversion client binary from http://subversion.apache.org/ to 784 do the initial checkout of the Subversion source or the zip file 785 source distribution. See the section "Bootstrapping from a Zip or 786 Installer File under Windows" above for more. 787 * A means of unpacking the files, e.g., WinZIP or similar. 788 789 Additional Options 790 791 * [Optional] Apache 2 source, downloaded from 792 http://httpd.apache.org/download.cgi, these instructions assume 793 version 2.0.58. This is only needed for building the Subversion 794 server Apache modules. ### FIXME Apache 2.2 or greater required. 795 * [Optional] Apache 2 msi install file, also from 796 http://httpd.apache.org/download.cgi (required for running the 797 tests). Only needed for testing the server dso modules and if 798 you are using Visual Studio 6. 799 Note that if you are not using Visual Studio 6 (and you want to 800 run and test the server modules) then you must rebuild Apache 801 from source -- do not use the stock MSI since mixing C runtime 802 libraries is not supported. 803 * [Optional] Berkeley DB for backend support of the server 804 components -- versions 4.3.27 and 4.4.20 are available from 805 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688 806 as db-4.3.27-win32.zip and db-4.4.20-win32.zip. 807 For more information see Section I.C.7. 808 * [Optional] Openssl 0.9.7f or higher can be obtained from 809 http://www.openssl.org/source/openssl-0.9.7f.tar.gz 810 * [Optional] A modified version of GNU libintl, called 811 svn-win32-libintl.zip, can be used for displaying localized 812 messages. Available at: 813 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=2627 814 * [Optional] GNU gettext for generating message catalog (.mo) 815 files from message translations. You can get the latest 816 binaries from http://gnuwin32.sourceforge.net/. You'll need the 817 binaries (gettext-0.14.1-bin.zip) and dependencies 818 (gettext-0.14.1-dep.zip). 819 * [Optional] An assembler, e.g., MASM32 from http://www.masm32.com/ 820 or nasm which is available from 821 http://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D 822 823 E.2 Notes 824 825 The Serf library supports secure connections with OpenSSL and 826 on-the-wire compression with zlib. If you want to use the 827 secure connections feature, you should pass the option 828 "--with-openssl" to the gen-make.py script. See Section I.C.6 for 829 more details. 830 831 E.3 Preparation 832 833 This section describes how to unpack the files to make a build tree. 834 835 * Make a directory SVN and cd into it. 836 * Either checkout Subversion: 837 838 svn co https://svn.apache.org/repos/asf/subversion/trunk src-trunk 839 840 or unpack the zip file distribution and rename the directory to 841 src-trunk. 842 843 * Install Visual Studio Environment. You either have to tell the 844 installer to register environment variables or run VCVARS32.BAT 845 before building anything. If you are using a newer Visual Studio, 846 use the 'Visual Studio 20xx Command Prompt' on the Start menu. 847 * Install and register a recent Windows Core SDK if you are using 848 Visual Studio 6. This is a quote from the Microsoft February 2003 849 SDK documentation: 850 851 "To register the SDK bin, include, and library directories with 852 Microsoft Visual Studio® version 6.0 and Visual Studio .NET, 853 click Start, point to All Programs, point to Microsoft Platform 854 SDK February 2003, point to Visual Studio Registration, and then 855 click Register PSDK Directories with Visual Studio. This 856 registration process places the SDK bin, include, and library 857 directories at the beginning of the search paths, which ensures 858 that the latest headers and libraries are used when building 859 applications in the IDE. Note that for Visual Studio 6.0 860 integration to succeed, Visual Studio 6.0 must run at least once 861 before you select Register PSDK Directories with Visual 862 Studio. Also note that when this option is run, the IDEs should 863 not be running." 864 865 * Install Python and add it to your path 866 * Install Perl (it should add itself to the path) 867 * Copy AWK (awk95.exe) to awk.exe (e.g. SVN\awk\awk.exe) and add 868 the directory containing it (e.g. SVN\awk) to the path. 869 * [Optional] Install Apache 2 using the msi file if you are going to test 870 the server dso modules and are using Visual Studio 6. You must build 871 and install it from source if you are not using Visual Studio 6 and 872 want to build and/or test the server modules. 873 * [Optional] If you checked out Subversion from the repository and want 874 to build Subversion with http/https access support then install the 875 serf sources into SVN\src-trunk\serf. 876 * [Optional] If you want BDB backend support, extract the Berkeley DB 877 files into SVN\src-trunk\db4-win32. It's a good idea to add 878 SVN\src-trunk\db4-win32\bin to your PATH, so that Subversion can find 879 the Berkeley DB DLLs. 880 881 [NOTE: This binary package of Berkeley DB is provided for 882 convenience only. Please don't address questions about 883 Berkeley DB that aren't directly related to using Subversion 884 to the project mailing list.] 885 886 If you build Berkeley DB from the source, you will have to copy 887 the file db-x.x.x\build_win32\db.h to 888 SVN\src-trunk\db4-win32\include, and all the import libraries to 889 SVN\src-trunk\db4-win32\lib. Again, the DLLs should be somewhere in 890 your path. 891 892 * [Optional] If you want to build the server modules, extract Apache 893 source into SVN\httpd-2.x.x. 894 * If you are building from a checkout of Subversion, and you are NOT 895 building Apache, then you will need the APR libraries. Depending 896 on how you got your version of APR, either: 897 - Extract the APR, APR-util and APR-iconv source distributions into 898 SVN\apr, SVN\apr-util, and SVN\apr-iconv respectively. 899 Or: 900 - Extract the apr, apr-util and apr-iconv directories from the 901 srclib folder in the Apache httpd source into SVN\apr, 902 SVN\apr-util, and SVN\apr-iconv respectively. 903 * Extract the ZLib sources into SVN\zlib if you are not using the zlib 904 included in the dependencies zip file. 905 * [Optional] If you want secure connection (https) client support, or if 906 you are building with enabled support for serf extract openssl into 907 SVN\openssl-x.x.x 908 * [Optional] If you want localized message support, extract 909 svn-win32-libintl.zip into SVN\svn-win32-libintl and extract 910 gettext-x.x.x-bin.zip and gettext-x.x.x-dep.zip into 911 SVN\gettext-x.x.x-bin. 912 Add SVN\gettext-x.x.x-bin\bin to your path. 913 * [Optional] Extract MASM32 (only the ML.EXE and ML.ERR files) into 914 SVN\asm (or extract nasm into SVN\asm) and put it in your path. 915 * Download the SQLite amalgemation from 916 http://www.sqlite.org/download.html 917 and extract it into SVN\sqlite-amalgemation. 918 See I.C.12 for alternatives to using the amalgemation package. 919 920 E.4 Building the Binaries 921 922 To build the binaries either follow the instructions here or use 923 build\win32\vc6-build.bat.in after editing its default paths to match 924 yours and saving it as vc6-build.bat. The vc6-build.bat does a full build 925 using all options so it requires Apache 2 source and the other optional 926 components. 927 928 Start in the SVN directory you created. 929 930 Set up the environment (commands should be one line even if wrapped here). 931 932 C:>set VER=trunk 933 C:>set DIR=trunk 934 C:>set BUILD_ROOT=C:\SVN 935 C:>set PYTHONDIR=C:\Python22 936 C:>set AWKDIR=C:\SVN\Awk 937 C:>set ASMDIR=C:\SVN\asm 938 C:>set SDKINC="C:\Program Files\Microsoft SDK\include" 939 C:>set SDKLIB="C:\Program Files\Microsoft SDK\lib" 940 C:>set GETTEXTBIN=C:\SVN\gettext-0.14.1-bin\bin 941 C:>PATH=%PATH%;%BUILD_ROOT%\src-%DIR%\db4-win32;%ASMDIR%; 942 %PYTHONDIR%;%AWKDIR%;%GETTEXTBIN% 943 C:>set INCLUDE=%SDKINC%;%INCLUDE% 944 C:>set LIB=%SDKLIB%;%LIB% 945 946 OpenSSL 947 948 C:>cd openssl-0.9.7f 949 C:>perl Configure VC-WIN32 950 [*] C:>call ms\do_masm 951 C:>nmake -f ms\ntdll.mak 952 C:>cd out32dll 953 C:>call ..\ms\test 954 C:>cd ..\.. 955 956 *Note: Use "call ms\do_nasm" if you have nasm instead of MASM, or 957 "call ms\do_ms" if you don't have an assembler. 958 959 Apache 2 960 961 This step is only required for building the server dso modules. 962 963 The Subversion gen-make.py script must be run before building Apache or 964 Apache and Subversion will be running incompatible versions of apr. 965 966 C:>cd src-%DIR% 967 C:>python gen-make.py -t dsp --with-httpd=..\httpd-2.0.58 968 --with-berkeley-db=db4-win32 --with-openssl=..\openssl-0.9.7f 969 --with-zlib=..\zlib --with-libintl=..\svn-win32-libintl 970 C:>cd .. 971 C:>set APACHEDIR=C:\Program Files\Apache Group\Apache2 972 C:>msdev httpd-2.0.58\apache.dsw /MAKE "BuildBin - Win32 Release" 973 974 APR 975 976 If you downloaded APR / APR-UTIL / APR_ICONV by source, you will have to 977 build these libraries first. 978 Building these libraries on Windows is straight forward and in most cases 979 as simple as issuing these two commands: 980 981 C:>nmake -f Makefile.win 982 C:>nmake -f Makefile.win install 983 984 Please refere to the build instructions provided by the library source 985 for actual build instructions. 986 987 ZLib 988 989 If you downloaded the zlib source, you will have to build ZLib first. 990 Building ZLib using Visual Studio should be quite simple. Just open the 991 appropriate solution and build the project zlibstat using the IDE. 992 993 Please refere to the build instructions provided by the library source 994 for actual build instructions. 995 996 Note that you'd make sure to define ZLIB_WINAPI in the ZLib config 997 header and move the lib-file into the zlib root-directory. 998 999 Serf 1000 1001 ### Section about serf might be required/useful to add. 1002 ### scons is required too and serf needs to be configured prior to be 1003 ### able to build Subversion using: 1004 ### scons APR=[PATH_TO_APR] APU=[PATH_TO_APU] OPENSSL=[PATH_TO_OPENSSL] 1005 ### ZLIB=[PATH_TO_ZLIB] PREFIX=[PATH_TO_SERF_DEST] 1006 ### scons check 1007 ### scons install 1008 1009 Subversion 1010 1011 Things to note: 1012 1013 * If you don't want to build mod_dav_svn, omit the --with-httpd 1014 option. The zip file source distribution contains apr, apr-util and 1015 apr-iconv in the default build location. If you have downloaded the 1016 apr files yourself you will have to tell the generator where to find 1017 the APR libraries; the options are --with-apr, --with-apr-util and 1018 --with-apr-iconv. 1019 * If you would like a debug build substitute Debug for Release in 1020 the msdev/msbuild commands. 1021 * There have been rumors that Subversion on Win32 can be built 1022 using the latest cygwin, you probably don't want the zip file source 1023 distribution though. ymmv. 1024 * The /USEENV switch to msdev makes it take notice of the INCLUDE and 1025 LIB environment variables, it also makes it ignore its own lib and 1026 include settings so you need to have the Windows SDK lib and include 1027 directories in the LIB and INCLUDE environment variables. Do *not* 1028 use this switch when starting up the msdev Visual environment. If you 1029 wish to build in the Visual environment the SDK lib and include 1030 directories must be in the Tools/Options/Directories settings (if you 1031 followed the 'Register the SDK with Visual Studio 6' instructions 1032 above this has been done for you). 1033 * If you are using Visual Studio later than VC6 change -t dsw into 1034 -t vcproj and add the --vsnet-version=20xx option on the gen-make.py 1035 command. 1036 In this case you will also have to distribute the C runtime dll with 1037 the binaries. Also, since Apache/APR do not provide .vcproj files, 1038 you will need to convert the Apache/APR .dsp files to .vcproj files 1039 with Visual Studio before building -- just open the Apache .dsw file 1040 and answer 'Yes To All' when the conversion dialog pops up, or you 1041 can open the individual .dsp files and convert them one at a time. 1042 The Apache/APR projects required by Subversion are: 1043 apr-util\libaprutil.dsp, apr\libapr.dsp, 1044 apr-iconv\libapriconv.dsp, apr-util\xml\expat\lib\xml.dsp, 1045 apr-util\uri\gen_uri_delims.dsp (for APR 0.9.x), 1046 apr-iconv\ccs\libapriconv_ccs_modules.dsp, and 1047 apr-iconv\ces\libapriconv_ces_modules.dsp. 1048 * If the server dso modules are being built and tested Apache must not 1049 be running or the copy of the dso modules will fail. 1050 1051 C:>cd src-%DIR% 1052 1053 If Apache 2 has been built and the server modules are required then 1054 gen-make.py will already have been run. If the source is from the zip 1055 file, Apache 2 has not been built so gen-make.py must be run: 1056 1057 C:>python gen-make.py -t dsp --with-berkeley-db=db4-win32 1058 --with-openssl=..\openssl-0.9.7f --with-zlib=..\zlib 1059 --with-libintl=..\svn-win32-libintl 1060 1061 Then build subversion: 1062 1063 C:>msdev subversion_msvc.dsw /USEENV /MAKE "__ALL_TESTS__ - Win32 Release" 1064 C:>cd .. 1065 1066 Or, with Visual C++.NET 2005 or C++ Express 2005: 1067 1068 C:>devenv subversion_vcnet.sln /build "Release" /project "__ALL_TESTS__" 1069 C:>cd .. 1070 1071 Or, with Visual C++.NET 2008+, C++ Express 2008+, Studio Express 2012+ or 1072 Studio Community 2013+: 1073 1074 C:>msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release 1075 C:>cd .. 1076 1077 The binaries have now been built. 1078 1079 E.5 Packaging the binaries 1080 1081 You now need to copy the binaries ready to make the release zip 1082 file. You also need to do this to run the tests as the new binaries 1083 need to be in your path. You can use the build/win32/make_dist.py 1084 script in the Subversion source directory to do that. 1085 1086 [TBD: Describe how to do this. Note dependencies on zip, jar, doxygen.] 1087 1088 E.6 Testing the Binaries 1089 [TBD: It's been a long, long while since it was necessary to move 1090 binaries around for testing. win-tests.py does that automagically. 1091 Fix this section accordingly, and probably reorder, putting 1092 the packaging at the end.] 1093 1094 The build process creates the binary test programs but it does not 1095 copy the client tests into the release test area. 1096 1097 C:>cd src-%DIR% 1098 C:>mkdir Release\subversion\tests\cmdline 1099 C:>xcopy /S /Y subversion\tests\cmdline Release\subversion\tests\cmdline 1100 1101 If the server dso modules have been built then copy the dso files and 1102 dlls into the Apache modules directory. 1103 1104 C:>copy Release\subversion\mod_dav_svn\mod_dav_svn.so "%APACHEDIR%"\modules 1105 C:>copy Release\subversion\mod_authz_svn\mod_authz_svn.so 1106 "%APACHEDIR%"\modules 1107 C:>copy svn-win32-%VER%\bin\intl.dll "%APACHEDIR%\bin" 1108 C:>copy svn-win32-%VER%\bin\iconv.dll "%APACHEDIR%\bin" 1109 C:>copy svn-win32-%VER%\bin\libdb42.dll "%APACHEDIR%\bin" 1110 C:>cd .. 1111 1112 Put the svn-win32-trunk\bin directory at the start of your path so 1113 you run the newly built binaries and not another version you might 1114 have installed. 1115 1116 Then run the client tests: 1117 1118 C:>PATH=%BUILD_ROOT%\svn-win32-%VER%\bin;%PATH% 1119 C:>cd src-%DIR% 1120 C:>python win-tests.py -c -r -v 1121 1122 If the server dso modules were built configure Apache to use the 1123 mod_dav_svn and mod_authz_svn modules by making sure these lines appear 1124 uncommented in httpd.conf: 1125 1126 LoadModule dav_module modules/mod_dav.so 1127 LoadModule dav_fs_module modules/mod_dav_fs.so 1128 LoadModule dav_svn_module modules/mod_dav_svn.so 1129 LoadModule authz_svn_module modules/mod_authz_svn.so 1130 1131 And further down the file add location directives to point to the 1132 test repositories. Change the paths to the SVN directory you created 1133 (paths should be on one line even if wrapped here): 1134 1135 <Location /svn-test-work/repositories> 1136 DAV svn 1137 SVNParentPath C:/SVN/src-trunk/Release/subversion/tests/cmdline/ 1138 svn-test-work/repositories 1139 </Location> 1140 1141 <Location /svn-test-work/local_tmp/repos> 1142 DAV svn 1143 SVNPath c:/SVN/src-trunk/Release/subversion/tests/cmdline/ 1144 svn-test-work/local_tmp/repos 1145 </Location> 1146 1147 Then restart Apache and run the tests: 1148 1149 C:>python win-tests.py -c -r -v -u http://localhost 1150 C:>cd .. 1151 1152III. BUILDING A SUBVERSION SERVER 1153 ============================ 1154 1155 Subversion has two servers you can choose from: svnserve and 1156 Apache. svnserve is a small, lightweight server program that is 1157 automatically compiled when you build Subversion's source. Apache 1158 is a more heavyweight HTTP server, but tends to have more features. 1159 1160 This section primarily focuses on how to build Apache and the 1161 accompanying mod_dav_svn server module for it. If you plan to use 1162 svnserve instead, jump right to section E for a quick explanation. 1163 1164 1165 A. Setting Up Apache 1166 ----------------- 1167 1168 1. Obtaining and Installing Apache 2 1169 1170 Subversion tries to compile against the latest released version 1171 of Apache httpd 2.X. The easiest thing for you to do is download 1172 a source tarball of the latest release and unpack that. 1173 1174 1175 **************************************************************** 1176 ** IMPORTANT ISSUE ABOUT APACHE VERSIONS: READ THIS. ** 1177 ** ** 1178 **************************************************************** 1179 | | 1180 | First, be sure to read the APR version warning box, back in | 1181 | section I.C.1, which explains that APR 0.9.x and 1.X are | 1182 | binary-incompatible. | 1183 | | 1184 | Apache HTTPD 2.0 uses APR 0.9.x. | 1185 | Apache HTTPD 2.2 uses APR 1.2.x. | 1186 | | 1187 | We recommend using the latest Apache. However, whatever | 1188 | version you choose, you *must* ensure that Subversion | 1189 | and Apache are using the same version of APR. If you don't, | 1190 | things will segfault and break. | 1191 |______________________________________________________________| 1192 1193 1194 If you have questions about the Apache httpd 2.0 build, please consult 1195 the httpd install documentation: 1196 1197 http://httpd.apache.org/docs-2.0/install.html 1198 1199 At the top of the httpd tree: 1200 1201 $ ./buildconf 1202 $ ./configure --enable-dav --enable-so --enable-maintainer-mode 1203 1204 The first arg says to build mod_dav. 1205 1206 The second arg says to enable shared module support which is needed 1207 for a typical compile of mod_dav_svn (see below). 1208 1209 The third arg says to include debugging information. If you 1210 built Subversion with --enable-maintainer-mode, then you should 1211 do the same for Apache; there can be problems if one was 1212 compiled with debugging and the other without. 1213 1214 Note: if you have multiple db versions installed on your system, 1215 Apache might link to a different one than Subversion, causing 1216 failures when accessing the repository through Apache. To prevent 1217 this from happening, you have to tell Apache which db version to 1218 use and where to find db. Add --with-dbm=db4 and 1219 --with-berkeley-db=/usr/local/BerkeleyDB.4.2 to the configure 1220 line. Make sure this is the same db as the one Subversion uses. 1221 This note assumes you have installed Berkeley DB 4.2.52 1222 at its default locations. For more info about the db requirement, 1223 see section I.C.7. 1224 1225 You may also want to include other modules in your build. Add 1226 --enable-ssl to turn on SSL support, and --enable-deflate to turn on 1227 compression support, for example. Consult the Apache documentation 1228 for more details. 1229 1230 All instructions below assume you configured Apache to install 1231 in its default location, /usr/local/apache2/; substitute 1232 appropriately if you chose some other location. 1233 1234 Compile and install apache: 1235 1236 $ make && make install 1237 1238 1239 B. Making and Installing the Subversion Apache Server Module 1240 --------------------------------------------------------- 1241 1242 Go back into your subversion working copy and run ./autogen.sh if 1243 you need to. Then, assuming Apache httpd 2.0 is installed in the 1244 standard location, run: 1245 1246 $ ./configure 1247 1248 Note: do *not* configure subversion with "--disable-shared"! 1249 mod_dav_svn *must* be built as a shared library, and it will 1250 look for other libsvn_*.so libraries on your system. 1251 1252 If you see a warning message that the build of mod_dav_svn is 1253 being skipped, this may be because you have Apache httpd 2.X 1254 installed in a non-standard location. You can use the 1255 "--with-apxs=" option to locate the apxs script: 1256 1257 $ ./configure --with-apxs=/usr/local/apache2/bin/apxs 1258 1259 Note: it *is* possible to build mod_dav_svn as a static library 1260 and link it directly into Apache. Possible, but painful. Stick 1261 with the shared library for now; if you can't, then ask. 1262 1263 $ rm /usr/local/lib/libsvn* 1264 1265 If you have old subversion libraries sitting on your system, 1266 libtool will link them instead of the `fresh' ones in your tree. 1267 Remove them before building subversion. 1268 1269 $ make clean && make && make install 1270 1271 After the make install, the Subversion shared libraries are in 1272 /usr/local/lib/. mod_dav_svn.so should be installed in 1273 /usr/local/libexec/ (or elsewhere, such as /usr/local/apache2/modules/, 1274 if you passed --with-apache-libexecdir to configure). 1275 1276 1277 Section II.E explains how to build the server on Windows. 1278 1279 1280 C. Configuring Apache for Subversion 1281 --------------------------------- 1282 1283 The following section is an abbreviated version of the 1284 information in the Subversion Book 1285 (http://svnbook.red-bean.com). Please read chapter 6 for more 1286 details. 1287 1288 The following assumes you have already created a repository. 1289 For documentation on how to do that, see README. 1290 1291 The following also assumes that you have modified 1292 /usr/local/apache2/conf/httpd.conf to reflect your setup. 1293 At a minimum you should look at the User, Group and ServerName 1294 directives. Full details on setting up apache can be found at: 1295 http://httpd.apache.org/docs-2.0/ 1296 1297 First, your httpd.conf needs to load the mod_dav_svn module. 1298 If you pass --enable-mod-activation to Subversion's configure, 1299 'make install' target should automatically add this line for you. 1300 In any case, if Apache HTTPD gives you an error like "Unknown 1301 DAV provider: svn", then you may want to verify that this line 1302 exists in your httpd.conf: 1303 1304 LoadModule dav_svn_module modules/mod_dav_svn.so 1305 1306 NOTE: if you built mod_dav as a dynamic module as well, make sure 1307 the above line appears after the one that loads mod_dav.so. 1308 1309 Next, add this to the *bottom* of your httpd.conf: 1310 1311 <Location /svn/repos> 1312 DAV svn 1313 SVNPath /absolute/path/to/repository 1314 </Location> 1315 1316 This will give anyone unrestricted access to the repository. If 1317 you want limited access, read or write, you add these lines to 1318 the Location block: 1319 1320 AuthType Basic 1321 AuthName "Subversion repository" 1322 AuthUserFile /my/svn/user/passwd/file 1323 1324 And: 1325 1326 a) For a read/write restricted repository: 1327 1328 Require valid-user 1329 1330 b) For a write restricted repository: 1331 1332 <LimitExcept GET PROPFIND OPTIONS REPORT> 1333 Require valid-user 1334 </LimitExcept> 1335 1336 c) For separate restricted read and write access: 1337 1338 AuthGroupFile /my/svn/group/file 1339 1340 <LimitExcept GET PROPFIND OPTIONS REPORT> 1341 Require group svn_committers 1342 </LimitExcept> 1343 1344 <Limit GET PROPFIND OPTIONS REPORT> 1345 Require group svn_committers 1346 Require group svn_readers 1347 </Limit> 1348 1349 These are only a few simple examples. For a complete tutorial 1350 on Apache access control, please consider taking a look at the 1351 tutorials found under "Security" on the following page: 1352 http://httpd.apache.org/docs-2.0/misc/tutorials.html 1353 1354 In order for 'svn cp' to work (which is actually implemented as a 1355 DAV COPY command), mod_dav needs to be able to determine the 1356 hostname of the server. A standard way of doing this is to use 1357 Apache's ServerName directive to set the server's hostname. Edit 1358 your /usr/local/apache2/conf/httpd.conf to include: 1359 1360 ServerName svn.myserver.org 1361 1362 If you are using virtual hosting through Apache's NameVirtualHost 1363 directive, you may need to use the ServerAlias directive to specify 1364 additional names that your server is known by. 1365 1366 If you have configured mod_deflate to be in the server, you can enable 1367 compression support for your repository by adding the following line 1368 to your Location block: 1369 1370 SetOutputFilter DEFLATE 1371 1372 1373 NOTE: If you are unfamiliar with an Apache directive, or not exactly 1374 sure about what it does, don't hesitate to look it up in the 1375 documentation: http://httpd.apache.org/docs-2.0/mod/directives.html. 1376 1377 NOTE: Make sure that the user 'nobody' (or whatever UID the 1378 httpd process runs as) has permission to read and write the 1379 Berkeley DB files! This is a very common problem. 1380 1381 1382 D. Running and Testing 1383 ------------------- 1384 1385 Fire up apache 2: 1386 1387 $ /usr/local/apache2/bin/apachectl stop 1388 $ /usr/local/apache2/bin/apachectl start 1389 1390 Check /usr/local/apache2/logs/error_log to make sure it started 1391 up okay. 1392 1393 Try doing a network checkout from the repository: 1394 1395 $ svn co http://localhost/svn/repos wc 1396 1397 The most common reason this might fail is permission problems 1398 reading the repository db files. If the checkout fails, make 1399 sure that the httpd process has permission to read and write to 1400 the repository. You can see all of mod_dav_svn's complaints in 1401 the Apache error logfile, /usr/local/apache2/logs/error_log. 1402 1403 To run the regression test suite for networked Subversion, see 1404 the instructions in subversion/tests/cmdline/README. 1405 For advice about tracing problems, see "Debugging the server" in 1406 http://subversion.apache.org/docs/community-guide/. 1407 1408 1409 E. Alternative: 'svnserve' and ra_svn 1410 ----------------------------------- 1411 1412 An alternative network layer is libsvn_ra_svn (on the client 1413 side) and the 'svnserve' process on the server. This is a 1414 simple network layer that speaks a custom protocol over plain 1415 TCP (documented in libsvn_ra_svn/protocol): 1416 1417 $ svnserve -d # becomes a background daemon 1418 $ svn checkout svn://localhost/usr/local/svn/repository 1419 1420 You can use the "-r" option to svnserve to set a logical root 1421 for repositories, and the "-R" option to restrict connections to 1422 read-only access. ("Read-only" is a logical term here; svnserve 1423 still needs write access to the database in this mode, but will 1424 not allow commits or revprop changes.) 1425 1426 'svnserve' has built-in CRAM-MD5 authentication (so you can use 1427 non-system accounts), and can also be tunneled over SSH (so you 1428 can use existing system accounts). It's also capable of using 1429 Cyrus SASL if libsasl2 is detected at ./configure time. Please 1430 read chapter 6 in the Subversion Book 1431 (http://svnbook.red-bean.com) for details on these features. 1432 1433 1434 1435IV. PLATFORM-SPECIFIC ISSUES 1436 ======================== 1437 1438 A. Windows XP 1439 ---------- 1440 1441 There is an error in the Windows XP TCP/IP stack which causes 1442 corruption in certain cases. This problem is exposed only 1443 through ra_dav. 1444 1445 The root of the matter is caused by duplicating file handles 1446 between parent and child processes. The httpd Apache group 1447 explains this a lot better: 1448 1449 http://www.apache.org/dist/httpd/binaries/win32/#xpbug 1450 1451 And there's an item about this in the Subversion FAQ: 1452 1453 http://subversion.apache.org/faq.html#windows-xp-server 1454 1455 The only known workaround for now is to update to Windows XP 1456 SP1 (or higher). 1457 1458 1459 B. Mac OS X 1460 -------- 1461 1462 [TBD: Describe BDB 4.0.x problem] 1463 1464 1465 1466V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA) 1467 ======================================================== 1468 1469 For Python, Perl and Ruby bindings, see the file 1470 1471 ./subversion/bindings/swig/INSTALL 1472 1473 For Java bindings, see the file 1474 1475 ./subversion/bindings/javahl/README 1476