RE: [OT] unsubscribing was Re: Varaible scope & memory under mod_perl

2001-03-14 Thread Steven Zhu

First of All, I would like to thank you all for quick responses.

This is my situation. I originally joined this list as
another user (having different user email account). Now I got those emails
from the alias of my original account. If I just send mail to
[EMAIL PROTECTED], I believe that it does not help because I
never joined the list as my current email. How could I unsubscribe my
original account by my current email. Is there any way I could put my
original email
in the body or somewhere. Thanks again


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of B. Burke
Sent: Wednesday, March 14, 2001 10:21 AM
To: [EMAIL PROTECTED]
Subject: [OT] unsubscribing was Re: Varaible scope & memory under
mod_perl


I really don't see the point in putting list info in the headers.  The
people that
have to ask these questions usually don't have full headers turned on.

Why not put it at the bottom of each email instead of the headers like some
other lists do?  It would take up the same amount of space, and it would
eliminate the 'how do I unsubscribe' and 'uuugh...see headers' emails.

Brian B.


ed phillips wrote:

> agh!
>
> check the headers!
>
> Steven Zhu wrote:
>
> > How could I unsubscribe from [EMAIL PROTECTED] you so
> > much.Steven.
> >
> >  -Original Message-
> >




RE: Varaible scope & memory under mod_perl

2001-03-14 Thread Steven Zhu



How could I 
unsubscribe from [EMAIL PROTECTED]
Thank you so 
much.
 
Steven.

  -Original Message-From: Issac Goldstand 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, March 14, 2001 9:00 
  AMTo: [EMAIL PROTECTED]Subject: Varaible scope & 
  memory under mod_perl
  I have a module that I built on my own to handle 
  user authentication.  At the moment, every perl script that I have calls 
  a method in this module using a cookie (Supplied by browser) as an 
  argument.  Eventually I want to turn this into a mod_perl handler which 
  instead of returning the autherized user information (in a scalar called $uid) 
  will add a key to $ENV containing the authorized user id.
   
  However, for the moment I have trouble in that 
  the $uid variables (or possibly the $cookie variables) are being remembered 
  between callings of the scripts.  This results in unauthenticated users 
  recieving access t incorrect accounts.  (Even authenticated users get 
  other peoples accounts occasionally).
   
  In short, the module is called 
  TFile::Authenticate, and it has a "use" line in my mod_perl startup script, to 
  maximize persistance and minimize compile/load time.  Additionally, each 
  cgi script (for they are still all scripts) "use"s the module.
  Basically, the common authorization code in each 
  script looks something like this:
   
  my $q=new CGI;my 
  $cookid=$q->cookie('sessionlid');if (!(defined($cookid))) {print 
  "Location: /login.html\r\n\r\n";exit;}my $uid=eval 'check_auth($cookid);'; 
  
  #The above line calls the authentication script 
  which will return a valid $uid or undef if not validif (!(defined($uid))) 
  {print "Location: /login.html\r\n\r\n";exit;}my 
  $cookie=$q->cookie(-name=>"sessionlid",-value=>$cookid,-expires=>expdate_auth($cookid));
   
  The scripts then proceed to do their work and 
  when they return content, contain the command 
   
  print STDOUT "Set-Cookie: 
  $cookie\r\n";
   
  Now I _know_ that some of the variables are being 
  persistant, because when doing a telnet localhost 80, and requesting a 
  script, I actually got a response including a cookie for a valid 
  authentication.  Now, I'm still really not sure about 
  how the persistance works, so I suppose I could just do something 
  like:
   
  my $uid=undef;
  my $cookid=undef;
  my $cookie=undef; 
   ...
   
  If I include that at the beginning of all of the scripts, it could work, 
  but it seems to me to be a bit messy; I'm sure there's a better way.
   
  Additionally, can anyone think of a better way to add a handler to 
  the existing TFile::Authenticate module for mod_perl scripts, while leaving 
  the public interfaces open for normal CGI (or any other) scripts?
   
    Thanks, 
    Issac  
   
  Internet is a wonderful mechanism for making a 
  fool ofyourself in front of a very large audience.  
  --Anonymous Moving the mouse won't get you into trouble...  
  Clicking it might.  --Anonymous PGP Key 0xE0FA561B - 
  Fingerprint:7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 
  561B


