Table of Contents

AMP Stack: Apache Configuration

There are going to be some changes to the Apache configuration. Remove the default virtual hosts directives (since we'll set them ourselves), and enable the fcgid module.

Ubuntu

Enable modules:

a2enmod auth_digest authz_default authz_host authz_user deflate headers info rewrite ssl status suexec version vhost_alias fcgid 
a2dismod auth_basic authz_groupfile cgid

Edit site configuration files:

sed -i -e 's/domain\.com/client\.com/g' /etc/apache2/sites-available/{www,ssl}

Enable the sites:

a2dissite default default-ssl
a2ensite www ssl
service apache2 restart

Gentoo

Edit /etc/conf.d/apache2 to look like this:

APACHE2_OPTS="-D INFO -D STATUS -D SSL -D LANGUAGE -D FCGID -D SUEXEC"

Also, create a new file in /etc/apache2/vhosts.d so that the proper virtual host directives are set.

Create /etc/apache2/modules.d/99_sites.conf:

Listen 80
NameVirtualHost *:80
DirectoryIndex index.php index.html
<IfDefine SSL>
Listen 443
</IfDefine>

FCGI Configuration

By default, Apache's setting for timeouts running a script as FCGI is 40 seconds. You can increase this value by setting FcgidIOTimeout in the VirtualHost configuration.

You'll know if you are having timeout issues if you see this error in your Apache logs:

mod_fcgid: read data timeout in 40 seconds