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.
Incoming search terms:
- FastCgiExternalServer
- fastcgiexternalserver example
- apache FastCgiExternalServer
- fastcgiexternalserver not allowed here
- scsi_cmnd_start(1045) unsupported 93
- fastcgiexternalserver apache
- FastCGIExternalServer environment variables
- fastcgiexternalserver not working
- FastCGIExternalServer alias
- php fastcgi virtualpath

Pingback: External FastCGI With Apache « IT Know-It-All
Great article, but how did you solve the problem with the trailing index.php?
If I call the domain, the php file are provided as a download.
If I add index.php, I get redirected to /virtualpath/index.php/ which results in a 404. Everything else works like a charm…
Can’t really say what the problem with your setup is. Either it’s a missing “DirectoryIndex index.php” statement in the htpd.conf file or your settings for calling the FCGI process are a bit borked. If you could post the settings for your vhost, maybe I could help more then.