#! /bin/sh # setup-fcgid (Bourne shell script) -- for Debian/Ubuntu set -e source_dir=$(dirname "$0") install -d /usr/local/lib/fcgi-bin install --preserve-timestamps "$source_dir/php.fcgi" /usr/local/lib/fcgi-bin/ ## ver=$(dpkg-query -W apache2 | sed 's/apache2[[:space:]]*\(.\..\).*/\1/') # Stop the next step from removing stuff dependent on php-common # (note this is a separate package to php*-common) # and from installing libapache2-mod-php* apt-get install -y php-common php-cgi # Install worker package and other stuff apt-get install -y libapache2-mod-fcgid \ apache2-suexec-custom apache2 \ php ## # Avoid problems with /etc/apache2/mods-available/php5.conf being left behind ## # (only shows up when mod_userdir is installed, due to conditional use of "php_admin_value") ## apt-get purge -y libapache2-mod-php5 install -m 644 --preserve-timestamps \ "$source_dir/local_fcgid.conf" /etc/apache2/conf-available/ a2enconf local_fcgid.conf if [ -d /srv/web ] ; then if [ ! -f /etc/apache2/suexec/www-data.dist ] ; then cp -p /etc/apache2/suexec/www-data /etc/apache2/suexec/www-data.dist fi sed -i '1 s@^/var/www@/srv/web@' /etc/apache2/suexec/www-data fi ## ls /etc/apache2/mods-available/php*.load | tail -n 1 ## a2dismod php5 ## a2dismod mpm_event ## a2dismod mpm_prefork ## a2enmod mpm_worker a2enmod suexec echo "NOTE: Ensure you disable the php* module if libapache2-mod-php* is installed" echo echo "Restarting Apache..." service apache2 restart echo "Done."