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