# Building APACHE with Mod_SSL  (Solaris)

# Using gcc version 3.2.2

# Get mm and build it
cd /usr/local/src/greg/New-apache-with-ssl-kmh/mm-1.2.2
./configure  --prefix=/usr/local --disable-shared
make test
make install

# Get OPENSSL & build it (in /usr/local/ by default)
cd /usr/local/src/openssl-0.9.6i
./config no-threads shared -fPIC
make
make test
make install

#
#extract apache source and build it
#
export LDFLAGS="-R/usr/local/ssl/lib"
export SSL_BASE=/usr/local/src/openssl-0.9.6i
# or export SSL_BASE=/usr/local/ssl if you have installed it there,
# (either will work).
export EAPI_MM=../mm-1.2.2

cd /usr/local/src/greg/New-apache-with-ssl-kmh
cat apache_1.3.27.tar.gz | gunzip | tar -xvf -

#extract mod_ssl and patch apache
cat mod_ssl-2.8.12-1.3.27.tar.gz | gunzip | tar -xvf -
cd mod_ssl-2.8.12-1.3.27
./configure --with-apache=/usr/local/src/greg/New-apache-with-ssl-kmh/apache_1.3.27 \
    --with-ssl=/usr/local/src/openssl-0.9.6i --with-mm=../mm-1.2.2 --enable-shared=ssl \
    --enable-rule=EAPI

#after adding all necessary patches build apache

cd /usr/local/src/greg/New-apache-with-ssl-kmh/apache_1.3.27

# Add --enable-module=xxx for each extra module that needs to be added
#./configure --enable-module=rewrite --prefix=/usr/local/apachedev --enable-shared=ssl
# --enable-rule=SHARED_CORE --enable-rule=SHARED_CHAIN --enable-module=so
# --enable-module=ssl --enable-rule=EAPI

./configure --enable-module=all  --prefix=/usr/local/apache-1.3.27 \
   --enable-shared=max --enable-rule=SHARED_CORE --enable-rule=SHARED_CHAIN \
   --enable-module=so --enable-module=ssl --enable-rule=EAPI \
   --disable-module=auth_db

make
# if necessary 'make certificate '
make install

# Build PHP
cd ../php-4.2.2
 ./configure --with-mysql=/usr/local/mysql \
   --with-imap=/usr/local/src/imap-2002b \
   --with-imap-ssl=/usr/local/ssl \
   --with-apxs=/usr/local/apache-1.3.27/bin/apxs

#Now edit the httpd.conf file and set it up. Now start apache with the
# apachectl startssl
# If you get the following error message:

Syntax error on line 237 of /usr/local/apache-1.3.27/conf/httpd.conf:
Cannot load /usr/local/apache-1.3.27/libexec/libssl.so into server: ld.so.1: /usr/local/apache-1.3.27/bin/httpd: fatal: libssl.so.0.9.6: open failed: No such file or directory
./apachectl startssl: httpd could not be started

#Then either
#   set LD_LIBRARY_PATH=/usr/local/ssl/lib
#or
#   edit src/modules/ssl/Makefile
#
#and change SSL_LDFLAGS= -L$(SSL_LIBDIR)
#    to     SSL_LDFLAGS= -L$(SSL_LIBDIR) -R/usr/local/ssl/lib
#
#Then rebuild and install it
cd /usr/local/src/greg/New-apache-with-ssl-kmh/apache_1.3.27
make
make install
/usr/local/apache-1.3.27/bin/apachectl startssl