Update Apache module build advice
[shibboleth/cpp-sp.git] / doc / INSTALL.txt
1 3/15/04
2 Version 1.2
3
4 Binary distributions of the Shibboleth code are available.
5 Information on obtaining and installing binaries can be found at
6 http://shibboleth.internet2.edu/ and in the deploy guide in this
7 directory.
8
9 This document provides details for those wishing to build from source.
10
11 C++ / TARGET
12
13 Your first step is going to be the OpenSAML INSTALL.txt file. Please read it
14 thoroughly to understand the issues. All the requirements in that file
15 apply, mainly because you need to build OpenSAML, and almost all the
16 dependencies are the same. Once you reach the end of that build process and
17 have some confidence it worked, you can come back and continue here.
18
19 --- Apache
20
21 You'll next need to get an Apache in place. If you're building from source,
22 you don't have to use the "real" Apache code, or use mod_ssl. You will
23 however need to provide the necessary build flags during configure, or
24 ideally, let our configure script use your Apache's apxs script to extract
25 the necessary information.
26
27 --- MySQL (optional)
28
29 The distribution now includes a session cache plugin using embedded MySQL.
30 This plugin will be included in the build by default if the embedded MySQL
31 library (libmysqld.a) can be found, or if the --with-mysql option is passed
32 to configure. You can force exclude the plugin with the --disable-mysql option.
33
34 Many default installs of MySQL will not include the embedded library, so don't
35 be surprised if it's not there. Also, just as with PHP and certain other packages
36 that include C++, you'll need to build it with the same compiler used to build
37 Shibboleth unless g++ 3.2 or higher was used.
38
39 The MySQL 4.0.x build is currently not clean on either platform. There are errors
40 in several Makefile.in files that have to corrected to get the build to work.
41 The patch for the pre-configure Makefile.in files in version 4.0.12 is included
42 in this directory as the file "mysql-4.0.12.diff", which can be applied from the
43 mysql-4.0.12 directory.
44
45 After patching, to get it to build, the --with-embedded-server option is used
46 with MySQL. An example build is below:
47
48 $ cd mysql-4.0.12
49 $ env CFLAGS="-fPIC -DPIC" CXXFLAGS="-fPIC -DPIC"
50 $ ./configure --prefix=/opt/mysql \
51     --libexecdir='${exec_prefix}/sbin' \
52     --enable-thread-safe-client --enable-assembler --enable-local-infile \
53     --with-extra-charsets=complex --with-embedded-server \
54     --with-berkeley-db --with-innodb --with-raid
55 $ make all
56 $ make install
57
58 MySQL has a lot of options, so some local customization may be needed. The
59 command to set the compiler flags is critical on Solaris, because the flags
60 are needed to get a correct build of the library to link against.
61
62 --- Shibboleth
63
64 Building the Shibboleth target libraries, shar, test programs, and Apache
65 modules is more or less like building OpenSAML. You can get the code from
66 CVS and run the bootstrap script if you want, or just use a source tarball.
67 With the source distribution or the results of your bootstrap:
68
69 $ ./configure --prefix=/opt/shibboleth --with-log4cpp=/opt/shibboleth \
70     --enable-apache-13 --with-apxs -C
71 $ make
72 $ make install
73
74 This will build the Apache 1.x modules by extracting build settings from apxs.
75 The configure script will look in normal spots for the script
76 (/usr/bin/apxs, /usr/local/apache/bin/apxs) but you can point it if you need to.
77
78 If you want to build the modules but not use apxs, you can use the
79 --without-apxs option, and provide flags using the APXS_PREFIX, APXS_CFLAGS,
80 APXS_INCLUDE, APXS_LIBEXEC, and APXS_SYSCONFDIR variables (see the apxs docs
81 for some guidance on what these should be).
82
83 To test your installation, you can try this:
84
85 $ set LD_LIBRARY_PATH=/opt/shibboleth/lib; export LD_LIBRARY_PATH
86 $ cd /opt/shibboleth
87 $ bin/shibtest -d etc/shibboleth/ -h foo -q urn:mace:inqueue:example.edu -r http://www.foo.edu/
88
89 You should get some reasonably structured output back that lists some simple
90 attributes. An error here is a pretty good sign there's trouble.