Various updates.
[shibboleth/sp.git] / doc / INSTALL.txt
1 7/15/05
2 Version 1.3
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/
7
8 This document provides details for those wishing to build from source.
9
10 C++ Service Provider
11
12 Your first step is going to be the OpenSAML INSTALL.txt file. Please read it
13 thoroughly to understand the issues. All the requirements in that file
14 apply, mainly because you need to build OpenSAML, and almost all the
15 dependencies are the same. Once you reach the end of that build process and
16 have some confidence it worked, you can come back and continue here.
17
18 --- Apache
19
20 You'll next need to get an Apache in place. If you're building from source,
21 you don't have to use the "real" Apache code, or use mod_ssl. You will
22 however need to provide the necessary build flags during configure, or
23 ideally, let our configure script use your Apache's apxs script to extract
24 the necessary information.
25
26 Also, at a minimum, Apache needs to be built with mod_so enabled for
27 dynamically loading modules. If you encounter problems with crashing
28 or apparent module conflicts, make sure you've built Apache and any
29 modules with threading support and ideally as much dynamically as
30 possible.
31
32 Apache 1.x does not directly support threads, but you can set the
33 CFLAGS variable before running configure to include the proper gcc
34 thread flag (usually -pthread or -pthreads, depends on your platform).
35
36 --- MySQL (optional)
37
38 The distribution now includes a cache plugin using embedded MySQL.
39 This plugin will be included in the build by default if the embedded MySQL
40 library (libmysqld.a) can be found, or if the --with-mysql option is passed
41 to configure. You can force exclude the plugin with the --disable-mysql option.
42
43 Many default installs of MySQL will not include the embedded library, so don't
44 be surprised if it's not there. Also, just as with PHP and certain other packages
45 that include C++, you'll need to build it with the same compiler used to build
46 Shibboleth.
47
48 The MySQL 4.x build is currently not clean. There are errors in several
49 Makefile.in files that have to corrected to get the build to work.
50 The patch for the pre-configure Makefile.in files in version 4.0.12 is included
51 in this directory as the file "mysql-4.0.12.diff", which can be applied from the
52 mysql-4.0.12 directory. Similar changes may be needed in other versions.
53
54 After patching, to get it to build, the --with-embedded-server option is used
55 with MySQL. An example build with gcc/g++ is below:
56
57 $ cd mysql-4.1.12
58 $ env CFLAGS="-fPIC -DPIC" CXXFLAGS="-fPIC -DPIC"
59 $ ./configure --prefix=/opt/mysql \
60     --libexecdir='${exec_prefix}/sbin' --disable-static \
61     --enable-thread-safe-client --enable-assembler --enable-local-infile \
62     --with-extra-charsets=complex --with-embedded-server \
63     --with-berkeley-db --with-innodb --with-raid
64 $ make all
65 $ make install
66
67 MySQL has a lot of options, so some local customization may be needed. The
68 command to set the compiler flags is critical on Solaris, because the flags
69 are needed to get a correct build of the library to link against.
70
71 --- Shibboleth
72
73 Building the Shibboleth libraries, shibd, test programs, and Apache
74 modules is more or less like building OpenSAML. You can get the code from
75 CVS and run the bootstrap script if you want, or just use a source tarball.
76
77 With the source distribution or the results of your bootstrap:
78
79 $ ./configure --prefix=/opt/shibboleth-sp --with-log4cpp=/opt/shibboleth-sp \
80     --enable-apache-13 --with-apxs --enable-apache-20 --with-apxs2 -C
81 $ make
82 $ make install
83
84 This will build the Apache 1.x and 2.x modules by extracting build settings
85 from apxs. The configure script will look in normal spots for the script
86 (/usr/bin/apxs, /usr/local/apache/bin/apxs) but you can point to it so that
87 both modules can be built at once.
88
89 If you want to build the modules but not use apxs, you can use the
90 --without-apxs option, and provide flags using the APXS_PREFIX, APXS_CFLAGS,
91 APXS_INCLUDE, APXS_LIBEXEC, and APXS_SYSCONFDIR variables (see the apxs docs
92 for some guidance on what these should be).
93
94 To test your installation, you can try the shibtest utility, which actually
95 loads your configuration and attempts to obtain attributes from a Shibboleth
96 Attribute Authority of your choosing. You indicate to it the identifier of
97 the principal to query, and the identifier (providerId) of the origin site,
98 and it will use your configuration files to locate the proper AA.
99
100 $ set LD_LIBRARY_PATH=/opt/shibboleth-sp/lib; export LD_LIBRARY_PATH
101 $ /opt/shibboleth/bin/shibtest -h test-handle \
102         -f urn:mace:shibboleth:test:nameIdentifier \
103         -q urn:mace:inqueue:example.edu
104
105 The example shown uses a built-in test principal, and uses the InQueue
106 example origin, which is known to the SP after initial installation.
107 You should get some reasonably structured output back that lists some simple
108 attributes. An error here is a pretty good sign there's trouble.