A simple example
In the following examples I’m going to assume a few things:
- All software is installed in
/opt
- You’re able to add and change virtual hosts at will
- We’ll use some directories in
/srv/www
- The Web server is on the machine with the IP address 192.168.1.100
If that’s not the case on your system, make sure to adapt the examples according to your setup.
To enable
mod_fastcgi
add this line to your
httpd.conf
:
LoadModule fastcgi_modules modules/mod_fastcgi.so
Also make sure to comment all lines loading
libphp5.so
.
For the first test, let’s create a new virtual host:
<VirtualHost *>
ServerName fcgi.test.local
FastCGIExternalServer /srv/www/fcgi -host 127.0.0.1:9000
DocumentRoot /srv/www/fcgi
<Directory /srv/www/fcgi>
AllowOverride All
Order Allow,Deny
Allow from all
</Directoy>
</VirtualHost>
As you can see, in the first example the path option for the
FastCGIExternalServer
directive is exactly the same as the
DocumentRoot
.
By doing this, you’re basically telling Apache, that everything that resides in this very directory should be handled by
mod_fastcgi
which in turn will pass it on to the external server we specified.
So, let’s check it out.

Pingback: External FastCGI With Apache « IT Know-It-All