Note that there are some explanatory texts on larger screens.

plurals
  1. POPerl CGI or CGI::Fast under Apache 2.2 on Debian Lenny
    text
    copied!<p>I have 2 different web servers on a Debian Lenny machine. One is running FastCGI (TRAC) and the other web server is running PHP and some CGI scripts. So I have currently the 2 Apache2 modules enabled (cgi and fcgi) and the 2 vhosts setup accordingly. I have no other particular interest for these both modules running at the same time.</p> <p>So I want to keep ONLY Apache fastcgi module running as it looks to be the more efficient one.</p> <p>Could you pls confirm the following assessments to be right or correct ?<br> 1- I will have nothing to do/change for the TRAC site (already running fcgi)<br> 2- I will have to tune the other web server vhost to be set with an handler to fastcgi scripts<br> 3- I will have to change only the perl modules from "use CGI" to "use CGI::Fast"<br> 4- I will be able to keep the rest of the perl existing CGI scripts w/o other changes<br> 5- I do not need to use CGI::Apache but CGI::FastCGI (i/o the current CGI module) in the web server scripts </p> <p>I hope my point is clear as it's all a bit foreign to me ... </p> <p>Thx</p> <p><strong>EDIT</strong>:<br> thx for the hints to Naveed and J-16,<br> Here is what I did to get it working if it can help others : </p> <ul> <li><p>hum, installed CGI::Fast with CPAN, then it works better..<br> On Debian with libperl already installed</p> <pre><code>perl -MCPAN -e shell cpan&gt; install CGI::Fast </code></pre></li> <li><p>changed filename from *.cgi to *.fcgi,</p></li> <li>included the fastcgi while loop as adviced below by Naveed,</li> <li>setup the apache concerned vhost with the right handler for fastcgi (See <a href="http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html" rel="nofollow">fastcgi doc</a>)</li> <li>enabled the Apache fastcgi module (a2enmod fastcgi) and disabled the cgi module,</li> <li>checked the fastcgi.conf file in the Apache settings,</li> <li>restarted Apache,</li> <li>checked the fastcgi running as an Apache sub process (ps -afx),</li> <li>fixed some script issues, already in.. but newly appearing when running fastcgi, as adviced (errors detected by checking the Apache logs),</li> <li><p><strong>EDIT</strong>: adapted the file upload code as the initial script did not work anymore (still don't understand why), so I had to replace the while loop by a such one:</p> <pre><code>open(FILE,"&gt;$upload_dir/$file_name") while ($bytes_count = read($file_query,$buffer,2096)) { $size += $bytes_count; print FILE $buffer; } close(FILE); </code></pre></li> <li><p>done.</p></li> </ul> <p>World is not yet perfect but it finally works.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload