Re[2]: FastCGI and CGI Library -> Build FastCGI and Apache -> Perl ProcManager

Jack <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hello Ed,

Thanks for the reply. No, I haven't tried it on Apache 1.3 yet.
On Apache 2, mod_fastcgi builds correctly and works fine
if when I'm not using the library. The library I use is known to
have some strange problems. I suspect it's due to the way it uses
global variables, etc. but I'm not very sure.

What was the problem you had earlier with later versions of Apache?
If it's similar, I'll try Apache 1.3.

Marc Prewitt suggested me to try the Perl ProcManager and
kindly provided some code. However, I wasn't able to make it work.
I think it's also worth a try because my app seems to work fine
when it's started by a simple perl script. Any help is appreciated
for me to make the Perl ProcManager work.

(I notice that some list automatically force the Reply To address
to the list address. This way more people are informed about ongoing
discussions and they may participate. I find it effective to keep
a list active so I'm cc-ing the list :)

-- 
Best regards,
Jack

Wednesday, April 27, 2005, 9:59:21 AM, you wrote:

ebn> Have you tried older versions of Apache yet?
ebn> I have a similar problem where my fcgi 2.4 only works on Apache 1.3.26 or less.
ebn> Not sure why, I have not had time to figure out the
ebn> backward compatibility issues. I posted this issue here with zero
ebn> replies.
ebn> There are no issues with mod_fastcgi on any version I can
ebn> see, but the cgi-fcgi is a different story.
ebn> If you stay snagged it may be worth a try, though not a most desired result.
ebn> Ed
>> 
>> From: Jack <[email protected]>
>> Date: 2005/04/27 Wed AM 12:39:27 EDT
>> To: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
>> Subject: [FASTCGI] FastCGI and CGI Library -> Build FastCGI and Apache
>> 
>> I managed to build fastcgi into Apache but had no luck
>> with making my app work. Same old problem: the library
>> fails to initialize. Not sure if some Linux experts can
>> shed some light on this. How come the app runs fine by
>> itself (from command line) but fails to initialize when
>> it's called by Apache? I was running it in the same folder
>> apache/fcgi-bin/.
>> 
>> Marc also suggested me to run it as external app with
>> a perl proc manager. However, I get lots of errors even
>> before the "exec(my_program)" line:
>> 
>>   server (pid 21448) started
>>   server (pid 21440) exited with status 0"
>> 
>> -- 
>> Best regards,
>> Jack
>> 
>> Sunday, April 24, 2005, 1:40:18 PM, you wrote:
>> 
>> MP> You should be able to make mod_fastcgi non-shared by configuring apache
>> MP> with this option:
>> 
>> MP>   --disable-shared=NAME  disable build of Module named 'NAME' as a DSO
>> 
>> MP> However, you could also run your app as an external fastcgi process and
>> MP> include a small process manager in your app.
>> 
>> MP> There is a perl FCGI::ProcManager that you could use pretty easily like
>> MP> this:
>> 
>> MP> use FCGI::ProcManager;
>> MP> my $proc_manager = FCGI::ProcManager->new({ n_processes => 10 });
>> $proc_manager->>pm_manage();
>> MP> exec ('your fcgi app');
>> 
>> MP> Jack wrote:
>> >> One thing to correct: as Bryan pointed out, the process
>> >> manager is a separate process. My guess is that because
>> >> fcgi uses pipe when the fcgi apps are running locally,
>> >> the processes (process manager and apps) are running as
>> >> children of the apache process and started by mod_fastcgi.so
>> >> I get very nervous when I hear .so and would suspect the
>> >> library wouldn't work. And it didn't :( So, building
>> >> mod_fastcgi into Apache to get rid of any .so in the chain
>> >> is my last resort ...
>> >> 
>> >> Sunday, April 24, 2005, 12:16:02 AM, you wrote:
>> >> 
>> >> J> Hello Bryan,
>> >> 
>> >> J> Thanks for the reply. No, I am not trying to build my app into
>> >> J> Apache. I'm trying to build mod_fastcgi into Apache. The reason
>> >> J> is that I'm using this strange library (.a) in my fcgi app and
>> >> J> I don't have source code for it. This library seem to hate .so.
>> >> J> If it's linked to a stand-alone single threaded app, it works
>> >> J> just fine. If it's linked to a .so file, it'll fail to initialize.
>> >> J> It seems to fail too if it's in the process space of a .so.
>> >> J> In my case, the process manager and the application seem to
>> >> J> be in the same process as mod_fastcgi.so and this could be
>> >> J> the problem. So, I'm trying to build mod_fastcgi into Apache
>> >> J> to remove the .so from the picture.
>> >> 
>> >> J> My application still outputs to the web - that's how I know
>> >> J> there was a problem: the output includes error return code
>> >> J> of the initialization function of the library.
>> >> J> However, nothing is put in the error log of Apache.
>> 
>> 
>>

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.