RE: mod_perl and NES/iPlanet

2001-05-23 Thread Niral Trivedi

You are right Gunther 

We are looking something similar as mod_perl for iPlanet.. basically a way
to have perl interpreter running as server process itself...

I will look into Speedy::CGI or NSAPI_PERL.

Thanks a lot..

Niral

-Original Message-
From: Gunther Birznieks [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 10:36 AM
To: Niral Trivedi; '[EMAIL PROTECTED]'
Subject: Re: mod_perl and NES/iPlanet


If you just want to speed up CGI Scripts, Speedy::CGI is a good, supported 
persistent perl mechansim that plugs in well in an Iplanet WEb Server 
environment.

I think someone did make an NSAPI_PERL but I Don't know how well that is 
really supported.

At 10:21 AM 5/23/01 -0400, Niral Trivedi wrote:
>All,
>
>I know this is stupid question... but I want to confirm this thing from
>apache/mod_perl Gurus here..
>
>mod_perl can not be used with NES or iPlanet web server, right?
>
>We are so much screwed up here with iPlanet but we have to use that for
some
>other reasons.. So, we were exploring the possibilities..
>
>Niral

__
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/



mod_perl and NES/iPlanet

2001-05-23 Thread Niral Trivedi

All,

I know this is stupid question... but I want to confirm this thing from
apache/mod_perl Gurus here..

mod_perl can not be used with NES or iPlanet web server, right?

We are so much screwed up here with iPlanet but we have to use that for some
other reasons.. So, we were exploring the possibilities..

Niral




RE: Pointer to a CGI.pm list

2000-10-03 Thread Niral Trivedi

check 'perldoc CGI'

and by the way.. what is your problem.. if you can give a snippet of your
error and/or code then somebody may be able to help you..

Niral

-Original Message-
From: Roderick A. Anderson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 03, 2000 5:17 PM
To: [EMAIL PROTECTED]
Subject: Pointer to a CGI.pm list


Sorry but I've run out of sources.  (Don't have netnews.)  Is there a
mailing list for CGI.pm?  I've done all I can by reading the 'the book'
and searching the net.  Can't find anything like the symtoms I'm seeing.
   Actually the problem may be a lack of perl knowledge on my part but it
manifests itself when using CGI.pm so I have to start there.

Again sorry to ask here.

Rod
--
Roderick A. Anderson
[EMAIL PROTECTED]   Altoplanos Information Systems, Inc.
Voice: 208.765.6149212 S. 11th Street, Suite 5
FAX: 208.664.5299  Coeur d'Alene, ID 83814



may be an offtopic question

2000-08-30 Thread Niral Trivedi

Hello All,

Sorry for asking this question, but If you know any other mailing list
to post this message, please give me the address...

I know that perl 5.6 does support to some extent utf8 and unicode.. but
can somebody point to me some site or resources which has examples on
that??? Because I couldn't find any useful information from the perldoc
for utf8 or perlunicode.. 

I have read some posts yesterday regarding creating multilingual website
in here..and I have already checked webtechniq.com (sorry if spelling is
wrong.. but believe me i've checked that site).But I need to check some
kind of examples or something if possible..

Any help is accepted..

TIA

Niral



Re: cleaning old Apache::Session's

2000-06-02 Thread Niral Trivedi

Tobias,

What do you exactly mean by line 'Internally the session will expire
after 30 minutes.'???

Is it something internal to Apache::Session or you have it programmed on
custom basis or what???

Niral

Tobias Hoellrich wrote:
> 
> At 09:26 AM 6/2/00 +1000, Adam Cassar wrote:
> >I was wondering how people are clearing out old Apache::Session's
> >
> >No timestamp is used on the fields used by Apache::Session, so how do
> >we clear the old sessions?
> >
> >I am not talking about the delete() method to remove a session, as that
> >presumes that a user will always leave your site via pre-defined access
> >points.
> >
> 
> Adam,
> 
> nobody stops you from adding a timestamp :-)
> 
> mysql> describe sessions;
> +---+---+--+-+-+---+
> | Field | Type  | Null | Key | Default | Extra |
> +---+---+--+-+-+---+
> | id| varchar(16)   |  | MUL | |   |
> | modtime   | timestamp(14) | YES  | | NULL|   |
> | a_session | blob  | YES  | | NULL|   |
> +---+---+--+-+-+---+
> 3 rows in set (0.00 sec)
> 
> For every access to a session entry mysql will automatically set the first
> timestamp field in a row to the current time. We run a cronjob every 15
> minutes, which does a:
> 
> #!/bin/sh
> /usr/local/mysql/bin/mysql -px -u sessions << EOSQL
>   delete from sessions where time_to_sec(now()) - time_to_sec(modtime) >
> 60*60;
> EOSQL
> 
> to clear any session entry older than one hour. Internally the session wil
> expire after 30 minutes.
> 
> Hope this helps
>Tobias



