# Build the OpenSSL Libraries first...
cd /usr/src/openssl
./config
make
make test
make install

# Building the FreeTDS library now.  This allows PHP scripts to access a
#SQL Server database.
cd /usr/src/freetds
./configure --with-tdsver=4.2 --enable-msdblib --enable-dbmfix --with-gnu-ld --$
make
make install

#Building apache2 with modules support for PHP.
cd /usr/src/httpd
./configure --prefix=/usr/local/apache2/ \
            --disable-autoindex \
            --enable-rewrite \
            --enable-module=so \
            --enable-ssl
make
/usr/local/apache2/bin/apachectl stop
make install
/usr/local/apache2/bin/apachectl start

#Finally build PHP for web scripting.
cd /usr/src/php
rm configure
rm config.cache
./buildconf
./configure --with-mysql \
            --with-apxs2=/usr/local/apache2/bin/apxs \
            --with-sybase-ct=/usr/local/freetds \
            --with-zlib \
            --enable-dbg=shared \
            --with-dbg-profiler
make
make install

echo "If this is a fresh install..."
echo "cp /usr/src/php/php.ini-recommended /usr/local/lib/php.ini"
echo ""
echo "Add the following to httpd.conf..."
echo "<Files *.php>"
echo "SetOutputFilter PHP"
echo "SetInputFilter PHP"
echo "</Files>"