Re: Missing src/include/alloc.h ?

2000-08-27 Thread Steven Zhu

Hi Gang:

First of all, i would like to apologize this email for non-modperl question. I
really have trouble to
find correct discussion group to ask help. The question is:

I wrote a perl script to send out my postcard for over 300 my friends. The
textbody is my postcard which is html file
including over 30 images. I want all of my friends see the postcard immediately
but not html file. I tried and tested. My friends
just got html file not postcard. How can i do that? I know that if you send it
from netscape message, you have choice using
send html but i have to write script for over 300 people. Is any way to do
that? Thank you very much for advices. Enclude
is the original script:

#!/usr/bin/perl  -w

$|=1;

  $body = `cat ./test.html`;

  open(ADDR, "./testaddr");
  while() {
   $all_info = $_;
   ($addressee,$lastname,$firstname) = split(/\|/,$all_info);
   #$addressee =~ s/^\s+//;
   #$addressee =~ s/\s+$//;
   #$comment =~ s/^\s+//;
   #$comment =~ s/\s+$//;

   if($addressee =~ /\@/) {
  chop $firstname;
  open( OUTPUT, "| /usr/lib/sendmail -oi " . $addressee ) ;
  select( OUTPUT ) ;
  print "To: <$firstname $lastname> <$addressee>\n" ;
  print "From: Postcard_Center\@test\.com\n";
  print "Subject: Win A Free Visit from TEST.COM\n\n";
  print "\nDear $firstname $lastname,\n\n\n";
  print "$body\n";
   }
  }

  close(ADDR);

exit(1);

testaddr is text file for all of email address.
test.html is body which is html file.
I hope that my friends can see my postcard not html source. Thank you very
much.

Steven.

George Sanderson wrote:

> I down loaded the CVS file apache-1.3_2825041201.tar.gz and attempted a
> make, that included:
> --add-module=/usr/src/mod_layout-2.3/mod_layout.c
> It expects src/include/alloc.h
> I noticed that this header file was included in the apache_1.3.12
> distribution.
> Is the file missing?




Re: Web server log wrong time.

2000-07-17 Thread Steven Zhu

Hi Jim:

We are starting httpd web server as root, then spawn httpd as www. They all
have timezone setup as CDT. I checked the date from different shell. They are
all correct. I have /etc/localtime pointing to /usr/share/zoneinfo/US/Central.
I don't know why it uses raw clock. Thank you very much.

Steven.

Jim Woodgate wrote:

> Steven Zhu writes:
>  > I compiled and installed new web server (most recent apache and mod
>  > perl). Every is fine except that all scripts show wrong time. But it is
>  > not only script problem. If i checked with the access.log file, the log
>  > time is also wrong. For instance, the current local time is 11:38
>  > and my system time is also 11:38. But the script shows the result: 16:38
>  > and access.log file shows 16:38. it is always 5 hrs more. It is really
>  > timezone problem. I compiled apache many times, never met the situation.
>  > Because it was compiled by local machne, the default timezone should be
>  > same as my local machine timezone but it is not. How can i reset the
>  > timezone from httpd.conf or Do i need to recompile the apache or any
>  > another way i can do? Please help me. Thank you very much...
>
> are you running httpd as yourself or another user?  The 5 hour time
> difference sounds like it's using the raw clock and no timezone...
>
> If you are running httpd as yourself, you might want to try:
>
> $ sh date
>
> to make sure that shells you spawn also have the same date as your
> shell...
>
> --
> [EMAIL PROTECTED]




Re: Web server log wrong time.

2000-07-15 Thread Steven Zhu

Hi Tom:

