FastCGIExternalServer demystified

« 1 2 3 4 5 6 7 8 9View All»

Action, please!

Using the

Action

keyword you can instruct Apache to call whatever action you wish. So let’s modify our virtual host yet again:

<VirtualHost *>
    ServerName    fcgi.test.local
    FastCGIExternalServer /fcgi/www/fcgi -host 127.0.0.1:9000
    AddHandler php-fastcgi .php
    Action php-fastcgi /virtualpath
    DocumentRoot /srv/www/fcgi
    <Directory /srv/www/fcgi>
        AllowOverride   All
        Order           Allow,Deny
        Allow           from all
    </Directoy>
</VirtualHost>

This will tell Apache that whenever the action php-fastcgi is to be executed, the script

/virtualpath

should be run with the needed additional information passed to it via environment variables.
Ok, don’t bother with the fact that Apache wants to start a script, we’re going to deal with this in a minute. The important thing here is that

/virtualpath

really is virtual in the sense that it should not exist in the file system.

Looking at what we have right now you’ll most likely think that we’re even farer away from the goal than when we started. You’re right there, and now we’re going to fix that.


Incoming search terms:

This entry was posted in PHP, Software, the ugly truth and tagged , , . Bookmark the permalink.

3 Responses to FastCGIExternalServer demystified

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

  2. Mattes says:

    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…

  3. Stefan Rubner says:

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>