You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Perrin Harkins <pe...@elem.com> on 2005/11/18 16:14:06 UTC

Re: Preestablish database connection during httpd process startup--HOWTO??

On Thu, 2005-11-17 at 07:41 +0000, KartheeK wrote:
> I am Using a Trouble ticketing System- OTRS it is running on mod_perl,
> I am trying to configure " Preestablish datababase connections" During
> httpd process startup

Okay.  Are connections working when you don't try to use connect_on_init
()?  What version of mod_perl are you using?  Please include the
information requested here:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

> I have configured the "apache2-perl-startup.pl" as follows: 
> ==================================== 
> use Apache (); 

Why did you do that?  I don't think there's ever a need to explicitly
"use Apache".

> Can't locate Apache.pm in @INC (@INC contains: /opt/otrs/Kernel/cpan-
[...]
> Therefore I Included the file Apache.pm 
> From: 
> “/usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-
> multi/DBI/ProfileDumper/Apache.pm” 
> To: “/opt/otrs” 

No!  You can't just copy ANY file named Apache.pm there.  It is looking
for a specific thing.

It looks to me like this whole installation is messed up.  Does it work
for you aside from this one thing?

- Perrin


Re: Preestablish database connection during httpd process startup--HOWTO??

Posted by Perrin Harkins <pe...@elem.com>.
KartheeK wrote:
> Meanwhile, I tried the same thing on a Mandrake-10.1, And Guess What!!! 
> No Errors in my httpd logs.....

It sounds like you are using RPMs for mod_perl and the application you 
have is written for a specific version which is not the one on your Red 
Hat system.

> Now, the question is How Can I *prove my 
> Boss* and to myself that I have established mysql connection during 
> httpd process start up....

Just read the documentation for Apache::DBI.  It tells you how to turn 
on the DEBUG setting which will print what you need to the error_log.

>    1. I tried this,
>    2. I stopped mysql server
>    3. I Restarted httpd server, but surprizingly it came up without any
>       problem

Connections are not made during the server startup, but rather when a 
child process is forked.  You will probably find errors in the log from 
when it tried to fork a child.

- Perrin

Re: Preestablish database connection during httpd process startup--HOWTO??

Posted by KartheeK <ka...@yahoo.co.in>.
Ooops, ignore the other mail, I replied to a wrong one, here goes the right one:
     
   
  Hi, 
  Meanwhile, I tried the same thing on a Mandrake-10.1, And Guess What!!! No Errors in my httpd logs..... Now, the question is How Can I prove my Boss and to myself that I have established mysql connection during httpd process start up....
  is there any way??
    
   I tried this,   
   I stopped mysql server   
   I Restarted httpd server, but surprizingly it came up without any problem, ideally it should have thrown out a error so as to say that It could not establish a connection with mysql(since the server is down)
  What should I conclude, Am I successfull In establishing the connection?? 
   
  Regards
  KartheeK


Perrin Harkins <pe...@elem.com> wrote:
  On Thu, 2005-11-17 at 07:41 +0000, KartheeK wrote:
> I am Using a Trouble ticketing System- OTRS it is running on mod_perl,
> I am trying to configure " Preestablish datababase connections" During
> httpd process startup

Okay. Are connections working when you don't try to use connect_on_init
()? What version of mod_perl are you using? Please include the
information requested here:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

> I have configured the "apache2-perl-startup.pl" as follows: 
> ==================================== 
> use Apache (); 

Why did you do that? I don't think there's ever a need to explicitly
"use Apache".

> Can't locate Apache.pm in @INC (@INC contains: /opt/otrs/Kernel/cpan-
[...]
> Therefore I Included the file Apache.pm 
> From: 
> “/usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-
> multi/DBI/ProfileDumper/Apache.pm” 
> To: “/opt/otrs” 

No! You can't just copy ANY file named Apache.pm there. It is looking
for a specific thing.

It looks to me like this whole installation is messed up. Does it work
for you aside from this one thing?

- Perrin

  


		
---------------------------------
 Enjoy this Diwali with Y! India Click here