Thank you for your quick answer. Actually i set my machine timezone point to
-> /usr/share/zoneinfo/US/Centeral.
This is why my machine system time is correct without any problem. If my
script runs from command line, it is also correct. The only problem comes from
web server which logs wrong time and shows wrong time on broswer. Is anyway to
make web server timezone same as system timezone. How could web server has
different timezone? Is anywasy to reset web server timezone in httpd.conf or
somewhere else. Thank you very much.

Steven...

Tom Brown wrote:

> This might be a reflection of how you're starting you copy of Apache...
> make sure that all the normal stuff that's done in a shell is done before
> apache gets started... this might be as simple as setting a TZ environment
> variable... on a linux box it should be a moot point, as /etc/localtime
> should point to the right timezone file...
>
> [root@americium ~]# ll /etc/localtime
> lrwxrwxrwx   1 root root   36 Aug 17  1998 /etc/localtime ->
> ../usr/share/zoneinfo/Canada/Pacific
>
> For other operating systems... I can only guess.
>
> On Sat, 15 Jul 2000, Steven Zhu wrote:
>
> > Hi All:
> >
> > I compiled and installed new web server (most recent apache and mod
> > perl). Every is fine except that all scripts show wrong time. But it is
> > not only script problem. If i checked with the access.log file, the log
> > time is also wrong. For instance, the current local time is 11:38
> > and my system time is also 11:38. But the script shows the result: 16:38
> > and access.log file shows 16:38. it is always 5 hrs more. It is really
> > timezone problem. I compiled apache many times, never met the situation.
> > Because it was compiled by local machne, the default timezone should be
> > same as my local machine timezone but it is not. How can i reset the
> > timezone from httpd.conf or Do i need to recompile the apache or any
> > another way i can do? Please help me. Thank you very much...
> >
> > Steven.
> >
>
> --
> [EMAIL PROTECTED]   | Put all your eggs in one basket and
> http://BareMetal.com/  |  WATCH THAT BASKET!
> web hosting since '95  | - Mark Twain




Web server log wrong time.

2000-07-15 Thread Steven Zhu

Hi All:

I compiled and installed new web server (most recent apache and mod
perl). Every is fine except that all scripts show wrong time. But it is
not only script problem. If i checked with the access.log file, the log
time is also wrong. For instance, the current local time is 11:38
and my system time is also 11:38. But the script shows the result: 16:38
and access.log file shows 16:38. it is always 5 hrs more. It is really
timezone problem. I compiled apache many times, never met the situation.
Because it was compiled by local machne, the default timezone should be
same as my local machine timezone but it is not. How can i reset the
timezone from httpd.conf or Do i need to recompile the apache or any
another way i can do? Please help me. Thank you very much...

Steven.




Wrong Time

2000-07-14 Thread Steven Zhu

Hi All:

We have a script to output time and date. It used to work fine. Since
upgrdaing modperl (both apache and modperl are most recent version), the
script shows wrong time. If i run the script from command line, it wroks
fine without any problem. I test that from IE and Netscape. Both show
same wrong time. I am sure that the problem comes from web server. How
can i fix this problem. We installed web server many times. I don't
rememeber that any configurations need to deal with time issue. If
anybody knows that, would you please share your fix with me. Thank you
very much.

Steven.




Re: document contained no data

2000-06-22 Thread Steven Zhu

This script should do sql things. After processing sql thing, it shoulld print
some output. Now sql thing is correct because i can see that the data was
in database, but output got this message. So i don't think that DB connection
is timing out. Thanks for your reply

"Erich L. Markert" wrote:

