# uname -a


Mot-clé - fastcgi

Fil des billets - Fil des commentaires

samedi 8 février 2014

Conflict between broken Apache packages makes FCGI angry (mod_fcgid: can't lock process table)

Here is is a quick note on the fix I made today for a messed up Apache server.

The environment

Apache2 + Debian + mod_suexec + mod_fcgi

The problem

The server was down only for PHP-running websites. It triggered a connexion reset when trying to run PHP scripts. Static content and reverse proxies were working correctly, as if nothing was happening.

In the server logs, the following error was present :

mod_fcgid: can't lock process table

The suexec log was showing no anomaly.

The server wasn’t gracefully stopping anymore, and I had to kill him with the -9 signal to stop it.

The cause

Searching around the web was giving me very few clues on the problem. I couldn’t find why the CGI subprocess was broken, it is spawned by Apache and so it should not be missing permissions (there is no CGI daemon listening in Apache setup, contrary to Nginx)

What causes the Apache subprocesses to get spawned ? Either the Apache mpm-workers, or mpm-prefork, or mpm-event or mpm-itk. I knew I was using workers, but a glance in APT installed packages showed me broken packages on workers and ITK. Wait… ITK ?

Actually, I run Puppet, and Puppet was configured to keep Apache ot its latest version from repositories. With the release of a newer version of Apache, it had updated the apache2 package … and installed apache2-mpm-itk while apache2-mpm-workers was still present !

The result was a conflict while trying to spawn CGI processes, and a crash of the subprocess.

The fix

Doing a remove apache2-mpm-itk, and force-reinstall apache2-mpm-workers did the job.

dimanche 25 août 2013

Configure Munin graphs with Nginx, FastCGI, and Debian 7

Setting up Munin with Nginx can be a little harsh. Here is the ready-to-go solution for Debian Wheezy.

Lire la suite...

samedi 29 juin 2013

osTicket, wget, crontab and FastCGI

After a long night trying to get HTTP cron for osTickets to work, here is my solution :

Things to know

  • Rewritting the URLs of a FastCGI-running PHP application, using Apache2 mod_rewrite on PATH_INFO is broken, it does not work. Never.
  • osTicket needs POST requests to its API.
  • osTicket uses an unsafe way to get PATH_INFO, obviously it will not work with FastCGI.

How to get it work

Open includes/class.osticket.php

Replace :

        //TODO: conruct possible path info.

With :

        $path_info = str_replace(BASE_URI."/", "", $_SERVER['REQUEST_URI']);
        if (!empty($path_info))
                return $path_info;

And call the cron like that :

 /usr/bin/wget -q --no-cache -O /dev/null --post-data '' --header='X-API-Key:your_api_key_here' 'http://example.com/api/http.php/tasks/cron'