SOAP Lite handler and including other files without apache restart
SOAP Lite handler and including other files without apache restart
am 11.12.2008 19:03:06 von bnyec
Not sure if subject explains the problem (or not) i'm dealing with but, here goes.
What i have is a SOAP Lite server set up (for development purposes) and i'm wondering if there is a way to make changes to files outside the "dispatch_to" directory that are included ("require"/"do") in myhandler without having to restart apache for the changes to go into effect? (or, I guess, tell mod_perl/apache to process each request as new rather than keep things loaded into memory?, if that's in deed what's happening)
I am able to get it to work, with any *.pm's in the "dispatch_to" directory using "Apache2::Reload" but nothing outside of that.
The setup is as follows,
httpd.conf:
----------------
## SOAP Server
PerlRequire /path/to/soap_server/api/startup.pl
SetHandler perl-script
PerlSendHeader On
PerlHandler Apache::SOAP
PerlInitHandler Apache2::Reload
PerlSetVar dispatch_to "/path/to/soap_server/api/modules"
PerlSetVar options "compress_threshold => 10000"
startup.pl:
-------------------
#!/usr//bin/perl
#
use lib qw(
/usr/local/lib/perl5/5.8.8/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.8/mach
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.8/mach
/usr/local/lib/perl5/5.8.8
);
1;
In /path/to/soap_server/api/modules i have my handler
handler.pm
-------------
package myhandler;
use strict;
sub execute {
my($self,@soap_input) = @_;
[....]
require "/path/to/some/other/location/other_functions.pl;
## execute func in other_functions.pl
some_other_function($args,\%bla,$arg);
}
1;
In other_functions.pl also has some other "require" statements to other files located outside the "dispatch_to" directive.
So, when making a change to "other_functions.pl" and anything underneath, i have to restart apache, even though they are outside "dispatch_to" directory, Is there to make changes to those files without having to restart apache each time a change is made?
If you need more info, please let me know
Thanks
- b
Re: SOAP Lite handler and including other files without apache restart
am 11.12.2008 19:29:29 von Perrin Harkins
On Thu, Dec 11, 2008 at 1:03 PM, b. nyec wrote:
> What i have is a SOAP Lite server set up (for development purposes) and i'm wondering if there is a way to make changes to files outside the "dispatch_to" directory that are included ("require"/"do") in myhandler without having to restart apache for the changes to go into effect?
Try Apache2::Reload:
http://perl.apache.org/docs/2.0/api/Apache2/Reload.html
- Perrin
Re: SOAP Lite handler and including other files without apache restart
am 11.12.2008 19:43:48 von bnyec
> wrote:
> > What i have is a SOAP Lite server set up (for
> development purposes) and i'm wondering if there is a
> way to make changes to files outside the
> "dispatch_to" directory that are included
> ("require"/"do") in myhandler without
> having to restart apache for the changes to go into effect?
>
> Try Apache2::Reload:
> http://perl.apache.org/docs/2.0/api/Apache2/Reload.html
>
> - Perrin
It works with things inside the dispatch_to directory. (refer to my orig post)
Unless i've misconfigured, it's not working for things outside that directory.
-b
Re: SOAP Lite handler and including other files without apache restart
am 11.12.2008 19:51:51 von bnyec
> > wrote:
> > > What i have is a SOAP Lite server set up (for
> > development purposes) and i'm wondering if there
> is a
> > way to make changes to files outside the
> > "dispatch_to" directory that are included
> > ("require"/"do") in myhandler
> without
> > having to restart apache for the changes to go into
> effect?
> >
> > Try Apache2::Reload:
> >
> http://perl.apache.org/docs/2.0/api/Apache2/Reload.html
> >
> > - Perrin
>
> It works with things inside the dispatch_to directory.
> (refer to my orig post)
> Unless i've misconfigured, it's not working for
> things outside that directory.
>
> -b
Actually, i got it working, thanks for your help. :)
PerlSetVar ReloadDirectories "/tmp/project1 /tmp/project2"
-b
Re: SOAP Lite handler and including other files without apache restart
am 11.12.2008 19:54:13 von Perrin Harkins
On Thu, Dec 11, 2008 at 1:43 PM, b. nyec wrote:
> It works with things inside the dispatch_to directory. (refer to my orig post)
> Unless i've misconfigured, it's not working for things outside that directory.
Sorry, I should have read the whole thing. I think the problem is
that the file you pull in with require has no package name. There's
an explanation in the docs:
http://perl.apache.org/docs/2.0/api/Apache2/Reload.html#Prob lems_With_Reloading_Modules_Which_Do_Not_Declare_Their_Packa ge_Name
Using files of functions with no package name is a bad idea in
general, so I'd suggest you change these to modules with functions
that you can import.
- Perrin
Re: SOAP Lite handler and including other files without apache restart
am 11.12.2008 19:57:47 von bnyec
> wrote:
> > It works with things inside the dispatch_to directory.
> (refer to my orig post)
> > Unless i've misconfigured, it's not working
> for things outside that directory.
>
> Sorry, I should have read the whole thing. I think the
> problem is
> that the file you pull in with require has no package name.
> There's
> an explanation in the docs:
> http://perl.apache.org/docs/2.0/api/Apache2/Reload.html#Prob lems_With_Reloading_Modules_Which_Do_Not_Declare_Their_Packa ge_Name
>
> Using files of functions with no package name is a bad idea
> in
> general, so I'd suggest you change these to modules
> with functions
> that you can import.
>
> - Perrin
Thank you agian, duely noted.
-b