> One other thing... Make sure your DB connections are timing out.
>
> Blue wrote:
> >
> > On Wed, 21 Jun 2000, darren chamberlain wrote:
> >
> > > The problem seems to arise when your handler returns something (a status
> > > code) but hasn't send any data. Turning off buffering ($|) will only help
> > > if you actually send something. Try telnetting to port 80 on the web server
> > > and issue some HTTP commands directly, and see what the response is; that
> > > might give you some insight.
> > >
> > > I am always careful to not call die or return until I have sent the header,
> > > since that can cause the situation you are seeing.
> >
> > ah, good call, darren. the other reason i've seen this happen is plain ol'
> > failure of the script to execute, for whatever reason. tailing the error
> > log or running the script manually is a good way to check for that.
> >
> > when this question first came up, i checked all the FAQS i could find to
> > see if there was somewhere i could point the poster. does anyone know of a
> > comprehensive addressing of perl/mod_perl cgi errors on the net?
> >
> > danke,
> >
> > --
> > Blue Lang  Unix Systems Admin
> > QSP, Inc., 3200 Atlantic Ave, Ste 100, Raleigh, NC, 27604
> > Home: 919 835 1540  Work: 919 875 6994  Fax: 919 872 4015
>
> --
> __
> Mr. Erich L. Markert [EMAIL PROTECTED]
> Computer Learning Center TEL (914)422-4328
> Pace University
> 1 Martine Ave
> White Plains, New York 10606-1932
>
> Those who do not understand Unix are condemned to reinvent it, poorly.
> -- Henry Spencer




Re: document contained no data

2000-06-21 Thread Steven Zhu

I posted the message again because it didn't work when i put
$| = 1; or $r->rflush() at top or around print statement as some
people suggested. It is very confused. it should work without
putting those things. The thing affects performance. What i need
to do, your any answers would be very much appreciated.

Steven

Steven Zhu wrote:

> Hi, All:
>
> We have a coffee site with apache_1.3.9, modperl_1.2.1 and mysql
> database.
> It works fine in most time. But sometimes it is strange. For instance,
> the same
> script works fine sometimes, but sometimes it popups a window with
> message
> "The document contained no data Try again later, or contact the server's
> administrator". It seems that the print statement does not work fine.
> Any idea.
> Thank in advance for your quick reply.
>
> Steven.




document contained no data

2000-06-20 Thread Steven Zhu

Hi, All:

We have a coffee site with apache_1.3.9, modperl_1.2.1 and mysql
database.
It works fine in most time. But sometimes it is strange. For instance,
the same
script works fine sometimes, but sometimes it popups a window with
message
"The document contained no data Try again later, or contact the server's
administrator". It seems that the print statement does not work fine.
Any idea.
Thank in advance for your quick reply.

Steven.




Re: Modperl Test Problem and Redhat6.2 Apache::DBI strange thing. Thanks.

2000-06-14 Thread Steven Zhu

Thank you for your quick answer. Is any way to find the thread about this
issue quickly?
I got most recent modperl and apache. I did all as you said as root. But test
is always problem. I has another machine. The machine has no problem for any
version
modperl and apache at all, always pass test. I guess that we missed something.
But it does not make sense because this professional OS redhat6.2 is
preinstalled on machine, should include all necessary libraries... I have no
idea, compiler does not
complain any thing, even no warnings or errors...

For redhat modperl rpm installation, i did not put PerlModule Apache::DBI
httpd.conf. Why i still can connect database(most time it is fine, but
sometimes
it is not fine.) because i put PerlModule Apache::DBI in httpd.conf. The web
server
does not startup. Any help would be appreciated. Thanks.

Steven.

Drew Taylor wrote:

