Re: Connection Pooling / TP Monitor

2000-11-06 Thread Thomas A. Lowery

On Mon, Nov 06, 2000 at 04:19:13PM +, Tim Bunce wrote:

> On Thu, Nov 02, 2000 at 10:10:09PM -0800, Perrin Harkins wrote:
> > Tim Bunce wrote:
> > > You could have a set of apache servers that are 'pure' DBI proxy servers.
> > > That is, they POST requests containing SQL (for prepare_cached) plus
> > > bind parameter values and return responses containing the results.
> > > 
> > > Basically I'm proposing that apache be used as an alternative framework for
> > > DBI::ProxyServer. Almost all the marshaling code and higher level logic
> > > is already in DBI::ProxyServer and DBD::Proxy. Shouldn't be too hard to do
> > > and you'd gain in all sorts of ways.
> > 
> > I think this is a really good idea.  The thing is, any effort put into
> > this kind of thing right now feels like a throw away, because mod_perl
> > 2.0 will solve the problem in the right way with real pooling of
> > database handles (and other objects) between threads.
> > 
> > Maybe it's time for DBD:: authors to start checking their code for
> > thread safety?
> 
> Yeap.

How about an explaination on how to test a pure perl driver for thread safety
and/or what types of code we need to check for or look into?

Tom


-- 
Thomas A. Lowery[EMAIL PROTECTED]





Re: dynamic vs. mostly static data

2000-11-06 Thread Perrin Harkins

On Tue, 7 Nov 2000, Marinos J. Yannikos wrote:
> If possible with your data, it'd probably be a good idea to generate
> static pages on-the-fly using mod_rewrite as in the related guide:
> http://www.engelschall.com/pw/apache/rewriteguide/#ToC33.

If you have a caching proxy server running in front of your mod_perl
server (like mod_proxy or Squid), you can just set Expires headers in your
pages and this will be handled for you by the proxy.

- Perrin




Re: $r->param() goes poof (Was: POST results in "HTTP/1.0 (null)")

2000-11-06 Thread G.W. Haywood

Hi there,

On Mon, 6 Nov 2000, Paul J. Lucas wrote:

> From within my authentication handler, I also access query string
> parameters.  When I do this, the downstream content handler finds
> that $r->param() is empty.

Search the Guide for PERL_STASH_POST_DATA.

73,
Ged.




Re: Memory Usage

2000-11-06 Thread G.W. Haywood

Hi there,

On Mon, 6 Nov 2000, Buddy Lee Haystack wrote:

> The morning after "logrotate" runs on my system, the memory usage
> increases by about 30 megabytes, and continues to do so after each
> weekly run of the "logrotate" utility.
 
What happens if you then do a graceful restart?

> Has anyone else had this experience?

Nope.  But then I don't do it that way.

> I'd like to rotate my logs weekly, but at this rate I'll run out of
> ram in a couple of months.

In that case you're probably one of the lucky ones...

73,
Ged.





Re: how do I really proof, that my script is running under apaches mod_perl?

2000-11-06 Thread G.W. Haywood

Hi there,

On Mon, 6 Nov 2000, [iso-8859-1] Alexander Förster wrote:

> Q:Is it normal, that under linux, running apache with mod_perl, for
> requests on a script a separate system process is starting ?

Not unless you intentionally start one from your script.

> I wrote a script, included it via ssh

Secure shell?

> I really got some frustrating request/seconds - rates (about 6 req/s)

Well it depends what was served...

>  some httpd.conf snippets of my test server running on linux:
[snip]
>PerlHandler Apache::Registry

Why Registry?  Not fast.  Read the Guide.  http://perl.apache.org/guide

73,
Ged.




Apache_1.3.14 mod_layout 1.24_01 core dump

2000-11-06 Thread George Sanderson

=
I am resending this email because I initially sent it out late Friday
evening and I only received further questions from one person.  I was
hoping that someone could shed some light on why I am having problems
loading DSO modules when mod_perl is statically linked and loaded.
=
First, off, let me clarify, I am a Newbie in almost every way. . .