Apache::Session

2000-06-01 Thread Niral Trivedi

All,

I need to clear myself on a small issue regarding Apache::Session.

As per my understanding, Apache::Session will store session information
in a backing store-either a flat file or in some database. And
everytime, request comes in, it will check for sessionID in backing
store and retrieve all information for that session. If request is new
than it will create new sessionID and also create an entry in backing
store..

Now, only way to remove this information from backing store is to do
'tied(%session_hash)->delete', Am I right? I mean is there any way we
can remove these entries by setting 'time_out_interval' or something
like that?? 

Because if we do 'tied(%session_hash)->delete' then it will create new
session for every request... So, I was thinking of not doing
'tied->delete' but write a small cron script which runs at specified
interval and removes entry from backing store which are older than some
time...

Because concept of 'time_out_interval' does exist in Apache JServ and
other application servers..

Any ideas, suggestions or pointers on this???

Thanks again..

Niral
--



Re: Apache::Session

2000-06-01 Thread Niral Trivedi

Yup...

you were right Josh 

But actually I have defined that column as 'text' and not 'BLOB'.. But,
I wrote a small script to write query on that column and I was able to
see that.. So, my confusion has gone now..

The reason why I was wondering is, I had one application in which I am
using 'text' column and when I check that column on command prompt I am
able to see contents for that.. So, I was like, why its working for that
and not for this..

But oh well..

Thanks again...

Niral

[EMAIL PROTECTED] wrote:
> 
> In a message dated 6/1/2000 10:59:48 AM Eastern Daylight Time,
> [EMAIL PROTECTED] writes:
> 
> > Now, I am successfully able to run the script and generate sessionID and
> >  store that sessionID in MySQL database table.. But column 'a_session' is
> >  always empty!! Following is my code.. When I ran this code first time, I
> >  thought, I will have value of '$name' in column 'a_session' but I was
> >  wrong!! I mean I am in impression that, in MySQL datastore we can store
> >  all information about session for a particular sessionID. But it's not
> >  the case.. Whereas if I run the sample example which uses
> >  Apache::Session::File, I can see value of '$name' in the actual session
> >  file!!! So, Can somebody clear my doubts here??
> >
> >  Thanks in advance..
> 
> If you followed the perldocs, you also made a_session a BLOB.
> You won't be able to see the contens of the BLOB doing a
> simple select from a command line SQL interface. A BLOB is
> binary data.
> 
> Plus, it has three columns, not two as you say...
> id varchar(16)
> length int(11)
> a_session blob
> 
> -Josh Narins



Apache::Session

2000-06-01 Thread Niral Trivedi

All,

I have just installed Apache::Session successfully with Apache/mod_perl
version 1.24..

I have two sample script one from example avaiable with installation
which uses 'Apache::Session::File' for session tracking and other file,
I have created from the given example but that uses
'Apache::Session::MySQL' as object store...

I have also created database called 'sessions' in which I have table
called 'sessions' which has two columns as per the perldoc. First is
'id' which is primary key and second is 'a_session'.

Now, I am successfully able to run the script and generate sessionID and
store that sessionID in MySQL database table.. But column 'a_session' is
always empty!! Following is my code.. When I ran this code first time, I
thought, I will have value of '$name' in column 'a_session' but I was
wrong!! I mean I am in impression that, in MySQL datastore we can store
all information about session for a particular sessionID. But it's not
the case.. Whereas if I run the sample example which uses
Apache::Session::File, I can see value of '$name' in the actual session
file!!! So, Can somebody clear my doubts here??

Thanks in advance..
---
#!/usr/local/bin/perl5.00503

use strict;

use CGI;
use DBI;
use Apache::Session::MySQL;
my($query) = new CGI;
print $query->header;

#
 DB Connection 
my($dbh) = DBI->connect("DBI:mysql:$DB",$DBUSER,$DBPASS, {
PrintError => 1, # warn() on errors
RaiseError => 0, # don't die on error
AutoCommit => 1, # commit executes immediately
});
my($sessionID) = $ENV{'PATH_INFO'};
$sessionID =~ s/^\///;
$sessionID = $sessionID ? $sessionID : undef;
my %session;
my($name) = $query->param('name');

