# I will explain why i used this configure options. The first one is because i do not want this new apache to mess up with
# my production webserver. So is the --with-port setting. userdir and asis are modules which are enabled by default but i have never
# used so I do not really need them. For full configure options you can check http://httpd.apache.org/docs/2.2/programs/configure.html
# Because i used a server which has Plesk installed i gave and system user called apache already.
# The default apache user however is www. so you can drop that option if you want.
# The main reason why i put this is because suexec usually has a a setting for what could be the minimum user and group id (uid and gid respectfully) who can call it.
# Usually that is set to 100 and when user www is added it has uid=gid=80 so we will either have to change the UID and GID to something higher or set apache to use some other user.
# apache user added by plesk has uid=gid=2524 so it is perfect for our case.
# --with-suexec-docroot is again optional. I used it cause I like my virtual hosts to be in directory called vhosts. The default docroot is $PREFIX/docs .
# If you plan to run 1 website (which probably is not the case) or just have your websites in $PREFIX/docs/domain1.com , $PREFIX/docs/domain2.com and so on, probably you can drop that option too.
# If you put the virtual hosts on vhosts $PREFIX/vhosts and do not change --with-suexec-docroot suexec will throw errors that the script is not in its docroot.
# next is to install apache. If you have received any errors along the way of the configuration your best shot is to ask google about it.
make
make install
# now apache should be ready to be used. So lets move on to get mod_fastcgi installed.
cd /opt/apache/source
wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
tar xvf mod_fastcgi-2.4.6.tar.gz
cd mod_fastcgi
# next instructions ave been taken from here : http://www.fastcgi.com/mod_fastcgi/INSTALL.AP2
cp Makefile.AP2 Makefile
make top_dir=/opt/apache
make top_dir=/opt/apache install
# Now apache and mod_fast are almost ready. You have to enable the module in httpd.conf. I prefer to take this out of the main configuration file.
# I have created a file /opt/apacheconf/extra/httpd-fastcgi.conf with this content
# note that the directory /opt/apache/docs/fcgi_ipc/tmp have to be created and and apache should be able to read and write to it
# the permission on my system are 660
# now apache and mod-fastcgi are ready. so we will proceed in installing php
mkdir /opt/php
mkdir /opt/php/source
cd /opt/php/source
# I have installed 4.4.7 because my websites are not updated to work on php 5.x series. A very useful resource for that case is http://museum.php.net/
# This configuration again is just for what my websites require. The most important thing is that you should have --enable-fastcgi
# the rest is just what you find best for your needs. We proceed with the install
make
make install
# now we are set to get php added to the mix.
# lets say we have one domain that will work here /opt/apache/vhosts/domain1.com
# for the needs of the php-wrapper I create a directory create /opt/apache/vhosts/domain1.com/php-fastcgi
# In that directory i create a shell script called php-wrapper with the following entries
# Just i will note one of the cool things about this file. Here you can specify PHPRC environmental variable for where the php.ini file for the virtual host is
# Here is a second example foe php-wrapper file