Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup Apache2.2 with mod_fcgid and libapache2-mod-perl2 with no luck.

I've created a fcgi-bin directory in the root directory of my website and put there a test.fcgi file with the following content:


use CGI;

print "This is test.fcgi!\n";

While trying to access it via I get error 500 (Internal Server Error).

Here is my vhost config:

  DocumentRoot /var/www/data/
  SuexecUserGroup user group 
  AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml

  <Directory "/var/www/data/">
    Options +ExecCGI
    Allow from all
    Order allow,deny
    AddHandler fcgid-script .fcgi



<IfModule mod_fcgid.c>
  AddHandler fcgid-script .fcgi
  SocketPath /var/lib/apache2/fcgid/sock
  IdleTimeout 3600
  ProcessLifeTime 7200
  MaxProcessCount 8
  DefaultMaxClassProcessCount 2
  IPCConnectTimeout 8
  IPCCommTimeout 60

SuExec log:

[2010-04-06 03:02:47]: uid: (500/equ) gid: (502/equ) cmd: test.fcgi

Apache error log:

[Tue Apr 06 03:02:51 2010] [notice] mod_fcgid: process /var/www/data/ exit(communication error), terminated by calling exit(), return code: 0
[Tue Apr 06 03:02:53 2010] [notice] mod_fcgid: process /var/www/data/ exit(server exited), terminated by calling exit(), return code: 0

I've no clue why I'm getting error 500, but when I'm trying to access this file using console ($ perl /var/www/data/ everthing works fine without any errors...

Any suggestions on how to solve this problem would be greatly appreciated.

Thank you!

share|improve this question
up vote 0 down vote accepted

The problem was I had to install Perl module for FastCGI with the following command:

perl -MCPAN -e 'install FCGI'
share|improve this answer
Not only install the module but also use it in your scripts. ;) Remember: The FastCGI protocol is different from the CGI protocol and you can't just run your ordinary CGI scripts as FastCGI. – joschi Apr 6 '10 at 9:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.