tie %session, 'Apache::Session::MySQL',$sessionID, {
Handle => $dbh,
LockHandle => $dbh
};
$session{name} = $name if $name;

print "Hello\n";
print "Session ID number is: $session{_session_id}\n";
print "The Session ID is embedded in the URL\n";
print "\n";
print "Your input to the form was: $name\n";
print "Your name is $session{name}\n";
print "\n";
print "Reload
this session\n";
print "New
session\n";
print "\n";
print "Type in your name here:";
print "\n";
print "\n";
print "\n";
---

Niral



Apache::StatINC

2000-05-26 Thread Niral Trivedi

All,

First of all sorry for writing long email... but I think, I thought, it
would be better to explain what I am doing here, and so that you can
answer my question more easily...

I have successfully installed Apache 1.3.12 and mod_perl 1.24 and
Apache::DBI .87 on Solaris 2.7. And I am able to do successful
persistent DB connection with this..

Also, I have enabled Apache::StatINC by adding line  'use
Apache::StatINC;' in startup.pl file and follwoing lines in 'httpd.conf'
file

PerlInitHandler Apache::StatINC
PerlSetVar StatINCDebug On

Now, problem starts here... I have created two mod_perl script, one
module configuration file for this two main perl script and one libraray
file which is just collection of all the common subroutines for the two
main perl script.

If I call first mod_perl script from the webpage, it works fine.. for
any number of times and I will get following in my error_log file:
--
656 Apache::DBI need ping: yes
656 Apache::DBI already connected to
'DB_NAMEDBUSERNAMEDBPASSWORDAutoCommit=1RaiseError=0PrintError=1'
656 Apache::DBI disconnect (overloaded) 
--
And this will be repeated with for any number of times I access the same
script.. WITH same pid.. but when I tried to execute second perl script,
it will fail with error like following :
---
[Fri May 26 11:56:44 2000] [error] Undefined subroutine
&Apache::ROOT::perl::file_repository::_2eadm::user_list_2epl::escapeChars
called at
/export/home/niral/Apache/apache/mod_perl/file_repository/.adm/user_list.pl
line 46.
---

now 'escapeChars' is a subroutine I have in common libraray file and not
in 'user_list.pl'. 

But before, I was used to receive errors which looks like :
Apache::StatINC <..Something.> Trying to load 'some_lib_file'
eval {...} called at <.SOMETHING.> 

So, why am I not getting those kind of errors now???

Can somebody give any idea on that???

Thanks in advance..

Niral
--



Re: Confusion on Apache::DBI

2000-05-18 Thread Niral Trivedi

I understood now...

Thank you all for your responses..

Niral

Perrin Harkins wrote:
> 
> On Thu, 18 May 2000, Niral Trivedi wrote:
> > Now, with Apache::DBI, we'll have one DBI handle per child process
> > during the server startup. Now, let's say one child has started its
> > processing and hasn't served any request yet. Now, first request comes
> > in and it will look for DB handle, which is available and start
> > processing it. Now, second request comes in for same child process and
> > request for DBI handle, which is still serving first request.
> 
> Niral, you're not understanding Apache's multi-process daemon
> approach.  No child process will ever try to serve more than
> request at once.  These are not multi-threaded processes.
> 
> - Perrin



Re: Confusion on Apache::DBI

2000-05-18 Thread Niral Trivedi

Geoff,

I know, once child dies, db handle goes out of scope and DBI cleans up
the connection..

What I was asking is, we have directive called 'MaxRequestPerChild' for
Apache server configuration which basically says how many request one
child can process before it dies. So, if we have in 'httpd.conf' file
'MaxRequestPerChild 1000', that means, one child process will serv 1000
request and then it will die.

Now, with Apache::DBI, we'll have one DBI handle per child process
during the server startup. Now, let's say one child has started its
processing and hasn't served any request yet. Now, first request comes
in and it will look for DB handle, which is available and start
processing it. Now, second request comes in for same child process and
request for DBI handle, which is still serving first request. So, what
happened at this time to second request?? Does it have to wait for DBI
handle to be free?? That's my question..

I think, second request has to wait.. i.e. it will be the same as normal
CGI.. only difference is, we'll save overhead of opening a DB connection
each time request comes in.. Correct me if I am wrong..

And I'll look in DBI::Proxy ..

Thanks again for your help Geoff..

Niral

