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