Apache 2.2 mit LDAP, PHP und WebDAV auf Solaris
Software Komponenten
- OpenSSL, www.openssl.org
- OpenLDAP, www.openldap.org
- Apache Webserver, httpd.apache.org
- LibXML, www.xmlsoft.org
- UW IMAP Client, www.washington.edu/imap
- PHP, www.php.net
Kompilation und Installation
Kompilieren unter Solaris 9. Alles muss mit GCC 3.4.x kompiliert werden. Neuere GCC-Versionen bringen Apache zum Absturz wen PHP5 verwendet wird. Alles wird nach /opt/apache installiert, um alles in ein SysV Paket zu packen. Folgende Umgebungsvariablen setzen:
PATH="/opt/gnu/gcc/3.4.1/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin" CC="gcc" CFLAGS="-O3 -fPIC -Wall" CXX="g++" CXXFLAGS="-O3 -fPIC -Wall" CPPFLAGS="-I/opt/apache/include" LDFLAGS="-R/opt/apache/lib -L/opt/apache/lib" LD_OPTIONS="$LDFLAGS" unset LD_LIBRARY_PATH export PATH CC CFLAGS CXX CXXFLAGS LDFLAGS CPPFLAGS LD_OPTIONS alias make=gmake
Mit GCC kompilierte Programme sind gegen libgcc_s.so verlinkt. Diese ins Paketverzeichnis kopieren.
mkdir -p /opt/apache/lib/sparcv9
cd /opt/apache/lib
cp /opt/gnu/gcc/3.4.1/lib/libgcc_s.so.1 .
ln -s libgcc_s.so.1 libgcc_s.so
cd /opt/apache/lib/sparcv9
cp /opt/gnu/gcc/3.4.1/lib/sparcv9/libgcc_s.so.1 .
ln -s libgcc_s.so.1 libgcc_s.so
OpenSSL
cd /tmp
gtar -xvpzf openssl-0.9.8d.tar.gz
cd openssl-0.9.8
./config --prefix=/opt/apache \
--openssldir=/opt/apache/openssl shared \
-R/opt/apache/lib -L/opt/apache/lib
gmake
gmake install
cd -
Den Pfad von Perl in /opt/apache/bin/c_rehash ändern in /usr/bin/perl.
OpenLDAP
Es werden nur Clientprogramme, Header-Dateien und Bibliotheken benötigt, um Apache und PHP mit LDAP-Support zu kompilieren.
gtar -xvpzf openldap-2.3.31.tgz
cd /tmp/openldap-2.3.31
./configure --prefix=/opt/apache \
--sysconfdir=/etc/opt/apache \
--disable-slapd --disable-slurpd \
--localstatedir=/var/opt/apache \
--with-tls
gmake depend
gmake
gmake install
cd -
Apache Webserver
Der Apache Webserver wird mit Unterstützung für SSL, LDAP, WebDAV und Digest-Authentsierung kompiliert. Die Installation ist etwas trickreich, da LDAP-Unterstützung auf Apache eher neu ist.
Als erstes apr ohne LDAP kompilieren.
gtar -xvzf httpd-2.2.3.tar.gz
cd /tmp/httpd-2.2.3/srclib/apr
./configure --prefix=/var/opt/apache \
--exec-prefix=/opt/apache \
--includedir=/opt/apache/include \
--infodir=/opt/apache/info \
--mandir=/opt/apache/man \
--sysconfdir=/etc/opt/apache \
--datadir=/var/opt/apache
gmake
gmake install
Dann das apr-util mit LDAP-Unterstützung mithilfe des zuvor kompilierten apr kompilieren.
cd ../apr-util
./configure --prefix=/var/opt/apache \
--exec-prefix=/opt/apache \
--includedir=/opt/apache/include \
--infodir=/opt/apache/info \
--mandir=/opt/apache/man \
--sysconfdir=/etc/opt/apache \
--datadir=/var/opt/apache \
--with-apr=/opt/apache \
--with-ldap=ldap \
--with-ldap-include=/opt/apache/include \
--with-ldap-lib=/opt/apache/lib
gmake
gmake install
Erst jetzt kann Apache mit allen Modulen kompiliert werden.
cd /tmp/httpd-2.2.3
./configure --prefix=/var/opt/apache \
--exec-prefix=/opt/apache \
--includedir=/opt/apache/include \
--infodir=/opt/apache/info \
--mandir=/opt/apache/man \
--sysconfdir=/etc/opt/apache \
--datadir=/var/opt/apache \
--enable-ssl \
--with-ssl=/opt/apache \
--with-ldap=ldap \
--with-ldap-include=/opt/apache/include \
--with-ldap-lib=/opt/apache/lib \
--with-apr=/opt/apache \
--with-apr-util=/opt/apache \
--enable-authnz-ldap \
--enable-ldap \
--enable-dav \
--enable-dav-fs \
--enable-dav-lock \
--enable-auth-digest \
--enable-so
gmake
gmake install
cd -
LibXML
gtar -xvzf /tmp/libxml2-2.6.26.tar.gz
cd /tmp/libxml2-2.6.26
./configure --prefix=/opt/apache \
--datadir=/var/opt/apache \
--sysconfdir=/etc/opt/apache
gmake
gmake install
cd -
UW IMAP Client
gtar -xvzf /tmp/imap-2006c1.tar.Z cd /tmp/imap-2006c1 gmake gso SSLDIR=/opt/apache EXTRACFLAGS="-O3 -fPIC" mkdir /opt/apache/include/c-client cp c-client/*.h /opt/apache/include/c-client cp c-client/c-client.a /opt/apache/lib/libc-client.a cd -
PHP
gtar -xvzf /tmp/php-5.2.0.tar.gz
cd /tmp/php-5.2.0
./configure --prefix=/opt/apache \
--with-apxs2=/opt/apache/bin/apxs \
--with-ldap=/opt/apache \
--with-imap=/opt/apache \
--with-imap-ssl=/opt/apache \
--with-ssl=/opt/apache \
--with-libxml-dir=/opt/apache \
--with-config-file-path=/etc/opt/apache \
--enable-safe-mode \
--without-pear
gmake
gmake install
cd -
Konfiguration
Dateien, welche mit WebDAV geschrieben werden, werden alle mit dem Benutzer des Webservers erstellt.
<VirtualHost *:443>
ServerName dav.example.com
ServerAlias *
ServerAdmin webmaster@example.com
DocumentRoot /davhome
SSLEngine on
SSLProtocol +SSLv3 +TLSv1
# Apple Finder does not provide client certificates
# SSLVerifyClient require
SSLVerifyClient optional
SSLSessionCacheTimeout 600
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/opt/apache/certs/dav.example.com_cert.pem
SSLCertificateKeyFile /etc/opt/apache/certs/dav.example.com_key.pem
SSLCACertificateFile /etc/opt/apache/certs/ca_example.com.pem
SSLCACertificatePath /etc/opt/apache/certs/ca
CustomLog logs/access_ssl_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
# WebDAV
DavLockDB /var/opt/apache/webdav/DavLock
DavMinTimeout 600
<Location /bart_simpson>
Dav On
ForceType text/plain
Order Allow,Deny
Allow from all
AuthType Basic
AuthBasicProvider ldap
AuthName DAV_bart_simpson
AuthLDAPURL ldap://127.0.0.1:389/ou=people,dc=example,dc=com?uid?one?(objectClass=person)
Require ldap-user bart_simpson
</Location>
</VirtualHost>
<Directory "/davhome">
Options +Indexes -FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>