#Building apache2 with modules support for PHP.
cd /usr/src/httpd
./configure --prefix=/usr/local/apache2/ \
            --disable-autoindex \
            --enable-rewrite \
            --enable-module=so 
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 \
            --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>"
