Re: mod_perl alias directories

2001-11-04 Thread Perrin Harkins

> 1- Currently I have designated a /pm directory to contain my mod_perl
> codes, a collection of classes. I then have instances of these
launched
> from non /pm directory. I did this so that I don't have to be back at
> cgi-bin perdicament where all my CGIs are in one directory. I never
> liked that style. But I'm still forced to put my base classes in /pm.
>
> Is there a way to instruct HTTP that perl code in any directory should
> be used as mod_perl similar to ExecCGI. Or perhaps for a
better/cleaner
> approach, any perl code with some extension such as foo.cgi-mp or
foo.cmp
> (Cgi-Mod-Perl).

Look at the  directive in the Apache documentation.  You
might also want Apache::Dispatch.

> 2- I currently have to restart my HTTP for changes to my mod_perl code
> take affect. Is there any way so I don't have to do this.

Apache::StatINC or Apache::Reload.

- Perrin




Re: Are global variables truly global?

2001-11-04 Thread Perrin Harkins

> Will the different child processes created by Apache share the same
> variable? Or will each child create an additional instance?

Each child has a separate interpreter and thus a separate instance of
your global.  If you need to co-ordinate data between processes, you
might want to look at Cache::Cache or MLDBM::Sync.  If you just need an
exclusive lock, file locking is the simplest way to go.

- Perrin




Re: mod_perl alias directories

2001-11-04 Thread Stas Bekman

Medi Montaseri wrote:

> I have successfully installed mod_perl and am using it. 
> I have two question.
> 
> 1- Currently I have designated a /pm directory to contain my mod_perl
> codes, a collection of classes. I then have instances of these launched
> from non /pm directory. I did this so that I don't have to be back at
> cgi-bin perdicament where all my CGIs are in one directory. I never
> liked that style. But I'm still forced to put my base classes in /pm.
> 
> Is there a way to instruct HTTP that perl code in any directory should
> be used as mod_perl similar to ExecCGI. Or perhaps for a better/cleaner
> approach, any perl code with some extension such as foo.cgi-mp or foo.cmp
> (Cgi-Mod-Perl).
> 
> 2- I currently have to restart my HTTP for changes to my mod_perl code
> take affect. Is there any way so I don't have to do this. I can see that
> this is not going to work in a large organization where IT handles the
> production web servers.

Both answered here:
http://perl.apache.org/guide/

_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Re: Are global variables truly global?

2001-11-04 Thread Steven Lembark



-- "Chui G. Tey" <[EMAIL PROTECTED]>

> I have some state data that I need to persist between requests. At the
> moment these are COM objects, but they'll be ported to Perl Classes. It
> is quite important that only one of these instances exist per web
> server. These instances are too large to write and read to file on every
> request. So I have defined the variable as a package level variable.
>
> I have been instantiating the variable in my handler() routine if it has
> not already been instantiated. ie.

Global variables are exactly that: global. If you use
something like:

our $foo ||= somefunc;

or

our $foo = Someclass->constructor( @blah );

then you'll get a value that goes into the symbol table and
is unique w/in the executing process. Thing you'll need to
read up on are global variables, packages/namespaces and
how "use strict" effects things (all of which are in the Camel
or Llama books).

--
Steven Lembark   2930 W. Palmer
Workhorse Computing   Chicago, IL 60647
+1 800 762 1582



Are global variables truly global?

2001-11-04 Thread Chui G. Tey

I have some state data that I need to persist between requests. At the
moment these are COM objects, but they'll be ported to Perl Classes. It
is quite important that only one of these instances exist per web
server. These instances are too large to write and read to file on every
request. So I have defined the variable as a package level variable.

I have been instantiating the variable in my handler() routine if it has
not already been instantiated. ie.

package Apache::MyPkg;

my $COM_instance;

sub handler {

   if (!$COM_instance) {
   $COM_instance = Win32::OLE->new("ProgID.Class");
   }

}

Will the different child processes created by Apache share the same
variable? Or will each child create an additional instance? I'm happy to
lose the data if Apache falls over.

Chui Tey
Software Engineer
Advanced Data Integration
PO Box 660
Spring Hill QLD 4004
AUSTRALIA
Ph:07 3250 5300
Fax: 07 3250 5399
[mailto: [EMAIL PROTECTED]  ]
 



mod_perl alias directories

2001-11-04 Thread Medi Montaseri


I have successfully installed mod_perl and am using it. 
I have two question.

1- Currently I have designated a /pm directory to contain my mod_perl
codes, a collection of classes. I then have instances of these launched
from non /pm directory. I did this so that I don't have to be back at
cgi-bin perdicament where all my CGIs are in one directory. I never
liked that style. But I'm still forced to put my base classes in /pm.

Is there a way to instruct HTTP that perl code in any directory should
be used as mod_perl similar to ExecCGI. Or perhaps for a better/cleaner
approach, any perl code with some extension such as foo.cgi-mp or foo.cmp
(Cgi-Mod-Perl).

2- I currently have to restart my HTTP for changes to my mod_perl code
take affect. Is there any way so I don't have to do this. I can see that
this is not going to work in a large organization where IT handles the
production web servers.

Thanks

-- 
-
Medi Montaseri   [EMAIL PROTECTED]
Unix Distributed Systems EngineerHTTP://www.CyberShell.com
CyberShell Engineering
-




Re: Install problems

2001-11-04 Thread Steve Piner



John Michael wrote:

> Checking if your kit is complete.
> Looks good
> Writing Makefile for libapreq
> mkdir blib/lib
> mkdir blib/lib/auto
> mkdir blib/lib/auto/libapreq
> mkdir blib/man3
> cp libapreq.pod blib/lib/libapreq.pod
> cp lib/Apache/libapreq.pm blib/lib/Apache/libapreq.pm
> make[1]: Entering directory `/usr/local/etc/libapreq-0.33/c'
> gcc -c -I/usr/lib/perl5/site_perl/5.6.0/i386-linux/auto/Apache/include
> -I/us
> r/lib/
> perl5/site_perl/5.6.0/i386-linux/auto/Apache/include/modules/perl
> -fno-stric
> t-
> aliasing -02 -march=i386 -mcpu=i386 -DVERSION=\"0.10\"
> -DXS_VERSION=\"0.10\
> "
>  -fPIC -I/usr/lib/perl5/5.6.0/i386-linux/CORE  apache_request.c
> In file included from apache_request.c:58:
> apache_request.h:5:19: httpd.h: No such file or directory
> apache_request.h:6:25: http_config.h: No such file or directory
> apache_request.h:7:23: http_core.h: No such file or directory
> apache_request.h:8:22: http_log.h: No such file or directory
> apache_request.h:9:23: http_main.h: No such file or directory
> apache_request.h:10:27: http_portocol.h: No such file or directory
> apache_request.h:11:25: util_script.h: No such file or directory
> make[1]: *** [apache_request.o] Error 1
> make[1]: Leaving directory `/usr/local/etc/libapreq-0.33/c'
> make[1]: *** [subdirs] Error 2
> 
> I'm confused.

It looks like you might not have the 'apache-devel' package installed.
(You did say you were on RedHat, didn't you?) Try installing that.

Steve

-- 
Steve Piner
Web Applications Developer
Marketview Limited
http://www.marketview.co.nz



Re: Installing modules

2001-11-04 Thread Steve Piner



John Michael wrote:

> Where can I find information on how to install modules like:
> Apache::Request libapreq-0.33.tar.gz
> Apache::DBIApacheDBI-0.88.tar.gz
> 
> Would I install these as regular perl modules or are they installed as
> apache modules?

They are regular perl modules. They only run under mod_perl though. :-)

If you can, use the CPAN shell to install modules, (see 'perldoc CPAN')

Otherwise, download and extract the module then change into its
directory. Read the README and INSTALL files. Then - assuming those
files don't say differently - type

perl Makefile.PL
make
make test

And if you're happy with the results, su to root and type

make install

Hope this helps.

Steve

-- 
Steve Piner
Web Applications Developer
Marketview Limited
http://www.marketview.co.nz



Re: config.status for mod_perl ?

2001-11-04 Thread Nick Mason

Hi,

The problem was that on our machines ( Solaris 2.6,
Apache 1.3.14, Modperl 1.26) we are constantly getting
a "child segmentation fault (11) ". One mail in the
news group suggested using PERL_USELARGEFILES=0 in
addition to the normal configuration for modperl
installation. We tried that with the command :

% perl Makefile.PL APACHE_SRC=/perl/apache_1.3.14/src 
 DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
PERL_USELARGEFILES=0

% make && make test && make install

but we got the following message :

[snip]
modules/module..skipped test on this platform
modules/perlrun.FAILED before any test output
arrived
modules/psections...skipped test on this platform




Failed Test  Status Wstat Total Fail  Failed  List of
failed
---
modules/perlrun  ??   ??   %  ??
6 tests skipped.
httpd terminated
Failed 1/34 test scripts, 97.06% okay. 0/374 subtests
failed, 100.00% okay.
make: *** [run_tests] Error 29


After this we were stuck up, hence thought of copying
the existing installation on a similar machine which
seems to be working !.

Thanx
Nick.



 --- Ged Haywood <[EMAIL PROTECTED]> wrote:
> Hi there,
> 
> On Sun, 4 Nov 2001, [iso-8859-1] Nick Mason wrote:
> 
> > I wanted to copy someone's existing modperl and
> apache installation
> > to my machine. [snip] file for modperl which has
> the parameters
> 
> 
> There isn't really just one file which you can copy
> to install
> mod_perl, and because installations tend to differ
> so very much from
> one to another it doesn't usually make much sense to
> try to copy a
> configuration from one machine to another.  If you
> look in the Guide
> you'll find it very easy to get a simple
> configuration running, and
> there are many links there to other documents which
> will help too - in
> particular the Eagle Book.
> 
> http://perl.apache.org/guide
> 
> 73,
> Ged.
> 
>  

__
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music 
Charts
http://uk.my.yahoo.com



Re: config.status for mod_perl ?

2001-11-04 Thread Ged Haywood

Hi there,

On Sun, 4 Nov 2001, [iso-8859-1] Nick Mason wrote:

> I wanted to copy someone's existing modperl and apache installation
> to my machine. [snip] file for modperl which has the parameters


There isn't really just one file which you can copy to install
mod_perl, and because installations tend to differ so very much from
one to another it doesn't usually make much sense to try to copy a
configuration from one machine to another.  If you look in the Guide
you'll find it very easy to get a simple configuration running, and
there are many links there to other documents which will help too - in
particular the Eagle Book.

http://perl.apache.org/guide

73,
Ged.





config.status for mod_perl ?

2001-11-04 Thread Nick Mason

Hi,
 
I wanted to copy someone's existing modperl and apache
installation to my machine. Just as Apache keeps the
file config.status which can be rerun to create the
same configuration of Apache, is there any similar
file for modperl which has the parameters used for
modperl installation. 

Thanx.
Nick Mason


__
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music 
Charts
http://uk.my.yahoo.com