This document describes how to configure and install this release of DACS. Please read it carefully.
You should build third-party packages in the order in which they are discussed below because packages that are discussed earlier may require some that appear later.
For a few third-party packages, it is important that you use the exact version that is mentioned. Do not use anything newer or older.
For some third-party packages, a particular release is recommended. It is less critical that you use the recommended release, but older releases may have important bugs, including security problems. A release newer than the one(s) specified will not have been tested with DACS - and a release older than the one(s) specified may not have been tested with DACS - so if you choose to use such a release you are on your own.
You may save yourself time and headaches if you just use the recommended releases.
Sometimes the recommended version of a third-party package will be fine on some platforms but will not build or is buggy on another platform. Whenever possible, the DACS installation instructions suggest an alternative version, and you may proceed with that version, or a recent version of your choice - but keep the preceding comments regarding older releases in mind and ensure that a "gmake test" of DACS completes successfully.
If at this time you only want to try DACS rather than doing a full install, review the information below regarding third-party packages and then proceed to follow the instructions you will find in dacs.quick(7)[5], which is a step-by-step tutorial for installing and configuring DACS.
If DACS 1.4 is already installed on your system and you are not changing any third-party packages or installation options, for a "quick and dirty" upgrade you can often install a new release on top of a previous release. While this will leave your existing DACS configuration files alone, it will also leave files that are no longer needed by the new DACS. Be sure to check the new distribution's release notes and the rest of this manual page for any notable differences and incompatibilities - you may need to make some adjustments to your pre-existing installation.
It is possible for minor, incompatible changes introduced by a new release to cause temporary, user-visible problems. For example, changes to the format of credentials might invalidate sessions (i.e., DACS HTTP cookies) issued by the earlier release, requiring users to reauthenticate.
% cd src; sh ./config.nice
% gmake
% rm -f -r /usr/local/dacs/{acls,bin,include,lib,man,www}
% apachectl stop
% gmake install
% cd ../apache; gmake tag install
% apachectl start
or
% apachectl startssl
DACS is not currently supported on Microsoft Windows platforms. Cygwin[15], which provides a GNU/Linux-like environment for Windows, is not an officially-supported platform, but DACS releases usually build on it.
To run DACS utilities and commands on Windows (such as dacscheck), it appears to be sufficient to install the binaries along with the Cygwin run-time libraries that they require, such as /bin/cygwin1.dll and /bin/cygcrypt-0.dll.
The following describes how to install DACS.
% src/configure --help
Build these packages in the order in which they are listed below.
If you install a package, you may need to be root or use sudo(8)[18] (e.g., "sudo make install").
These packages are not distributed with DACS and have licensing terms completely separate from those of DACS that are your responsibility.
Third-Party Package Index:
This release of DACS has been tested with Expat[19]2.1.0 and we recommend that you use that release.
For use with DACS, Expat can either be built with -prefix=/usr/local or something like -prefix=/usr/local/expat-2.1.0, whichever you prefer. In the former case, you can omit the --with-expat when configuring DACS or use --with-expat=/usr/local, and in the latter case you must use --with-expat=/usr/local/expat-2.1.0. Here is how we usually build Expat after unpacking it:
% cd expat-2.1.0 % ./configure --prefix=/usr/local/expat-2.1.0 % make (All should go well.) % make install (All should go well here, too.)
% cd lib; ar rv libexpat.a *.o; ranlib libexpat.a
If the build fails, reconfigure using --enable-shared=no and --enable-static=yes and try to build it again.
DACS uses cryptographic functionality provided by OpenSSL[20]. This release of DACS has been tested with openssl-1.0.1e and we recommend that you use that release with DACS. Apache should be built using the version of OpenSSL recommended by the particular Apache release - using a more recent version of OpenSSL may introduce build problems or run-time bugs in Apache. It is not necessary for Apache and DACS to use the same release of OpenSSL.
% ./config --prefix=/usr/local/openssl-1.0.1e --openssldir=/usr/local/openssl-1.0.1e -fPIC shared
% ./Configure darwin64-x86_64-cc --prefix=/usr/local/openssl-1.0.1e --openssldir=/usr/local/openssl-1.0.1e -fPIC shared
You will need an SSL-capable Apache[23] server (build Apache with --enable-ssl) that uses a recent version of OpenSSL (build Apache using --with-ssl=path, see above[24]).
To build this subset, use --with-apache=omit when running configure. Please continue to review the information about third-party packages in this document, but you can ignore anything that follows that is related to Apache and mod_auth_dacs.
% cd httpd-2.4.3
% ./configure --prefix=/usr/local/apache2-2.4.3 --enable-ssl \
--with-ssl=/usr/local/openssl-1.0.1e
% make install
Detailed instructions for building Apache2.4.3 can be found in Apache's INSTALL file. For the testing platforms, we get the APR and APR-UTIL libraries from apr.apache.org[25] and unpack them in the Apache distribution's srclib directory, then rename them srclib/apr and srclib/apr-util, respectively, as it says in INSTALL. We currently use apr-1.4.6 and apr-util-1.5.1. When building httpd, run configure with the --with-included-apr flag.
On CentOS5.9, the Apache build initially failed with a complaint about not finding pcre-config. To solve this, we did:
yum install pcre-devel.x86_64
When configuring for the DACS build it was not necessary to use the --with-apache-apr flag.
% cd httpd-2.2.23
% cd srclib/apr
% ./configure --prefix=/usr/local/apache2-2.2.23/apr-httpd --disable-lfs CFLAGS=-fPIC
% make install
% cd ../apr-util
# See notes below for adding LDFLAGS
% ./configure --prefix=/usr/local/apache2-2.2.23/apr-util-httpd
--with-apr=/usr/local/apache2-2.2.23/apr-httpd
--with-expat=/usr/local/expat-2.0.1
--with-dbm=db51
% make install
% cd ../..
# See notes below for adding LDFLAGS
% ./configure --prefix=/usr/local/apache2-2.2.23 --enable-ssl
--with-ssl=/usr/local/openssl-1.0.1e
--with-apr=/usr/local/apache2-2.2.23/apr-httpd
--with-apr-util=/usr/local/apache2-2.2.23/apr-util-httpd
LDFLAGS="-rpath /usr/local/db-5.1.29/lib -rpath /usr/local/openssl-1.0.1e/lib"
% make install
This builds a very basic server; you can enable other options if you want.
Because we deal with multiple versions of third-party packages, each release is installed separately, hence the version numbers in the pathnames.
Your mileage may vary, but when doing the top level Apache configuration above on FreeBSD it was necessary to add "-rpath /usr/local/db-5.1.29/lib -rpath /usr/local/openssl-1.0.1e/lib" to LDFLAGS so that Apache commands could find shared libraries at run time.
On Linux, it was necessary to add "-Wl,-rpath /usr/local/db-5.1.29/lib -Wl,-rpath /usr/local/openssl-1.0.1e/lib" to LDFLAGS when building apr-util and at the top level.
Alternatively, on either platform the ldconfig command or LD_LIBRARY_PATH might be used.
It appears that the LDFLAGS above should be omitted on Mac OS X.
One solution is to make mod_ssl a built-in module instead of a dynamically loaded module. Build Apache using something similar to this (using the --enable-ssl=static flag is the important change):
% ./configure --prefix=/usr/local/apache2-2.4.3 --with-ssl=/usr/local/openssl-1.0.1e --enable-ssl=static
Then do a "make install". Note that you will need to comment out the httpd.conf directive that loads mod_ssl:
# LoadModule ssl_module modules/mod_ssl.so
Now, from the Apache installation directory, try:
% bin/httpd -l
If httpd cannot find your OpenSSL libraries, you will see an error message like this:
error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
Tell the linker where the OpenSSL libraries are by setting the LD_LIBRARY_PATH environment variable for httpd; for example:
% sh -c "export LD_LIBRARY_PATH=/usr/local/openssl-1.0.1e/lib; bin/httpd -M"
You may also be able to resolve the problem using the ldconfig command, but we don't know if that could possibly break other programs that expect a different version of the OpenSSL library. You will need to always set LD_LIBRARY_PATH before running httpd, maybe using an alias or script. If you use apachectl to manage Apache, you could simply have it set LD_LIBRARY_PATH (also see the Apacheenvvars script, which is sourced by apachectl).
<Directory /usr/local/dacs/www> Satisfy Any Allow from all Options Indexes FollowSymLinks </Directory>
You can see your httpd'sServer response-header by connecting to your server (e.g., using telnet) and engaging in an interaction with it similar to the following (note the last line of output):
% telnet localhost 80 Trying 127.0.0.1... Connected to localhost Escape character is '^]'. GET / HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 30 Aug 2011 21:27:17 GMT Server: Apache/2.2.23 (Unix) mod_auth_dacs/1.4.27(Release date 17-Oct-2012 00:00:01) mod_ssl/2.2.23 OpenSSL/1.0.1c
If you want to be able to store DACS configuration information in a database or need to access files managed by Apache'smod_auth_dbm, you may use Berkeley DB[29] from Oracle Corporation[30] (Sleepy Cat Software was acquired by Oracle in February, 2006). A suitable version may already be installed on your system. Version db-5.3.21 is being used for testing, but somewhat older or newer versions should be fine. See the DACS configure arguments: --enable-bdb[31], --disable-bdb[32], and --with-bdb[33].
% ln -sf /usr/local/bdb-5.3.21 /usr/local/BerkeleyDB.5.3 % ln -sf /usr/local/bdb-5.3.21 /usr/local/db53
% cd build_unix % ../dist/configure --prefix=/usr/local/bdb-5.3.21 % make (All should go well.) % make install (All should go well here, too.)
The SQLite[38] database, which can be used together with the dbm-type databases[27], is another option for storing DACS configuration information. Version 3.7.14.1 is being used for testing (we use the "autoconf" tarball). See the DACS configure arguments: --enable-sqlite[39], --disable-sqlite[40], and --with-sqlite[41].
% ./configure --prefix=/usr/local/sqlite-3.7.14.1
If you want to be able to authenticate against Microsoft NTLM (see local_ntlm_authenticate[42]), you must obtain Samba[43]. This release of DACS has been tested with samba-3.6.12, and we strongly recommend that you use that version. It is not known whether this release of DACS will work with any other version of Samba - we do not officially support them.
DACS NTLM authentication has been tested against Windows Server 2012.
% ./configure --enable-static=yes --with-ads=no --with-ldap=no --disable-swat --disable-cups --disable-pie \
--enable-external-libtalloc=no --enable-external-libtdb=no
% make
Then, when configuring DACS, specify the directory where Samba was unpacked, for example:
--with-samba=/local/src/samba-3.6.12
See the DACS configure arguments: --enable-ntlm-auth[44] and --with-samba[45].
If you need InfoCard support (see local_infocard_authenticate[46]), libxml2[47] and xmlsec1[21] are required. Build libxml2 and OpenSSL first, because xmlsec1[21] depends on both of them. This release of DACS has been tested with libxml2-2.9.0 and xmlsec1-1.2.18, and we strongly recommend that you use those versions. It is not known whether this release of DACS will work with any other versions - we do not officially support them.
% ./configure --prefix=/usr/local/libxml2-2.9.0
Due to an apparent bug in the code (in threads.c) that results in a syntax error, it was necessary to add --with-threads=no on some platforms, such as Mac OS X.
% ./configure --prefix=/usr/local/xmlsec1-1.2.18
--with-libxml=/usr/local/libxml2-2.9.0
--with-openssl=/usr/local/openssl-1.0.1e --with-gnu-ld
--enable-static-linking --disable-crypto-dl --disable-apps-crypto-dl
Except on Mac OS X:
% ./configure --prefix=/usr/local/xmlsec1-1.2.18 \
--with-libxml=/usr/local/libxml2-2.9.0 --with-gnu-ld --enable-static=yes \
--enable-shared=yes --with-nss=/Applications/Firefox.app/Contents/MacOS \
--with-nspr=/Applications/Firefox.app/Contents/MacOS \
--with-openssl=/usr/local/openssl-1.0.1e \
--disable-crypto-dl
*** Warning: Linking the shared library libxmlsec1-openssl.la against the *** static library /local/openssl-1.0.1e/lib/libcrypto.a is not portable!
After ensuring that libcrypto.so (or libcrypto.dylib) had been installed when building OpenSSL, to correct the xmlsec1 build problem we did "make clean", re-ran configure as above, and edited src/openssl/Makefile under the root of the xmlsec1 distribution directory to change all occurrences of "libcrypto.a" to "libcrypto.so". It was sometimes also necessary to delete the -ldl flag on those same lines, and in other Makefile files in the distribution (and making sure the flag was not specified by xmlsec1-config). After those changes, we ran make again. Additionally, it was sometimes necessary to specify CFLAGS="-I/usr/local/include -L/usr/local/lib".
Cannot restore segment prot after reloc: Permission denied
The solution was to issue the command (adjust the path as necessary):
% chcon -t texrel_shlib_t /usr/local/xmlsec1-1.2.18/lib/libxmlsec1-openssl.so
% setenv DYLD_LIBRARY_PATH /usr/local/xmlsec1-1.2.18/lib
Ensure that "gmake test" does not fail.
See the DACS configure arguments: --enable-infocard-auth[49] and --with-xmlsec1-config[48]
Authentication through LDAP or Microsoft Active Directory (see local_ldap_authenticate[50]) is implemented using OpenLDAP[51]. This release of DACS has been tested only with openldap-2.4.33 and we strongly recommend that you use that version.
It is not known whether this release of DACS will work with any other version of OpenLDAP - we do not support them. DACS may work properly with OpenLDAP versions at least as old as 2.2.24, if you really must use one of them.
DACS has been tested against Windows 2000 Server SP4.
If the --with-ldap flag is not given (in which case LDAP authentication must be enabled; e.g., via --enable-ldap-auth), configure will search for OpenLDAP headers and libraries; if found, it will assume they are a suitable version and use them.
If --with-ldap is given (either because OpenLDAP is not installed or an unsuitable version is installed), headers and libraries relative to the root of the specified directory will be used rather than any installed OpenLDAP files; it is not necessary to installOpenLDAP, you only need to build it - so you do not need to be concerned about hassles associated with upgrading or any other versions that might already be installed on your system.
To build OpenLDAP for DACS, from the root of your OpenLDAP distribution do:
% ./configure --disable-slapd --enable-static % make
If so instructed, do a "make depend" before the make.
See the DACS configure arguments: --enable-ldap-auth[52] and --with-ldap[53]
The history and editing functionality provided by the GNU Readline Library[54] can be nice to have when using dacsexpr(1)[55] interactively. This release of DACS has been tested with version 6.2, although we have used readline-6.0 and readline-6.1 with recent releases of DACS. Note that you may need to compile Readline with the -fPIC flag ("make CFLAGS=-fPIC").
It is not necessary for you to installreadline, you only need to build it - so you do not need to be concerned about hassles associated with upgrading or any other versions that might already be installed on your system.
#SHOBJ_LDFLAGS = -dynamic SHOBJ_LDFLAGS = -dynamiclib
See Build Options[57] for build alternatives and options to configure.
% cd src % ./configure % gmake
To confirm that DACS has been built with the third-party packages that you intended, from the run:
% ./version -v
You should ensure that the sslclient utility is working correctly. From the src directory, you can test it using the following command:
% perl -e 'printf "GET / HTTP/1.0\n\n";' | ./sslclient dacs.dss.ca:443
which should print the contents of https://dacs.dss.ca to the standard output. You should repeat this test substituting the name of your server and port.
% gmake test
If any error occurs during testing, testing will stop immediately and a message will be displayed. In this event, first check that you are using the recommended software packages and that your build flags are correct. Most often, problems are the result of mixing header files or library files from different versions of a third-party package (e.g., OpenSSL) or incorrect file permissions. If you cannot find anything wrong with your configuration, please submit a bug report that includes the self test output and describes your platform (you can include the output of "./version -v").
% gmake install
% (cd ../man; gmake touch) % gmake install
% gmake DESTDIR=/tmp/mydacs install
% man dacs
While it is occasionally handy to view the manual pages using the man command, the HTML documentation is far superior.
Please consult apache/README in the DACS distribution for details and, from the apache directory, do:
% gmake help
% cd apache % gmake tag % gmake install
Check that your httpd.conf has the appropriate LoadModule directive.
If you want mod_auth_dacs module[7] to be a static module:
% make install
% httpd -l
LoadModule auth_dacs_module modules/mod_auth_dacs.so
Alternatively, it may be sufficient to dynamically load mod_sslbeforemod_auth_dacs.
If mod_ssl symbols are unavailable when they are needed, you'll probably see a message like the following when you try to start httpd:
mod_auth_dacs.so: undefined symbol: ssl_hook_Fixup
If you built the module with a tag, verify that the DACS version identifier appears in SERVER_SIGNATURE. You can do this by hitting Apache'sprintenv CGI program from your browser or using a command like:
% http "http://myserver:myserverport/cgi-bin/printenv"
(first making sure that Apache'sprintenv CGI is executable) and examining the SERVER_SIGNATURE environment variable, or by running:
% telnet myserver myserverport
and typing:
OPTIONS * HTTP/1.0
followed by a blank line and examining the Server response header.
While you can view the documentation simply by pointing your web browser at the DACSwww directory, it is recommended that you make it available through Apache using its Alias[63] directive because the default site configuration (site.conf-std) expects handlers and DTDs to be available using certain URLs.
Add lines like the following to your httpd.conf:
Alias /dacs "/usr/local/dacs/www/" Alias /css "/usr/local/dacs/www/css/" Alias /dtd-xsd "/usr/local/dacs/www/dtd-xsd/" Alias /examples "/usr/local/dacs/www/examples/" Alias /handlers "/usr/local/dacs/www/handlers/" Alias /infocards "/usr/local/dacs/www/infocards/" Alias /man "/usr/local/dacs/www/man/" Alias /misc "/usr/local/dacs/www/misc/" Alias /mod "/usr/local/dacs/www/mod/"
To see the DACS DTD files from your browser, you can also add:
AddType text/plain .dtd
These .dtd files are only used to document XML structures and messages used by DACS and are cited in the documentation.
You should also uncomment these two directives in your site.conf file:
XSD_BASE_URL "/dacs/dtd-xsd" DTD_BASE_URL "/dacs/dtd-xsd"
DACS-wrapping a resource or set of related resources involves:
Configuring Apache involves, at minimum, adding directives like the following to the appropriate VirtualHost section of httpd.conf:
AddDACSAuth dacs-acs /usr/local/dacs/bin/dacs_acs "-t -v" SetDACSAuthMethod dacs-acs external SetDACSAuthConf dacs-acs "/usr/local/dacs/dacs.conf" <Location /cgi-bin/dacs> AuthType DACS AuthDACS dacs-acs Require valid-user # Note: For Apache 2.4, instead use: # Require dacs-authz Options ExecCGI </Location>
At this point, reviewing dacs.quick(7)[5] is strongly recommended. It provides a detailed example of what needs to be done to make your DACS operational and how to do some basic testing.
The interactive dacsinit utility can perform the steps described below quickly. You will find dacsinit in the distribution's src directory. It can be run anytime after DACS has been built and installed. It produces a directory structure for the federation, copies the distribution's site configuration file, creates a minimal dacs.conf for the federation and one jurisdiction, makes federation and jurisdiction encryption keys, and generates metadata for the jurisdiction. The resulting configuration can be used immediately by DACS commands and by DACS web services after Apache has been configured for DACS.
Passing the -d flag to dacsinit causes it to append a string to certain paths and filenames so that, for debugging or test purposes, it is unlikely to overwrite any "real" configuration files. Passing it the -n flag causes it to display what it would do without performing any of the actions.
Having installed DACS, the next major step is to do some initial configuration of your federation and jurisdiction(s). At each jurisdiction in your federation you will need to do the following:
Having configured Apache and DACS, you should try some basic DACS web services to make sure that they are working properly before you go on to make customizations.
For example, invoke dacs_version(8)[14] from your browser to check that it is properly DACS-wrapped (adjust the URL for your environment):
% http "http://myserver/cgi-bin/dacs/dacs_version"
Review the DACS log files (default: /usr/local/dacs/logs/*) to see what happened. You can also try dacsversion(1)[69] from the command line.
You should verify that dacs_list_jurisdictions(8)[11] works properly.
The next step is to configure an authentication method - see dacs_authenticate(8)[8] and try to authenticate. Once that appears to be working, you can try dacs_current_credentials(8)[9], dacs_prenv(8)[10], dacs_conf(8)[12], and dacs_signout(8)[13].
Running configure generates config.nice (over-writing any previous contents), which can be executed at some later time if you want to re-run configure with the same arguments.
After you are happy with your configuration, consider squirrelling away a copy of config.nice in case you want to reconfigure DACS or for use with later releases of DACS.
It is possible to "bundle" several of the DACS utility programs together into a single binary called dacs. This is similar to what OpenSSL does with its openssl command. Instead of running:
% dacsacl ...
you would run:
% dacs dacsacl ...
Running dacs without arguments displays the list of built-in utilities. Some utilities have multiple names that are equivalent; these appear in a comma-separated list. To build this combined command, add the flag bundle=yes to command lines when building and installing:
% gmake bundle=yes % gmake bundle=yes install
The commands that are bundled into the dacs command won't be built as separate programs. To build and install both bundled and unbundled commands:
% gmake bundle=both % gmake bundle=both install
Command: gmake or "gmake build"
Command: "gmake install"
Command: "gmake clean"
Command: "gmake distclean"
Command: "gmake extraclean"
% autoconf -I../include
and then run configure.
Command: "gmake uninstall"
Other useful build commands (these should be self-explanatory):
% gmake build-services % gmake build-progs % gmake build-static % gmake build-shared % gmake build-static-services % gmake build-shared-services % gmake build-static-progs % gmake build-shared-progs % gmake build-shared-lib % gmake install-libs % gmake install-shared-lib % gmake install-static-lib % gmake install-progs % gmake install-services
Configure Options
To verify that this documentation is up-to-date, please run:
% configure --help
This will also tell you which features are enabled (or disabled) by default. Standard build and install options.PP
--prefix=PREFIX
--exec-prefix=EPREFIX
--bindir=DIR
--libdir=DIR
--includedir=DIR
--mandir=DIR
--enable-shared
--enable-static
--disable-prefix-check
--enable-access-tokens
--enable-all-auth
--enable-apache-auth
--enable-bdb
--enable-cas-auth
--enable-cert-auth
--enable-dacs-conf
--enable-dacs-log
--enable-debug
--enable-developer
--enable-fts
--enable-gdbm
--enable-grid-auth
--enable-infocard-auth
--enable-java
--enable-ldap-auth
--enable-local-roles
--enable-native-auth
--enable-ndbm
--enable-ntlm-auth
--enable-pam-auth
--enable-passwd-auth
--enable-rule-patterns
--enable-simple-auth
--enable-sqlite
--enable-token-auth
--enable-unix-roles
--enable-user-info
--with-apache=DIR
--with-apache-apr=DIR
--with-apache-apr-config=PATH
--with-apache-apr-cpp-defs=FLAGS
#define LINUX 2 #define _REENTRANT #define _GNU_SOURCE #define _LARGEFILE64_SOURCE
--with-apache-apr-includes=DIR
--with-apxs=PATH
--with-bdb=DIR
--with-cgi-bin=DIR
--with-cgi-suffix=SUFFIX
--with-dacs-conf=PATH
--with-dacs-log=PATH
--with-expat=DIR
--with-federations-root=DIR
--with-htdocs=DIR
--with-iconv=DIR
--with-jdk-bin
--with-jdk-includes
--with-ldap=DIR
--with-mailer-prog=PATH
--with-mailer-args=STRING
--with-readline=LIB
--with-samba=DIR
--with-sendmail=PATH
--with-sqlite=DIR
--with-ssl=DIR
--with-xmlsec1-config=PATH
To specify additional flags for compiling or linking DACS, set CFLAGS or LDFLAGS, respectively.
To specify additional flags for compiling or linking the mod_auth_dacs module[7], set APACHE_CFLAGS or APACHE_LDFLAGS, respectively. For example, this command will cause mod_auth_dacs to be built with the -m64 flag and DACS to be built with both the -m64 flag and the -O3 flag:
% ./configure "APACHE_CFLAGS=-m64" "CFLAGS=-O3 -m64" ...
dacs(1)[76], dacs.readme(7)[6], dacs.quick(7)[5]
Distributed Systems Software (www.dss.ca[77])
Copyright2003-2013 Distributed Systems Software. See the LICENSE[78] file that accompanies the distribution for licensing information.