> Steven Zhu wrote:
> >
> > Hi All:
> >
> > Thank you all for taking time to read this message.
> >
> > I got two things that i really don't understand.
> >
> > 1. I got RedHat6.2. I tried to install modperl. Apache1.3.12 and modperl
> > 1.24.
> > I installed every prerequired package. Configuration is fine and
> > compiling is fine
> > without any errors. But i never got test passed. The error messages:
> >
> > httpd listening on port 8529
> > will write error_log to: t/logs/error_log
> > letting apache warm up...\c
> > done
> > /usr/bin/perl t/TEST 0
> > still waiting for server to warm up...not ok
> > server failed to start! (please examine t/logs/error_log) at t/TEST line
> > 95.
> > make: *** [run_tests] Error 9
> >
> > I check error.log file:
> >
> > [notice] Destruction->DESTROY called for $global_object
> > [Tue Jun 13 18:42:39 2000] [warn] [notice] child_init for process 20497,
> > report
> > any problems to [no address given]
> >
> > There is nothing i can do. I am so frustrated because we has another
> > machine upgrated from
> > redhat5.2 to 6.1. We installed modperl without any problem. We tested
> > everything ok.
> > Please point out. Greate Thanks.
> I remember a recent thread about this in the list. Try searching the
> archives. You might also try running make test as root, rather than a
> normal user. I could be wrong, but the right answer was given by
> Doug(?).
>
> > 2. Since i can't get my new modperl running. I just use modperl coming
> > with redhat6.2.
> > The weired thing is that if i put PerlModule Apache::DBI in httpd.conf,
> > the web server
> > can not startup. If i take that out, the server can connect with
> > database ( because i put
> > use DBI; in perl script file?). But i can't get persistent connections,
> > sometimes it can connect
> > with database (mysql), sometimes it can't connect database with the
> > following errors
> I noticed this problem with Apache::DBI with the redhat mod_perl RPM. It
> would just silently die, with no visible errors.
>
> The first thing to do is pull the latest Apache and mod_perl source
> distributions (1.3.12 & 1.24) and compile it yourself. See the guide for
> instructions - go ahead and use the  "10 minutes to mod_perl"
> instructions.
>
> --
> Drew Taylor
> Vialogix Communications, Inc.
> 501 N. College Street
> Charlotte, NC 28202
> 704 370 0550
> http://www.vialogix.com/




Modperl Test Problem and Redhat6.2 Apache::DBI strange thing. Thanks.

2000-06-13 Thread Steven Zhu

Hi All:

Thank you all for taking time to read this message.

I got two things that i really don't understand.

1. I got RedHat6.2. I tried to install modperl. Apache1.3.12 and modperl
1.24.
I installed every prerequired package. Configuration is fine and
compiling is fine
without any errors. But i never got test passed. The error messages:

httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...\c
done
/usr/bin/perl t/TEST 0
still waiting for server to warm up...not ok
server failed to start! (please examine t/logs/error_log) at t/TEST line
95.
make: *** [run_tests] Error 9

I check error.log file:

[notice] Destruction->DESTROY called for $global_object
[Tue Jun 13 18:42:39 2000] [warn] [notice] child_init for process 20497,
report
any problems to [no address given]

There is nothing i can do. I am so frustrated because we has another
machine upgrated from
redhat5.2 to 6.1. We installed modperl without any problem. We tested
everything ok.
Please point out. Greate Thanks.

2. Since i can't get my new modperl running. I just use modperl coming
with redhat6.2.
The weired thing is that if i put PerlModule Apache::DBI in httpd.conf,
the web server
can not startup. If i take that out, the server can connect with
database ( because i put
use DBI; in perl script file?). But i can't get persistent connections,
sometimes it can connect
with database (mysql), sometimes it can't connect database with the
following errors
DBD::mysql::st execute failed: MySQL server has gone away at
cnznetmod.pm line 1
59.
DBD::mysql::st fetchrow failed: fetch() without execute() at
cnznetmod.pm line 1
60.
DBD::mysql::db do failed: MySQL server has gone away at cnznetmod.pm
line 151.
DBD::mysql::st execute failed: MySQL server has gone away at
cnznetmod.pm line 1
59.
DBD::mysql::st fetchrow failed: fetch() without execute() at
cnznetmod.pm line 1
60.
DBD::mysql::st execute failed: MySQL server has gone away at
cnznetmod.pm line 1
30.
DBD::mysql::st fetchrow failed: fetch() without execute() at
cnznetmod.pm line 1
31.

But it works in most time.  I can't turn on debug because i can't put
PerlModule Apache::DBI in httpd.conf.

Thank you very much...

Steven.