Geoffrey Young wrote:
> 
> > -Original Message-
> > From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 18, 2000 3:15 PM
> > To: Geoffrey Young
> > Cc: '[EMAIL PROTECTED]'
> > Subject: Re: Confusion on Apache::DBI
> >
> >
> > Thanks Geoff,
> >
> > You were right... I was using "DBI:mysql:DBNAME::localhost" as connect
> > string in startup file whereas "DBI:mysql:DBNAME" in my mod_perl
> > script.. I have changed that and it worked...
> >
> > Now, another question.. As we agreed, we can have as many db handle
> > available as server processes are running..
> >
> > Now, can we set number of  db connection per server process
> > in script or
> > in startup script or any other way???
> >
> > Because what I see is in this way... Let's say a child process can
> > handle 10 request and then dies.. now it has one db connection
> > available..
> 
> I believe that once the child dies, $dbh goes out of scope and DBI cleans up
> the connection.  I could be wrong, though...
> 
> > and it is processing one request which uses available db
> > handle.. now what happen if another request comes in and ask
> > for same db
> > handle???
> 
> well, another request won't come in and ask for the _same_ handle that died
> with the other child - that's the nature of Apache::DBI, one handle per
> child.  It's not a pool of shared connections, really...  Apache will either
> serve the new request to an existing child (which would get a cached
> connection) or initialize a new child (which would subsequently open a new
> connection and cache it)...
> 
> > does that request has to wait for that or what???
> > If yes, then
> > is there any way we can set number of connection per process?? I mean
> > each child process can have 5 db connection open at the same
> > time.. and
> > it can grow upto 10.. So, if all 5 db handle are in use, and if 6th
> > request comes in then process will open another connetion and
> > it can do
> > like this upto max of 10 connection..
> >
> > Is it possible??? has anybody done this kind of things before
> 
> folks have talked about this type of stuff on the dbi-users list - it comes
> up every so often...
> 
> I don't know that anyone has implemented a solution, though you might try
> looking at DBI::ProxyServer - I think it does something like this (though I
> haven't looked at it myself)
> 
> --Geoff
> 
> >
> > Thanks again for your help..
> >
> > Niral
> >
> > Geoffrey Young wrote:
> >
> > >>
> > >>



Re: Confusion on Apache::DBI

2000-05-18 Thread Niral Trivedi

Thanks Geoff,

You were right... I was using "DBI:mysql:DBNAME::localhost" as connect
string in startup file whereas "DBI:mysql:DBNAME" in my mod_perl
script.. I have changed that and it worked...

Now, another question.. As we agreed, we can have as many db handle
available as server processes are running..

Now, can we set number of  db connection per server process in script or
in startup script or any other way???

Because what I see is in this way... Let's say a child process can
handle 10 request and then dies.. now it has one db connection
available.. and it is processing one request which uses available db
handle.. now what happen if another request comes in and ask for same db
handle??? does that request has to wait for that or what??? If yes, then
is there any way we can set number of connection per process?? I mean
each child process can have 5 db connection open at the same time.. and
it can grow upto 10.. So, if all 5 db handle are in use, and if 6th
request comes in then process will open another connetion and it can do
like this upto max of 10 connection..

Is it possible??? has anybody done this kind of things before

Thanks again for your help..

Niral

Geoffrey Young wrote:

>>
>>



Confusion on Apache::DBI

2000-05-18 Thread Niral Trivedi

All,

Sorry if this question sounds stupid.. but I am new to mod_perl and
Apache::DBI.. I have successfully installed Apache Server 1.3.12 and
mod_perl 1.24 and Apache::DBI 0.87 on Solaris 2.7.

And I have tested all successfully... But confusion arised when I
created a startup.pl file and tried to initiate DB connection in
startup.pl file using 'connect_on_init' from Apache::DBI

As I understood, if you have 'connect_on_init' in startup file, you have
preloaded DB handle when first request comes in. And you don't need to
open new db connection... But if I check the error_log file, I still
have entry saying something like following: 

10803 Apache::DBI need ping: yes
10803 Apache::DBI new connect to
'DatabaseNameUsernamePasswordAutoCommit=1PrintError=1'
10803 Apache::DBI disconnect (overloaded) 

And I will get this for first 4-5 request but after that each time I am
getting 

10803 Apache::DBI need ping: yes
10803 Apache::DBI already connected to
'DatabaseNameUsernamePasswordAutoCommit=1PrintError=1'
10803 Apache::DBI disconnect (overloaded) 

Why is that??? Shouldn't I supposed to get 'already connected to'
statement right from the first request 

And how many open connection can I have at the same time?? As per my
understood, for Apache::DBI connection pooling is based per server
process. So, I guess as many server process you have, you can have db
connection handle open at the same time.. AM I RIGHT HERE?

Please clear my doubts on this...

And thanks for your help ...

Niral



may be an offtopic question..

2000-05-10 Thread Niral Trivedi

All,

I am not sure whether this is the right place to ask this question...
sorry if not..

My question is, Can we use custom database for authentication with
Apache instead of default text based authentication???

Has anybody done that before?? I have looked apache site and cpan site..
but couldn't find any documentation...

Can  somebody give me some idea please??

Thanks in advance..

Niral
-- 
Regards...

Niral K. Trivedi, Planet Access Network Inc.
Email : [EMAIL PROTECTED]
Phone : 973-691-4704 x134



may be an off topic question..

2000-04-06 Thread Niral Trivedi

All,

I am not sure whether this is the right group to post this question.. I
have found this thing in book "Writing Apache Modules with PERL and C"
from O'Reilly..

This book has a topic in it in which it has given an example using a
module called 'IPO::Shareable' which is available from CPAN site..

So, has anybody ever used this module to store state information for
commercial application??? 

Because I need that capability for one of upcoming project.

So, if anybody has ever used this module or any other module, can he/she
please tell me how do they like it??? Is it good for developing
commercial application or not??

Thanks in advance for any suggestions..

Niral
-- 
Regards...

Niral K. Trivedi, Planet Access Network Inc.
Email : [EMAIL PROTECTED]
Phone : 973-691-4704 x134



Re: Apache::DBI problem..

2000-04-05 Thread Niral Trivedi

Actually I already have MySQL module installed on our machine... Because
I am able to run cgi/perl script which uses DBI module..

I mean I am able to run any normal cgi script.. So, I think that
suggests that we have all the required module installed on our machine..

Niral

Rajesh Kumar Mallah wrote:
> 
> Did you install DBD ?? fro the particular database you installed.
> eg for mysql install
> 
> cpan> install Bundle::DBD::mysql
> 
> Rajesh Kumar Mallah
> ---
> Learning Universe Pvt. Ltd.
> 59 Mandakini, GK IV, New Delhi 110019
> Tel: (91-11) 6412100, 6480342, 6480365
> http://www.egurucool.com
> email: [EMAIL PROTECTED]
> ---

-- 
Regards...

Niral K. Trivedi, Planet Access Network Inc.
Email : [EMAIL PROTECTED]
Phone : 973-691-4704 x134



Apache::DBI problem..

2000-04-04 Thread Niral Trivedi

All..

I am new to mod_perl so, please forgive me if this questions sounds
stupid..

I have successfully installed mod_perl 1.22 and Apache 1.3.12 under
BSD/OS BSDI 3.1 And able to run normal cgi script... But problem occurs
while I am trying to run script with DBI..

I have successfully installed Apache::DBI from CPAN site which is
version 0.87

When I am trying to start Apache after installing Apache::DBI, I am
getting following errors:
--
Syntax error on line 935 of
/zen/home/niral/Apache/apache/conf/httpd.conf:
Can't load '/usr/local/lib/perl5/site_perl/i386-bsdos/auto/DBI/DBI.o'
for module DBI: can't resolve undefined symbols: Inappropriate file type
or format at /usr/local/lib/perl5/i386-bsdos/5.00401/DynaLoader.pm line
155.

 at /usr/local/lib/perl5/site_perl/DBI.pm line 158
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/DBI.pm line 158.
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/Apache/DBI.pm line 4.

./apachectl start: httpd could not be started
---
following is the snippets from my httpd.conf file:
---
Alias /perl/  /zen/home/niral/Apache/apache/test/
#PerlRequire /zen/home/niral/Apache/apache/conf/startup.pl
PerlModule Apache::DBI ### This is line 935


SetHandler  perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options ExecCGI



SetHandler  perl-script
PerlHandler Apache::Status

]
I have tried to do this using startup.pl file as well.. but getting same
error.. 

After searching different mailing lists, I have found that this is very
common problem for users on RedHat Linux... But couldn't find anything
for BSDI 

I also found one link to
http://perl.apache.org/guide/troubleshooting.html#Can_t_load_auto_DBI_DBI_so_
but don't know how to check that thing?? I mean how can you check that
all modules are compiled with same perl version

Please give me some idea on this..

Thanks in advance for your help..

Niral
-- 
Regards...

Niral K. Trivedi, Planet Access Network Inc.
Email : [EMAIL PROTECTED]
Phone : 973-691-4704 x134