How to create a very simple external FastCGI configuration in apache?

Posted by Thiado de Arruda on Server Fault See other posts from Server Fault or by Thiado de Arruda
Published on 2011-10-11T18:04:37Z Indexed on 2013/11/01 3:58 UTC
Read the original article Hit count: 543

Filed under:
|
|

I have an externally started FastCGI application that listens on socket '/tmp/foo.sock' and a directory of static files in '/srv/static'. Apache has all needed permissions on the socket and the directories.

What I need : All requests starting with '/static' should be handled by apache using the contents of '/srv/static'. All other requests should be handled by the FastCGI application. Here is my current virtual host configuration:

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName www.foo.com
        ServerAlias foo.com

        Alias /static /srv/static

        FastCgiExternalServer /* -socket /tmp/foo.sock    

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

</VirtualHost>

Even though this seems simple, its giving me quite the headache. According to http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html#FastCgiExternalServer the first parameter to 'FastCgiExternalServer' should be a 'filename' that when matched will cause apache to delegate the request to the external FastCGI app. What am I missing here?

© Server Fault or respective owner

Related posts about apache2

Related posts about fastcgi