I have the following configuration Linux 2.2.17, Apache 1.3.14,
mod_perl-1.24_01 (static), Perl-5.6.0.
If I load Apache::Icon and mod_layout (static) I do not have a problem.
Also, I can not load mod_perl as a DSO and load Apache::Icon without core
dump.  When I  load mod_perl (static), Apache::Icon, and mod_layout 2.8 as
a DSO, Apache will also core dump and the following gdb bt output is produced:
=
#0  0x8089c9d in ap_push_array (arr=0x) at alloc.c:1029
#1  0x2ac788f4 in push_item () from
/usr/local/lib/perl5/5.6.0/site_perl/i586-linux/auto/Apache/Icon/Icon.so
#2  0x2ac78a48 in add_alt () from
/usr/local/lib/perl5/5.6.0/site_perl/i586-linux/auto/Apache/Icon/Icon.so
#3  0x2ac78ad8 in add_icon () from
/usr/local/lib/perl5/5.6.0/site_perl/i586-linux/auto/Apache/Icon/Icon.so
#4  0x2ac78bdf in add_raw () from
/usr/local/lib/perl5/5.6.0/site_perl/i586-linux/auto/Apache/Icon/Icon.so
#5  0x2ac78c55 in add_icon_raw () from
/usr/local/lib/perl5/5.6.0/site_perl/i586-linux/auto/Apache/Icon/Icon.so
#6  0x808ec79 in invoke_cmd (cmd=0x2ac7a670, parms=0x7bd4,
mconfig=0x81c115c,args=0x7fffdb5e "(CMP,/icons/compressed.gif) x-compress
x-gzip") at http_config.c:808
#7  0x808f703 in ap_handle_command (parms=0x7bd4, config=0x81c0534,
l=0x7fffdb4c "AddIconByEncoding (CMP,/icons/compressed.gif) x-compress
x-gzip") at http_config.c:1028
#8  0x808f7a7 in ap_srm_command_loop (parms=0x7bd4, config=0x81c0534)
at http_config.c:1042
#9  0x808fe68 in ap_process_resource_config (s=0x81bf95c, fname=0x81c0f4c
"/usr/local/apache/conf/httpd.test", p=0x81bf934,ptemp=0x84121dc) at
http_config.c:1298
#10 0x8090762 in ap_read_config (p=0x81bf934, ptemp=0x84121dc,
confname=0x81af760 "conf/httpd.test") at http_config.c:1580
#11 0x809a6d1 in standalone_main (argc=4, argv=0x7ce4) at http_main.c:4640
#12 0x809af43 in main (argc=4, argv=0x7ce4) at http_main.c:5004
=
The tail of the strace was:
=
stat("/usr/local/apache/lib/perl/Apache/Icon.pmc", 0x7fffd7ac) = -1 ENOENT
(No such file or directory)
open("/usr/local/apache/lib/perl/Apache/Icon.pm", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat("/usr/local/lib/perl5/5.6.0/i586-linux/Apache/Icon.pmc", 0x7fffd7ac) =
-1 ENOENT (No such file or directory)
open("/usr/local/lib/perl5/5.6.0/i586-linux/Apache/Icon.pm", O_RDONLY) = -1
ENOENT (No such file or directory)
stat("/usr/local/lib/perl5/5.6.0/Apache/Icon.pmc", 0x7fffd7ac) = -1 ENOENT
(No such file or directory)
open("/usr/local/lib/perl5/5.6.0/Apache/Icon.pm", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat("/usr/local/lib/perl5/5.6.0/site_perl/i586-linux/Apache/Icon.pmc",
0x7fffd7ac) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/perl5/5.6.0/site_perl/i586-linux/Apache/Icon.pm",
O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0444, st_size=2333, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2aac6000
read(5, "package Apache::Icon;\n\nuse stric"..., 4096) = 2333
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
close(5)= 0

munmap(0x2aac6000, 4096)= 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
=
I have a similar problem when I replace mod_layout with mod_auth_mda (DSO),
however I do not have a problem if I do not load mod_perl with the other
modules or if I do not load the other DSO modules (mod_layout or
mod_auth_mda).

No error_log output is generated.

Looks like some kind of  munmap() problem.

I appreciate any help I can get.  Thanks in advance.






Apache::Registry() and strict

2000-11-06 Thread Ron Rademaker

Hello, 

I'm just starting with mod_perl and I'm using Apache::Registry(). The
second line after #!/usr/bin/perl -w is use strict;
But somehow variables I use in the script are still defined if I execute
the script again, in one of the script I said undef $foo at the
end, but I don't think this is the way it should be done, but it did work.
Anyone knows what could be causing this??

Ron Rademaker

PS. Please CC to me because I'm not subscribed to this mailinglist




Re: dynamic vs. mostly static data

2000-11-06 Thread Marinos J. Yannikos

> How can I 'cache' this data so that all Apache children can
> access it quickly? Is there a way to automatically update
> this cache periodically (say every 10 minutes)?

If possible with your data, it'd probably be a good idea to generate static
pages on-the-fly using mod_rewrite as in the related guide:
http://www.engelschall.com/pw/apache/rewriteguide/#ToC33.
You'll have to come up with a scheme to encode all query parameters in the
URL and you can then just remove old pages periodically. It works fine here
for a different application (thumbnails in arbitrary sizes generated
on-the-fly).

If that is out of the question, you can still use a simple filesystem-based
caching mechanism (by mapping query args to unique, safe filenames) or
something like IPC::Cache to cache the query results.

-mjy
--
Marinos J. Yannikos
Preisvergleich Internet Services AG, Linke Wienzeile 4/2/5, A-1060 Wien
Tel/Fax: (+431) 5811609-52/-55





Chaining Perl and C handlers

2000-11-06 Thread Andrew Chen

All,

The project I'm working on requres me to do the following:

1. GET/POST Request comes in
2. Request gets handled by a mod_perl handler, which modifies and adds
to the GET/POST variables.
3. Request is then sent to a C handler (BEA WLS-Apache bridge)
4. Request is then handled by a JSP, which should be able to read the
changes that were added in step 2.

According to my trusty Eagle book, I can chain Perl handlers (by using
$r->pushhandlers(), but can I chain a C handler after a Perl handler?? 
And yes, I know this is kind of bizarre.

Thanks in advance!

I'm not on the mod_perl list, so please cc: me.

Andrew Chen
Software Engineer, Architecture
[EMAIL PROTECTED]
206-219-8445
The Cobalt Group, Inc. (www.cobaltgroup.com)
2200 First Avenue South
Seattle, WA 98134




Memory Usage

2000-11-06 Thread Buddy Lee Haystack

I'm using

RedHat Linux v6.1 on an Intel PII SMP box
Apache v1.3.14
mod_perl v 1.23
Apache::DBI 0.87
DBI v1.13
DBD Pg v0.93
PostgreSQL v6.5.3

The morning after "logrotate" runs on my system, the memory usage increases by about 30
megabytes, and continues to do so after each weekly run of the "logrotate" utility.

Has anyone else had this experience? I'd like to rotate my logs weekly, but at this 
rate
I'll run out of ram in a couple of months.

Thanks!

-- 
BLH
www.RentZone.org



-- 
BLH
www.RentZone.org



$r->param() goes poof (Was: POST results in "HTTP/1.0 (null)")

2000-11-06 Thread Paul J. Lucas

On Fri, 3 Nov 2000, I wrote:

>   So from within a function, I'm doing
> 
>   my $r = Apache::Request->new( Apache->request() );
>   warn "request=", $r->as_string(), "\n";
> 
>   and, when I to a POST request, I get:
> 
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 6978
> Content-Type: multipart/form-data; boundary=curl3cwvW7Ge8lVBtEGuDRCENOMeIVO
> Host: www.abacus-new.com:80
> Pragma: no-cache
> User-Agent: Mozilla/4.0
> 
> HTTP/1.0 (null)

I made a much smaller test case that works fine.  I've since
discovered that the difference between the case that doesn't
work and the case that does is the one that doesn't also
includes and authentication handler in its  section.

From within my authentication handler, I also access query
string parameters.  When I do this, the downstream content
handler finds that $r->param() is empty.  If I have my
authentication handler not touch $r->param(), then the
downstream content handler properly gets the parameters.

Why does accessing $r->param() from within an authentication
(or, generally, and upstream handler) blow them away for
downstream handlers?

- Paul




how do I really proof, that my script is running under apaches mod_perl?

2000-11-06 Thread Alexander Förster

Hi all,

maybe this one is a rookie-question ;)

Q:Is it normal, that under linux, running apache with mod_perl, for requests
on a script a separate system process is starting ?
 I saw a lot of processes (via `top`), all running separate my script, as I
made some benchmark tests...
 - I thought, that everything would be handled by apaches "httpd", if
mod_perl is installed...

History:
I wrote a script, included it via ssh in most of *.shtml - files of my site.

Everything is working fine, but the benchmark tests.
I really got some frustrating request/seconds - rates (about 6 req/s), while
testing the sites.
So I would really love to know, which way to go:
 should I try to optimise that script (a lot) more or
 should I configure that apache server in the right way for mod_perl?

Some Information:
 I use these modules in my script:
use Apache::Registry;
use CGI::FastTemplate;
use strict;

 some httpd.conf snippets of my test server running on linux:
..
KeepAlive On
MaxKeepAliveRequests 100
..
MaxClients 150
..
AddModule  mod_perl.c
..
Alias   /cgi-bin/ 
 
   SetHandler  perl-script
   PerlHandler Apache::Registry
   Options +ExecCGI
 
...

 well, printing the environment with a cgi:
..
SERVER_SOFTWARE = Apache/1.3.12 (Unix) (SuSE/Linux) mod_fastcgi/2.2.2
mod_perl/...
...

 I made those benchmark test from an NT-PC, via LAN, using Microsoft's
freeware: "Web Application Stress 1.1" from
http://homer.rte.microsoft.com/! - is there a better free tool? - (well I
don't really looked out for a better one)

Thanks 4 reading,
any remarks would be great,
alex.




Re: Apache::Scoreboard returns incomplete information to Apache::Watchdog::RunAway.

2000-11-06 Thread Jayme Frye

"G.W. Haywood" wrote:

> Hi there,
>
> On Mon, 6 Nov 2000, Jayme Frye wrote:
>
> > I am setting up Apache::Watchdog::RunAway and have come across a
> > problem with Apache::Scoreboard that breaks Watchdog.
> [snip]
> >  Apache compile time options:
> >
> >  SL_BASE=SYSTEM \
> >  EAPI_MM=SYSTEM \
> >  CC="egcs" \
> >  OPTIM="-O9
>
> Extract from apache_1.3.14/src/Configuration:
>
> # Optimization note:
> # Be careful when adding optimization flags (like -O3 or -O6) on the OPTIM
> # entry, especially when using some GCC variants. Experience showed that using
> # these for compiling Apache is risky. If you don't want to see Apache dumping
> # core regularly then at most use -O or -O2.
>
> 73,
> Ged.

Thanks for the info. Although I have had no problems with this level of
optimization I tried recompiling with -O and -O2. Unfortunately compiling with -O
or -O2 did nothing to correct the ouptut of Apache::Scoreboard.  The problem also
effects Apache::VMonitor which returns incomplete information as well.

Jayme Frye
Senior System Administrator
Inventive Comm
[EMAIL PROTECTED]




Re: dynamic vs. mostly static data

2000-11-06 Thread Gerald Richter

>
> > 
> >  My Site
> > 
> > 
> > 
> >  [% stick in body of article here "document.main" %]
> >  [% stick in related info here "document.sidebar" if it exists
%]
> > 
> > 
> >
> > That is, I have exactly one template that I apply to each document.
> > Right now I do that using Sandwich and some pre-processing, but I'd
> > much rather let a real template system do it so I can put parts in
> > various places.
> >
> > Is TT the something that will let me do this without too much
> > headache?
>
> I'm sure TT can do this.  In addition, pretty much all the templating
> systems probably accomodate this.  Under Mason this could be done very
> easily using the autohandler facility it provides.
>

Embperl (using the EmbperlObject handler) can do this in OO way, so you are
not only able, to have one template, but also override parts of it for
different parts of your side (as far as you need this). Additionaly the
template can call methods inside the "document.main", so you are able to
provide different method implentation with different documents. (e.g. for
passing different titles to the template)

See http://perl.apache.org/embperl/EmbperlObject.pod.cont.html for more
information.

Gerald


-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-






Re: Sharing vars across httpds

2000-11-06 Thread Perrin Harkins

On Mon, 6 Nov 2000, Differentiated Software Solutions Pvt. Ltd wrote:
> We want to share a variable across different httpd processes.
> Our requirement is as follows :
> 
> 1. We want to define one variable (which is a large hash).
> 2. Every httpd should be able to access this variable (read-only).
> 3. Periodically (every hour) we would like to have another mod_perl program to 
>refresh/recreate this large hash with new values
> 4. After this, we want the new values in the hash to be available across httpds

If that's all you want to do, I would stay away from the notoriously slow
and sometimes tricky IPC modules.  My dirt simple approach is to put the
data in a file and then read it into each httpd.  (No point in trying to
load it before forking if you're going to refresh it in an hour
anyway.)  You can use Storable for your data format, which is compact and
fast.  To check for an update, just stat the file and reload the data if
it has a newer mtime.  If you don't like doing the stat every time, put a
counter in a global variable and just stat once every 10 requests or
something, like Apache::SizeLimit does.  If your data is too big to pull
into memory, you can use a dbm file instead.

- Perrin




Re: a web interface to visualize tables

2000-11-06 Thread G.Richter

> > I need a tool to interactively visualize DB tables from a web interface.
> > Ideally this tool would let me:
> >
> > - rename column headers,
> > - set cell alignments, widths, background colors,
> > - reorder columns,
> > - save all these visualisation settings in a DB,
> > - it would be written in perl (even better: mod_perl),
>

I have written a tool that let you view/browse/search/edit database tables
or single rows. It's a Perl modules and it's based on HTML::Embperl
(therefore it runs under mod_perl) and DBIx::Recordset. I have used it
sucessfully with mysql, Oracle, PostgreSQL and MSAccess, but it should also
work for other databaseses for which a DBD driver exists.

You can use it as standlone tool for maintaining a database or embedd it's
(configurable) views inside of other webpages. The configurations is
currently stored in a text file, but it should be very easy to put it into a
DB. A large set of configuration options exists to adapt the look and feel.

The only reason, why I didn't released it to CPAN yet is, that I don't have
the time to write some more docs for it (basic docs are available). If
anybody wants to take a look at it, drop me a not and I send you a copy.

Gerald





Re: modifying $subr->run

2000-11-06 Thread Perrin Harkins

On Mon, 6 Nov 2000, Todd Finney wrote:
> The only difficulty then remaining is the existing CGI 
> scripts that this system wraps.  There are several dozen of 
> these in place already, and changing the argument handling 
> would be rather tedious.  Do you know of an easy method for 
> handling that translation, 'easy' meaning 'anything easier 
> than changing all the scripts or Apache itself'. :)

You can get nearly any CGI script to run under Apache::PerlRun or
Apache::Registry.  And, as Ken pointed out, you can use Apache::Filter or
various other methods for collecting the output without sending it
straight to the browser.
- Perrin





Re: Dealing with spiders

2000-11-06 Thread ___cliff rayman___

Bill Moseley wrote:

> But it's amazing how many are just lame in that they take perfectly good
> HREF tags and mess them up in the request.  For example, every day I see
> many requests from Novell's BorderManager where they forgot to convert HTML
> entities in HREFs before making the request.
>
> Here's another example:
>
> 64.3.57.99 - "-" [04/Nov/2000:04:36:22 -0800] "GET /../../../ HTTP/1.0" 400
> 265 "-" "Microsoft Internet Explorer/4.40.426 (Windows 95)" 5740

i don't think u have a lame spider here.  i think u have a hacker trying to hack
your server.

>
>
> In the last day that IP has requested about 10,000 documents.  Over half
> were 404 requests where some 404s were non-converted entities from HREFs,
> but most were just for documents that do not and have never existed on this
> site.  Almost 1000 request were 400s (Bad Request like the example above).
> And I'd guess that's not really the correct user agent, either

there is a current exploit for non-converted entities on Microsoft IIS.  Maybe
they're trying them out on your Apache for some reason.

>
>
> In general, what I'm interested in stopping are the thousands of requests
> for documents that just don't exist on the site.  And to simply block the
> lame ones, since they are, well, lame.

perhaps u can run a cron job that scans your logs.  identify lame spiders and/or
hackers and add a rule to IPChains (assuming linux 2.2.??) to deny access from
that IP to your server.  i understand that Portsentry does this trick when it
determines that an IP is scanning for open ports.

hth,

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/




[ANNOUNCE] Apache::SimpleReplace 0.06

2000-11-06 Thread Geoffrey Young

The URL

 
http://morpheus.laserlink.net/~gyoung/modules/Apache-SimpleReplace-0.06.tar.
gz

has entered CPAN as

  file: $CPAN/authors/id/G/GE/GEOFF/Apache-SimpleReplace-0.06.tar.gz
  size: 3628 bytes
   md5: a0018cb6d18863878507bdad70f58c38


This is basically an update for Apache::Filter 1.013 - no need to upgrade
SimpleReplace until you upgrade Apache::Filter.

Changes:
0.06  11.06.2000
- make changes to fit in with Apache::Filter 1.013
- clean up output statements a bit
- changed warning to error for SERVER_ERROR
- modified pod



Using Apache::SSI with redirected includes

2000-11-06 Thread Struan Donald

essentially is this possible?

The reason is that at the moment i have includes that vary depending
on the subdomain, but the file that includes them remains the same. 

e.g:



some content

only if i'm looking at it from here.site.com rather than www.site.com
i want the include to be /dir2/inc.html.

at the moment this is done using rewrites but i want to use handlers
for some sections of the site and while straight includes are fine
rewrites just don't seem to have any effect. do i have to stick some
logic into the intitial handler to rewrite the include before i pass
it to SSI?

thanks

Struan
-- 
Struan Donald
mailto:[EMAIL PROTECTED]
Code Flunky, 365 Plc.
http://www.365corp.com/



Re: [warn] [notice] child_init for process 3394, report any problems to [no address given] "Thanks"

2000-11-06 Thread Jose Albert

G.W. Haywood <[EMAIL PROTECTED]>

I just have to say Thanks Again Ged

On Fri, 3 Nov 2000, Jose Albert wrote:

> how to solve this problem ...?
>
> still waiting for server to warm up...not ok
>
> t/logs/error_log :
> [warn] [notice] child_init for process 3394

What happens if you run 'apachectl configtest'?

73,
Ged.

After check for 'apachectl configtest' I got Syntax OK. Then
I start the server and work perfect and then I continued with the rest,
adding ASP, DBI, XML and
Everything is working.

Thanks again

Regard

Jose Albert
www.datacourse.com
[EMAIL PROTECTED]




Re: dynamic vs. mostly static data

2000-11-06 Thread David Hodgkinson

Vivek Khera <[EMAIL PROTECTED]> writes:

> Is TT the something that will let me do this without too much
> headache?

Yes. Look at PRE_PROCESS and POST_PROCESS in the man page.

Cheers,

Dave

 

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Documentation patch for send_http_header()

2000-11-06 Thread Ken Williams

A patch to Apache.pm docs, to match what is actually going on already:

===
RCS file: /home/cvspublic/modperl/Apache/Apache.pm,v
retrieving revision 1.57
diff -u -r1.57 Apache.pm
--- Apache/Apache.pm2000/10/10 16:33:56 1.57
+++ Apache/Apache.pm2000/11/06 16:25:58
@@ -757,9 +757,11 @@
 
 =over 4
 
-=item $r->send_http_header
+=item $r->send_http_header( [$content_type] )
 
 Send the response line and all headers to the client.
+Takes an optional parameter indicating the content-type of the
+response, i.e. 'text/html'.
 
 This method will create headers from the $r->content_xxx() and
 $r->no_cache() attributes (described below) and then append the
===



  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum



Re: dynamic vs. mostly static data

2000-11-06 Thread Dave Rolsky

On Mon, 6 Nov 2000, Vivek Khera wrote:

> 
>  My Site
> 
> 
> 
>  [% stick in body of article here "document.main" %]
>  [% stick in related info here "document.sidebar" if it exists %]
> 
> 
> 
> That is, I have exactly one template that I apply to each document.
> Right now I do that using Sandwich and some pre-processing, but I'd
> much rather let a real template system do it so I can put parts in
> various places.
> 
> Is TT the something that will let me do this without too much
> headache?

I'm sure TT can do this.  In addition, pretty much all the templating
systems probably accomodate this.  Under Mason this could be done very
easily using the autohandler facility it provides.


-dave

/*==
www.urth.org
We await the New Sun
==*/




Re: Connection Pooling / TP Monitor

2000-11-06 Thread Tim Bunce

On Thu, Nov 02, 2000 at 10:10:09PM -0800, Perrin Harkins wrote:
> Tim Bunce wrote:
> > You could have a set of apache servers that are 'pure' DBI proxy servers.
> > That is, they POST requests containing SQL (for prepare_cached) plus
> > bind parameter values and return responses containing the results.
> > 
> > Basically I'm proposing that apache be used as an alternative framework for
> > DBI::ProxyServer. Almost all the marshaling code and higher level logic
> > is already in DBI::ProxyServer and DBD::Proxy. Shouldn't be too hard to do
> > and you'd gain in all sorts of ways.
> 
> I think this is a really good idea.  The thing is, any effort put into
> this kind of thing right now feels like a throw away, because mod_perl
> 2.0 will solve the problem in the right way with real pooling of
> database handles (and other objects) between threads.
> 
> Maybe it's time for DBD:: authors to start checking their code for
> thread safety?

Yeap.

Tim.



Re: mod_perl on specific scripts (fwd)

2000-11-06 Thread Matthew Byng-Maddick

n 6 Nov 2000, David Hodgkinson wrote:
> Matthew Byng-Maddick <[EMAIL PROTECTED]> writes:
> > On 1 Nov 2000, David Hodgkinson wrote:
> > > Matthew Byng-Maddick <[EMAIL PROTECTED]> writes:
> > > > You do, of course, know about all the latest patches for this, due to
> > > > potential security problems
> > > ...moving to Apache 1.3.14, right?
> > Some are fixed in 1.3.14 but there are an extra set of patches for 1.3.14
> > to fix the things that weren't fixed.
> And where do these hide? I can't see them on apache.org in either
> patches directory...

Tony Finch wrote:
| I have also made the patch available from
| http://httpd.apache.org/dist/apache_1.3.14-fix.diff
| because there are a few other problems we want to fix before releasing
| 1.3.15 and getting the patch out of the bug database is unnecessarily
| painful.

>From when I spoke to Tony, he said that these were mod_rewrite isssues
too.

MBM

-- 
Matthew Byng-Maddick   Home: <[EMAIL PROTECTED]>  +44 20  8981 8633  (Home)
http://colondot.net/   Work: <[EMAIL PROTECTED]> +44 7956 613942  (Mobile)
The  Universe  shipped by  weight, not by  volume.  Some  expansion of the
contents may have occurred during shipment.





Re: dynamic vs. mostly static data

2000-11-06 Thread Vivek Khera

> "AW" == Andy Wardley <[EMAIL PROTECTED]> writes:

AW> On Nov 3,  9:52am, Ken Y. Clark wrote:
>> btw, i'd really recommend you look into using Template Toolkit.

AW> Indeed.  One of the nice things about TT (in the author's humble opinion)
AW> is that you can use the same presentation templates to render static HTML
AW> as for dynamic HTML.


I've been trying to wrap my head around TT the last few days.  What I
would like to do is make each document just plain HTML content, and
have one template that my server applies to the docs.  That is, the
template would be something like


 My Site



 [% stick in body of article here "document.main" %]
 [% stick in related info here "document.sidebar" if it exists %]



That is, I have exactly one template that I apply to each document.
Right now I do that using Sandwich and some pre-processing, but I'd
much rather let a real template system do it so I can put parts in
various places.

Is TT the something that will let me do this without too much
headache?



Re: mod_perl on specific scripts

2000-11-06 Thread David Hodgkinson

Matthew Byng-Maddick <[EMAIL PROTECTED]> writes:

> On 1 Nov 2000, David Hodgkinson wrote:
> > Matthew Byng-Maddick <[EMAIL PROTECTED]> writes:
> > > On 31 Oct 2000, David Hodgkinson wrote:
> > > > Did I just condemn you to learning mod_rewrite? Ooops :-)
> > > You do, of course, know about all the latest patches for this, due to
> > > potential security problems
> > ...moving to Apache 1.3.14, right?
> 
> Some are fixed in 1.3.14 but there are an extra set of patches for 1.3.14
> to fix the things that weren't fixed.

And where do these hide? I can't see them on apache.org in either
patches directory...

Cheers,

Dave

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Re: modifying $subr->run

2000-11-06 Thread Ken Williams

[EMAIL PROTECTED] (Todd Finney) wrote:
>>Todd Finney wrote:
>> >
>> > This another follow-up to a previous thread, "maximum (practical)
>> > size of $r->notes", from last week.   We're trying to redirect the
>> > output of $subr->run(), and return it as a variable instead of
>> > sending it to the browser.

[...]

>The only difficulty then remaining is the existing CGI 
>scripts that this system wraps.  There are several dozen of 
>these in place already, and changing the argument handling 
>would be rather tedious.  Do you know of an easy method for 
>handling that translation, 'easy' meaning 'anything easier 
>than changing all the scripts or Apache itself'. :)

Yeah, check out Apache::Filter, which has an Apache::RegistryFilter
module bundled with it.  That should let you filter the output of your
scripts, if that's what you're after.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum



Re: Apache::Scoreboard returns incomplete information to Apache::Watchdog::RunAway.

2000-11-06 Thread G.W. Haywood

Hi there,

On Mon, 6 Nov 2000, Jayme Frye wrote:

> I am setting up Apache::Watchdog::RunAway and have come across a
> problem with Apache::Scoreboard that breaks Watchdog.
[snip]
>  Apache compile time options:
> 
>  SL_BASE=SYSTEM \
>  EAPI_MM=SYSTEM \
>  CC="egcs" \
>  OPTIM="-O9

Extract from apache_1.3.14/src/Configuration:

# Optimization note: 
# Be careful when adding optimization flags (like -O3 or -O6) on the OPTIM
# entry, especially when using some GCC variants. Experience showed that using
# these for compiling Apache is risky. If you don't want to see Apache dumping
# core regularly then at most use -O or -O2.

73,
Ged.




Re: modifying $subr->run

2000-11-06 Thread Todd Finney

At 02:14 AM 11/6/00, Perrin Harkins wrote:
>Todd Finney wrote:
> >
> > This another follow-up to a previous thread, "maximum
> > (practical) size of $r->notes", from last week.   We're
> > trying to redirect the output of $subr->run(), and 
> return
> > it as a variable instead of sending it to the browser.
>
>Usually people consider this, realize that it's hard, and 
>find a way to
>do what they need in perl without going back to 
>Apache.  If all of your
>subrequests are things like static files, CGI, and SSI, 
>you may find it
>easier to generate the same results from perl code than to 
>try and
>modify core Apache architecture.  Libraries for doing most 
>common tasks
>exist (Apache::SSI, Apache::PerlRun, Apache::File).

Thanks, Perrin.  The handler uses Apache::File to serve 
static files.  I've just read the Apache::SSI 
documentation, and it looks like we can use that to cover 
most of the components.  Many of them have yet to be 
written, so it's no problem adapting to the differences in 
argument handling between CGI and .

The only difficulty then remaining is the existing CGI 
scripts that this system wraps.  There are several dozen of 
these in place already, and changing the argument handling 
would be rather tedious.  Do you know of an easy method for 
handling that translation, 'easy' meaning 'anything easier 
than changing all the scripts or Apache itself'. :)

Thanks again, and thanks to those that have been offering 
advice off-list.

cheers,
Todd





Apache::Scoreboard returns incomplete information to Apache::Watchdog::RunAway.

2000-11-06 Thread Jayme Frye

I am setting up Apache::Watchdog::RunAway and have come across a problem
with Apache::Scoreboard that breaks Watchdog. The broken thing is
access_count which is always 0 (my $count = $process->my_access_count;).
This causes process running time to continue to increase until the
Apache::Watchdog::RunAway timeout is reached and the process is marked
as hung and killed.

Sample debug output from Watchdog:
OK 3 25345 W 0 30 0
OK 8 25383 W 0 24 0
OK 7 25411 W 0 18 0
OK 11 25421 W 0 15 0
OK 2 25408 W 0 3 0
OK 2 25408 W 0 6 0
OK 3 25345 W 0 33 0
[Tue Oct 31 11:37:11 2000] Apache::Watchdog::RunAway: child proc 25345
seems
to hang -- it is running longer than limit of 30 secs
($Apache::Watchdog::RunAway::TIMEOUT).
Killing proc 25345.
OK 7 25411 W 0 21 0
OK 11 25421 W 0 18 0

>From conversations with the author of Watchdog an example of correct
output:
OK 2 13377 W 2 0 1
OK 0 13374 W 8 0 7
OK 2 13377 W 3 0 2
OK 0 13374 W 9 0 8
OK 2 13377 W 4 0 3
OK 2 13377 W 5 0 4
--
col   1  23 4 5 6

See the columns above: column 5 is the time the process is running,
column
4 is the count of requests served by the child and col6 is the last
request served. So the killing rule triggers when:
col 4 and 6 has the same value and col 5 is bigger than TIMEOUT value.

Finally here is some info on the environment this is running under.

Output from perl-status:
Embedded Perl version 5.00503 for Apache/1.3.12 (Unix) AuthMySQL/2.20
mod_perl/1.24 PHP/3.0.16 mod_ssl/2.6.4 OpenSSL/0.9.5a process 16288,
running since Tue Oct 31 16:34:26 2000

Everything is compiled from tar balls on a RH 6.2 base install. Below
are my
compile time options for apache and mod_perl:

 Apache compile time options:

 SL_BASE=SYSTEM \
 EAPI_MM=SYSTEM \
 CC="egcs" \
 OPTIM="-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro
 -march=pentiumpro -fomit-frame-pointer -fno-exceptions" \
 CFLAGS="-DDYNAMIC_MODULE_LIMIT=0 -DSINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -DBUFFERED_LOGS" \
 ./configure \
 --with-layout=GNU \
 --add-module=src/modules/experimental/mod_mmap_static.c \
 --add-module=src/modules/standard/mod_auth_dbm.c \
 --enable-module=ssl \
 --enable-rule=SSL_SDBM \
 --disable-rule=SSL_COMPAT \
 --activate-module=src/modules/php3/libphp3.a \
 --enable-module=php3 \
 --activate-module=src/modules/perl/libperl.a \
 --enable-module=perl \
 --activate-module=src/modules/auth_mysql/libauth_mysql.a \
 --disable-module=negotiation \
 --disable-module=autoindex \
 --disable-module=asis \
 --disable-module=imap

 mod_perl compile time options:

 EVERYTHING=1 \
 APACHE_SRC=../apache-1.3.12/src \
 USE_APACI=1 \
 PREP_HTTPD=1 \
 DO_HTTPD=1

 Thanks again for the help.

Jayme Frye
Senior System Administrator
Inventive Comm.
[EMAIL PROTECTED]



Problems with SERVER_MERGE and DIR_MERGE

2000-11-06 Thread Andy Wardley

I've been playing around with SERVER_CREATE, SERVER_MERGE, DIR_CREATE and
DIR_MERGE and having some mixed success.

The first problem I encountered was that my *_MERGE methods were being
ignored.  The $class->can('DIR_MERGE') and $class->can('SERVER_MERGE')
tests in the Apache::ExtUtils xs_cmd_table() sub were failing because
my methods weren't visible to the Makefile.PL.  In the short term, I
resolved this by adding

   require './Template.pm'; # Apache::Template module

to the top of my Makefile.PL.  A closer inspection revealed the
underlying problem.  The command_table() sub does the following to
load the main module file:

eval {
require "$file.pm"; # so we can see the prototypes
};
# goes on to look in other places, but not '.'

The problem is (in this case) that the require() is loading the
Template.pm module from my regular Perl library directory, rather than
the local copy which is actually Apache::Template.  I guess there
should be a 'use lib qw(.)' or even 'require "./$file.pm"' in there
instead?

Having got the subs recognised, I'm now seeing some weird results in the
order in which the subs are being called.  Here's the relevant fragment
from my httpd.conf file:

  PerlModuleApache::Template
  TT_IncludePath/home/apache/tt2
  TT_PreChomp   On

  
TT_PreChomp Off
SetHandler  perl-script
PerlHandler Apache::Template
  

My CREATE/MERGE subs (after much stripping and adding of debug code) look
like this:

  sub SERVER_CREATE {
  my $class = shift;
  my $cfg   = bless { }, $class;
  print STDERR "SERVER_CREATE($class) => $cfg\n";
  bless $cfg, $class;}

  sub SERVER_MERGE {
  my ($parent, $config) = @_;
  warn "SERVER_MERGE($parent, $config)\n";
  bless { %$parent, %$config }, __PACKAGE__;
  }

  sub DIR_CREATE {
  my $class = shift;
  my $cfg = bless { }, $class;
  print STDERR "DIR_CREATE($class) => $cfg\n";
  $cfg;
  }

  sub DIR_MERGE {
  my ($parent, $config) = @_;
  warn "DIR_MERGE($parent, $config) (", $count++, ")\n";
  bless { %$parent, %$config }, __PACKAGE__;
  }

When I fire up the server, I see the following (note the additional
debug lines generated by my TT_* config handlers)

  DIR_CREATE(Apache::Template) => Apache::Template=HASH(0x81ed0ac)
  SERVER_CREATE(Apache::Template) => Apache::Template=HASH(0x81f76b8)
  TT_IncludePath [Apache::Template=HASH(0x81ed0ac)] [/home/apache/tt2]
  TT_PreChomp [Apache::Template=HASH(0x81ed0ac)] [1]
  DIR_CREATE(Apache::Template) => Apache::Template=HASH(0x8202fd8)
  TT_PreChomp [Apache::Template=HASH(0x8202fd8)] [0]

I'm not sure why the DIR_CREATE is being called before the SERVER_CREATE.
The book (and intuition, that dangerous master) seems to imply that
SERVER_CREATE should be created first.  If I add a VirtualHost as such

  
  TT_IncludePath /foo/zzz
  

Then I see the following (with some line breaks added):

  DIR_CREATE(Apache::Template) => Apache::Template=HASH(0x81ed0ac)
  SERVER_CREATE(Apache::Template) => Apache::Template=HASH(0x81f76b8)
  TT_IncludePath [Apache::Template=HASH(0x81ed0ac)] [/home/apache/tt2]
  TT_PreChomp [Apache::Template=HASH(0x81ed0ac)] [1]
  DIR_CREATE(Apache::Template) => Apache::Template=HASH(0x8202de0)
  TT_PreChomp [Apache::Template=HASH(0x8202de0)] [0]
  DIR_CREATE(Apache::Template) => Apache::Template=HASH(0x8202eb8)
  SERVER_CREATE(Apache::Template) => Apache::Template=HASH(0x8202ed0)
  TT_IncludePath [Apache::Template=HASH(0x8202eb8)] [/foo/zzz]
  SERVER_MERGE(Apache::Template=HASH(0x81f76b8),
   Apache::Template=HASH(0x8202ed0))
  DIR_MERGE(Apache::Template=HASH(0x81ed0ac),
Apache::Template=HASH(0x8202eb8))

I'm getting an additional:

  DIR_CREATE
  SERVER_CREATE
  SERVER_MERGE
  DIR_MERGE

Which again seems rather strange.  Why the DIR_CREATE and DIR_MERGE?

Then, when I service a request from /tt/* I see not one, but two DIR_MERGE:

  DIR_MERGE(Apache::Template=HASH(0x8203164),
Apache::Template=HASH(0x8203170))
  DIR_MERGE(Apache::Template=HASH(0x8203164),
Apache::Template=HASH(0x8203170))

Can anyone explain to me what's going on?  It differs from what I'm expecting
in the following ways:

at startup:
  DIR_CREATE gets called before a SERVER_CREATE
  DIR_MERGE gets called after any SERVER_MERGE

on request:
  DIR_MERGE gets called twice

It's entirely plausable that all this is supposed to happen, but I can't
seem to make it correspond to what the book seems to tell me should happen.
Can anyone confirm that it's unexpected behaviour, or otherwise set me
straight about what's going on?

Naturally, I've checked all the documentation, FAQ's etc. that I can find
and am still none the wiser.  If there's something that I've missed then
I'd appreciate a pointer to the right clues.  I haven't gone through the
source in detail, other than finding the relevant point in mod_perl.c and
perl_config.c where the subs are being called, but it's n

Re: a web interface to visualize tables

2000-11-06 Thread G.Richter

 > > I need a tool to interactively visualize DB tables from a web
interface.
 > > Ideally this tool would let me:
 > >
 > > - rename column headers,
 > > - set cell alignments, widths, background colors,
 > > - reorder columns,
 > > - save all these visualisation settings in a DB,
 > > - it would be written in perl (even better: mod_perl),
 >

 I have written a tool that let you view/browse/search/edit database tables
 or single rows. It's a Perl modules and it's based on HTML::Embperl
 (therefore it runs under mod_perl) and DBIx::Recordset. I have used it
 sucessfully with mysql, Oracle, PostgreSQL and MSAccess, but it should also
 work for other databaseses for which a DBD driver exists.

 You can use it as standlone tool for maintaining a database or embedd it's
 (configurable) views inside of other webpages. The configurations is
 currently stored in a text file, but it should be very easy to put it into
a
 DB. A large set of configuration options exists to adapt the look and feel.

 The only reason, why I didn't released it to CPAN yet is, that I don't have
 the time to write some more docs for it (basic docs are available). If
 anybody wants to take a look at it, drop me a not and I send you a copy.

 Gerald






Re: database access

2000-11-06 Thread David Hodgkinson

"Jason Liu" <[EMAIL PROTECTED]> writes:

> In general, how should database connections be handled between parent and
> child processes?  Can you establish database connections from within a
> handler?

Absolutely. And using Abache::DBI caches the connection handle.

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



[DIGEST] mod_perl digest 10/29/2000

2000-11-06 Thread Geoffrey Young

--

  mod_perl digest
 
   October 29, 2000 - November 4, 2000

--

Recent happenings in the mod_perl world...


Features

  o mod_perl status
  o module announcements
  o mailing list highlights
  o news
  o links


mod_perl status

  o mod_perl
- stable: 1.24_01 (released October 10, 2000) [1]
- development: 1.24_02-dev [2]
  o Apache
- stable: 1.3.14 (released October 13, 2000) [3]
- development: 1.3.15-dev [4]
  o Perl
- stable: 5.6 (released March 23, 2000) [5]
- development: 5.7 [6]


module announcements

  o Apache-Filter 1.013 - Alter the output of previous handlers [7]

  o Apache-SSI 2.15 - Implement Server Side Includes in Perl [8]

  o Apache-Compress 1.003 - Send the content of an HTTP response as
gzip-compressed data [9]


mailing list highlights

  o A continuation from last week, there was lots of talk about 
mod_backhand, a load balancing module for apache, and how it 
compares with a mod_proxy front end to speed up mod_perl [10] [11]

  o The call is out for ideas for a mod_perl track at next year's
Open Source Conference [12]

  o Several URLs were provided for tools that integrate databases and
SQL with a web interface. [13]
  - http://www.oracletool.com/
  - http://phpwizard.net/projects/phpMyAdmin/index.html
  - http://kenny.itlab.musc.edu/phpSybaseAdmin/
  - http://www.php.net/manual/ref.oracle.php
  - http://www.wdbi.net
  - http://www.vilib.utac.net

  o A few techniques for handling exceptions deep within nested
subroutines [14]

  o Another performance thread - this time about thin servers, Squid,
mod_proxy, and solid-state disks [15]


news

  o Netcraft statistics are out for October [16]
 Apache 59.67% IIS 20.16%
 mod_perl 1597399 Domains, 183327 IP Addresses [17]

  o Security Space October statistics [18]
 Apache 57.84% IIS 28.12%
 10.11% (134,207) of Apache servers are running mod_perl [19]


links

  o The Apache/Perl Integration Project [20]
  o mod_perl documentation [21]
  o mod_perl modules on CPAN [22]
  o mod_perl homepage [23]
  o mod_perl list archives [24] [25]


happy mod_perling...

--Geoff
[EMAIL PROTECTED]

--
[1] http://perl.apache.org/dist/
[2] http://perl.apache.org/from-cvs/modperl/
[3] http://www.apache.org/dist/
[4] http://dev.apache.org/from-cvs/apache-1.3/
[5] http://www.perl.com/pub/language/info/software.html#stable
[6] http://www.perl.com/pub/language/info/software.html#devel
[7] http://forum.swarthmore.edu/epigone/modperl/fedunglex
[8] http://forum.swarthmore.edu/epigone/modperl/yulplandsny
[9] http://forum.swarthmore.edu/epigone/modperl/brouneeglerd
[10] http://forum.swarthmore.edu/epigone/modperl/snendblahwoi
[11] http://forum.swarthmore.edu/epigone/modperl/hiltholsnoo
[12] http://forum.swarthmore.edu/epigone/modperl/shehskelfran
[13] http://forum.swarthmore.edu/epigone/modperl/vaxpranvex
[14] http://forum.swarthmore.edu/epigone/modperl/perdzusex
[15] http://forum.swarthmore.edu/epigone/modperl/dwingnibum
[16] http://www.netcraft.com/survey
[17] http://marc.theaimsgroup.com/?l=apache-modperl-cvs&m=97308359210894&w=2
[18] http://www.securityspace.com/s_survey/data/index.html
[19] http://www.securityspace.com/s_survey/data/man.29/apachemods.html
[20] http://perl.apache.org
[21] http://perl.apache.org/#docs
[22] http://www.perl.com/CPAN-local/modules/by-module/Apache/
[23] http://www.modperl.com
[24] http://forum.swarthmore.edu/epigone/modperl/
[25] http://archive.covalent.net/modperl/



RE: database access

2000-11-06 Thread Jason Liu

Thanks for reply.

I need some information in the Oracle database for access control.  We have
some methods in our proprietary library for Oracle access.  I have a file
called GateKeeper.pm that contains the access handler, sub handler{ ... }.
I placed the same code inside and outside of the handler subroutine in
GateKeeper.pm.  When the Apache starts up, those code outside of the handler
subroutine got executed.  It queries the Oracle and writes the result in a
file.  This part works fine.  However, when I requests a file and the access
handler is triggered, I got an error message says "Undefined subroutine
&dbChannel::command called at /usr/up/papi/lib/PAPIDatabase.pm", which is a
library file that works.

In general, how should database connections be handled between parent and
child processes?  Can you establish database connections from within a
handler?

Jason



>
> "Jason Liu" <[EMAIL PROTECTED]> writes:
>
> > Hi,
> >
> > I can access oracle database from the main Apache process, but
> not from any
> > child processes.  I am fairly new to this subject, can someone
> give me some
> > advice?
>
> What error are you getting? You looked in the error logs? What do you
> mean by "main" apache process?
>
> --
> Dave Hodgkinson, http://www.hodgkinson.org
> Editor-in-chief, The Highway Star   http://www.deep-purple.com
>   Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
>   -
>




Re: database access

2000-11-06 Thread Simon_Wilcox


Are you trying to establish a persistent connection using Apache::DBI ?

  IIRC Oracle connections don't persist across forks so you should use the
  method described in the Apache::DBI manpage to establish one connection
  per child:

Apache::DBI->connect_on_init($data_source, $username, $auth, \%attr)

But I could be wrong as I don't use Oracle !

You might want to check out the mailing list archive at
http://forum.swarthmore.edu/epigone/modperl/

HTH,

Simon Wilcox.





   From   "Jason Liu" <[EMAIL PROTECTED]>Date
   6 November 2000


To  
[EMAIL PROTECTED]  Time  12:02 



  Copy to (bcc: Simon Wilcox/BASE/WilliamsLea)



  Bcc Simon Wilcox/BASE/WilliamsLea



  Fax to



  Subject   database access





Hi,

I can access oracle database from the main Apache process, but not from any
child processes.  I am fairly new to this subject, can someone give me some
advice?

Thanks in advance,

Jason










   __


   This email contains proprietary information some or all of which may be
   legally privileged.  It is for the intended recipient only. If an addressing
   or transmission error has misdirected this email, please notify the author by
   replying to this email. If you are not the intended recipient you must not
   use, disclose, distribute, copy, print, or reply on this email.





Re: database access

2000-11-06 Thread David Hodgkinson

"Jason Liu" <[EMAIL PROTECTED]> writes:

> Hi,
> 
> I can access oracle database from the main Apache process, but not from any
> child processes.  I am fairly new to this subject, can someone give me some
> advice?

What error are you getting? You looked in the error logs? What do you
mean by "main" apache process?

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



database access

2000-11-06 Thread Jason Liu

Hi,

I can access oracle database from the main Apache process, but not from any
child processes.  I am fairly new to this subject, can someone give me some
advice?

Thanks in advance,

Jason




Re: dynamic vs. mostly static data

2000-11-06 Thread Andy Wardley

On Nov 3,  9:52am, Ken Y. Clark wrote:
> btw, i'd really recommend you look into using Template Toolkit.

Indeed.  One of the nice things about TT (in the author's humble opinion)
is that you can use the same presentation templates to render static HTML
as for dynamic HTML.

For example, you can create a template which uses the DBI plugin to
access some data and display it nicely (see the other thread on "a web
interface to visualize tables").

e.g.

   [% INCLUDE header
  title = "Some Funky Data" %]

   [% USE DBI(dsn) %]
   [% USE Table(DBI.query('SELECT * FROM blah'), rows=10) %]
   
   [% FOREACH row = Table.rows %]
   
 [% FOREACH item = row %]
 [% item %]
 [% END %]
   
   [% END %]
   

   [% INCLUDE footer %]

You can deliver this page from Apache/mod_perl to have it constructed
on-the-fly, or you can use 'tpage' or 'ttree' (distributed with the
Template Toolkit) to create the content offline as a static page.
Both dynamic and static pages can shared the same presentation elements
(e.g. header/footer in this example), and both have full access to the
TT plugins to fetch DBI data, display tables, etc.

'ttree' is your friend.  You can define as many templates like this as
you like, stuff them all in a directory somewhere, setup a ttree config
file, and then just call 'ttree -f my_config_file' to have it process
all and any such templates and copy the output to your static HTML
directory.

See the copious TT documentation (perldoc ttree, perldoc Template) for
further info.  The TT web site also has my paper from TPC4 which
discusses these techniques at greater length.

  http://www.template-toolkit.org/

HTH
A


-- 
Andy Wardley <[EMAIL PROTECTED]>   Signature regenerating.  Please remain seated.
 <[EMAIL PROTECTED]>   For a good time: http://www.kfs.org/~abw/



Re: a web interface to visualize tables

2000-11-06 Thread Andy Wardley

On Nov 1,  4:57pm, Louis-David Mitterrand wrote:
> I need a tool to interactively visualize DB tables from a web interface.
> Ideally this tool would let me:
>
> - rename column headers,
> - set cell alignments, widths, background colors,
> - reorder columns,
> - save all these visualisation settings in a DB,
> - it would be written in perl (even better: mod_perl),

Have a look at the Template Toolkit, and in particular the DBI and Table
plugins.

The DBI plugin does pretty much what you would expect.  The Table plugin
takes some data (including the data iterator returned by the DBI plugin)
and allows you to format it in a virtual table.  How you present the
data is then entirely up to you, and is controlled by templates.

Here's an example adapted from the manpage for the Table plugin.

[% USE DBI(dsn,user,pass) -%]

# query() returns an iterator
[% results = DBI.query('SELECT * FROM alphabet ORDER BY letter') %]

# pass result set into Table plugin
[% USE table(results, rows=8, overlap=1, pad=0) -%]


[% FOREACH row = table.rows -%]

  [% row.first.letter %] - [% row.last.letter %]
  [% FOREACH item = row %]
  [% item %]
  [% END %]

[% END %]


The key concept is that the Table plugin does nothing more than order
your data into virtual rows and/or columns.  You can then iterate through
the data by row, column, or any combination of the two, and present it
any way you wish, by use of templates (*real* templates, not the embedded
Perl variety).  In other words, it gives you a clear separation between
data, logic and presentation.

For different presentation styles, you can simply create different
template components to display the data, e.g.

[% USE DBI(dsn,user,pass) -%]

[% results = DBI.query('SELECT * FROM alphabet ORDER BY letter') %]

[% INCLUDE fancy_table  %]
[% INCLUDE plain_table  %]
[% INCLUDE boring_table %]

See http://www.template-toolkit.org/
 or http://www.cpan.org/modules/by-module/Template/

HTH
A




-- 
Andy Wardley <[EMAIL PROTECTED]>   Signature regenerating.  Please remain seated.
 <[EMAIL PROTECTED]>   For a good time: http://www.kfs.org/~abw/



Re: Sharing vars across httpds

2000-11-06 Thread Steven Cotton

On Mon, 6 Nov 2000, Differentiated Software Solutions Pvt. Ltd wrote:

> Hi,
> 
> We want to share a variable across different httpd processes.
> Our requirement is as follows :

Look at the IPC::* modules, IPC::ShareLite will do exactly what you
need.

-- 
steven





Sharing vars across httpds

2000-11-06 Thread Differentiated Software Solutions Pvt. Ltd



Hi,
 
We want to share a variable across different httpd 
processes.
Our requirement is as follows :
 
1. We want to define one variable (which is a large 
hash).
2. Every httpd should be able to access this 
variable (read-only).
3. Periodically (every hour) we would like to have 
another mod_perl program to refresh/recreate this large hash with new 
values
4. After this, we want the new values in the hash 
to be available across httpds
 
How do we do this ??
Thanks for helping us.
 
Regards,
 
Murali
 
Differentiated Software Solutions Pvt. Ltd.176, 
Ground Floor, 6th Main,2nd Block, RT NagarBangalore - 560032Phone : 
91 80 3431470www.diffs-india.com