Help with Cookie

2001-06-04 Thread Bird Lei

*Sometimes* my script cannot get the cookie info. I just wondering
if this could be problems *other than* my script (eg ISP's caching, and
so on).

I am using CGI.pm to read cookie. The script that has problem is
output the content of an image, that is, the users have to login to view
the image. And another script, which also requires the same cookie
info, generates the layout.

That is, i have a script called photogallery.cgi that generates the
follow output:

output of photogallery.cgi 
---
html
something here...
the image goes here img
scr=image.cgi?file_id=1234
...
/html
---
Then the script image.cgi will write to the browser the image
content. Sometimes this script (image.cgi) cannot read the
cookie info.

I guess the problem should come from my code or the server
setting.
However, because I have investigated my script for quite a long time and
cannot get a clue of what went wrong. So I want to check if others
ever experienced this problem before.

I am using Perl 5.6.0, mod_perl/1.24 Apache/1.3.14 
IE 5.5.

Bird



How to change an SSIs Last-Modified

2001-06-04 Thread Joachim Zobel


Hi.

I am using SSI a lot for 3 reasons:

1. Easy way to modularize static and generated HTML
2. XBitHack full + touch provides an easy way to have pages play the 
If-Modified-Since game. (If our catalog database is updated, the fame SSIs 
get a touch)
3. Performance

Now I am implementing a way for users to give votes and add comments to our 
product details pages. This makes it necessary to modify the frame SSIs 
Last-Modified header. Unfortunately I can not do this after the or from 
within or after the include because at this time the header is already on 
its way.

So I call update_mtime from within the SSI frames PerlFixupHandler and now 
my SSI frame has a Last-Modified that comes from the database and uses this 
to play the whole If-Modified-Since game including 304.

Cool. Congratulations to the guy that invented the update_mtime interface.

Joachim
--
... ein Geschlecht erfinderischer Zwerge, die fuer alles gemietet werden
koennen.- Bertolt Brecht - Leben des Galilei




Re: Getting the wrong URL

2001-06-04 Thread Chris Strom

[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

 OK, I think I have solved this problem, but I would like to run my solution by
 you folks, and see if it makes any sense. What we found, on a more thorough
 code review, was that a number of the handlers were doing a redirect by calling
 send_cgi_header, and then exit()'ing. It seemed to us that the exit would kill
 the Perl interp, and the Apache child would then just keep serving whatever it
 had in its buffer at the time. Does that make any sense? If so, will die() have
 the same results? I started grepping for exit everywhere, and removed it, but
 along the way I saw a number of places that we're calling die.
 
 I expect that this is just a really stupid newbie problem - I've only been
 doing mod_perl stuff for about 6 months or so. And, in fact, once it occurred
 to me that this might be the problem, of course I found it in the FAQ.

In case you haven't found the guide yet:
http://perl.apache.org/guide/porting.html#Terminating_requests_and_process
http://perl.apache.org/guide/porting.html#die_and_mod_perl

 
 -- 
 Rich Bowen - Author - Apache Server Unleashed
 http://www.apacheunleashed.com/
 




Compile Problem with Apache + mod_ssl + mod_perl

2001-06-04 Thread Ian Chilton

Hello,
 
Please reply to [EMAIL PROTECTED] as I am not on the list!!!

I am having a problem compiling Apache with mod_perl and mod_ssl.

I am using a Sun Sparcstation 5 running Linux.
The userland, bind and postfix all compiled fine.


This is what I get:

--
[root@pingu:~/server/mod_perl-1.25]# cd ../apache_1.3.20
[root@pingu:~/server/apache_1.3.20]# EAPI_MM=SYSTEM ./configure
--prefix=/opt/apache \
 --enable-module=all \
 --enable-shared=max \
 --disable-module=proxy \
 --disable-module=usertrack \
 --disable-module=auth_anon \
 --disable-module=auth_db \
 --disable-module=auth_dbm \
 --activate-module=src/modules/perl/libperl.a
Configuring for Apache, Version 1.3.20
 + using installation path layout: Apache (config.layout)
 + activated perl module (modules/perl/libperl.a)
Creating Makefile
Creating Configuration.apaci in src
Error: Cannot find SSL binaries under /usr/local/ssl
Creating Makefile in src
 + configured for Linux platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + checking for system header files
 + adding selected modules
o rewrite_module uses ConfigStart/End
  disabling DBM support for mod_rewrite
  (perhaps you need to add -ldbm, -lndbm or -lgdbm to EXTRA_LIBS)
o ssl_module uses ConfigStart/End
  + SSL interface: mod_ssl/2.8.4
  + SSL interface build type: DSO
  + SSL interface compatibility: enabled
  + SSL interface experimental code: disabled
  + SSL interface conservative code: disabled
  + SSL interface vendor extensions: disabled
  + SSL interface plugin: Built-in SDBM
  + SSL library path: /usr/local/ssl

[root@pingu:~/server/apache_1.3.20]# make
=== src
make[1]: Entering directory `/root/server/apache_1.3.20'
make[2]: Entering directory `/root/server/apache_1.3.20/src'
make[2]: *** No rule to make target `all'.  Stop.
make[2]: Leaving directory `/root/server/apache_1.3.20/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/root/server/apache_1.3.20'
make: *** [build] Error 2
[root@pingu:~/server/apache_1.3.20]#
--

This is how I was compiling it.
I used the same Apache+Perl+SSL method on some x86 boxes and it seemed
to work fine.

-
tar yxf sources/apache_1.3.20.tar.bz2
tar yxf sources/mod_ssl-2.8.4-1.3.20.tar.bz2
tar yxf sources/mod_perl-1.25.tar.bz2

cd mod_ssl-2.8.4-1.3.20/
./configure --with-apache=../apache_1.3.20/ --with-mm

cd ../mod_perl-1.25/
perl Makefile.PL \
APACHE_SRC=../apache_1.3.20/src \
USE_APACI=1 \
PERL_MARK_WHERE=1 \
EVERYTHING=1 \
PREP_HTTPD=1 \
DO_HTTPD=1
make
make install

cd ../apache_1.3.20/

sed 's/#define PLATFORM Unix/#define PLATFORM LinuxFromScratch/'
src/os/unix/os.h src/os/unix/os.h~
mv src/os/unix/os.h~ src/os/unix/os.h

EAPI_MM=SYSTEM ./configure --prefix=/usr/apache \
--enable-module=all \
--enable-shared=max \
--disable-module=proxy \
--disable-module=usertrack \
--disable-module=auth_anon \
--disable-module=auth_db \
--disable-module=auth_dbm \
--activate-module=src/modules/perl/libperl.a

make
make certificate TYPE=dummy
make install
-

Any ideas?


Thanks!


Bye for Now,

Ian


  \|||/ 
  (o o)
 /-ooO-(_)-Ooo\
 |  Ian ChiltonE-Mail: [EMAIL PROTECTED] |
 |  IRC Nick: GadgetManBackup: [EMAIL PROTECTED]  |
 |  ICQ: 16007717 / 104665842  Web   : http://www.ichilton.co.uk  |
 ||
 |   For people who like peace and quiet: a phoneless cord|
 \/




Re: Compile Problem with Apache + mod_ssl + mod_perl

2001-06-04 Thread Ged Haywood

Hi there,

On Thu, 31 May 2001, Ian Chilton wrote:

 Please reply to [EMAIL PROTECTED] as I am not on the list!!!

(Why not?! :)

 This is what I get:
[snip]
 Creating Makefile
 Creating Configuration.apaci in src
 Error: Cannot find SSL binaries under /usr/local/ssl

Is that a clue?

73,
GEd.




[Take23] Jobs Page online

2001-06-04 Thread Matt Sergeant

Take23 now has a jobs page, thanks to Ask's efforts on jobs.perl.org, we
mirror their RSS feed.

  http://take23.org/jobs/

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




HTTP 1.1

2001-06-04 Thread Ruslan V. Sulakov

Strange numbers appeares, when I use HTTP 1.1 protocol to get response from my 
mod_perl server.
The test.pl script:
use strict;
use Apache::Request();
my $r = shift;
my $apr = Apache::Request-new($r);
$apr-send_http_header('text/html');
print 1234567;

Now look to  HTTP 1.1. response of this script:
# telnet xx.xx.ru 81
Trying xxx.xxx.xxx.xxx...
Connected to xx.xx.ru.
Escape character is '^]'.
GET /test.pl HTTP/1.1
Accept: */*
Host: xx.xx.ru

HTTP/1.1 200 OK
Date: Mon, 04 Jun 2001 14:49:24 GMT
Server: Apache/1.3.12 (Unix) mod_perl/1.24
Transfer-Encoding: chunked
Content-Type: text/html

1
1234567
0



What does mean number 1 before line 1234567? And what does mean 0 after all?
Is there a way to cut off the line with number 1 and cut off the line with number 
0?
I need only line 1234567 in response! It is vital for me!


Now look what will be, if I ask HTTP version 1.0:
bsd2# telnet xx.xx.ru 80
Trying 212.188.13.65...
Connected to xx.xx.ru.
Escape character is '^]'.
GET /test.pl HTTP/1.0
Accept: */*
Host: xx.xx.ru

HTTP/1.1 200 OK
Date: Mon, 04 Jun 2001 15:39:16 GMT
Server: Apache/1.3.9 (Unix) mod_perl/1.21 rus/PL28.18
Connection: close
Content-Type: text/html; charset=koi8-r

1234567


Thats all right with HTTP/1.0! No additional lines in output and no Header 
Transfer-Encoding: chunked in response.

But I need , it to be all right in case of HTTP/1.1 !

Is there any ideas?

Thanks!
Ruslan




Re: HTTP 1.1

2001-06-04 Thread will trillich

On Mon, Jun 04, 2001 at 07:53:59PM +0400, Ruslan V. Sulakov wrote:
 Strange numbers appeares, when I use HTTP 1.1 protocol to get response from my 
mod_perl server.
 The test.pl script:
 use strict;
 use Apache::Request();
 my $r = shift;
 my $apr = Apache::Request-new($r);
 $apr-send_http_header('text/html');
 print 1234567;
 
 Now look to  HTTP 1.1. response of this script:
 # telnet xx.xx.ru 81
 Trying xxx.xxx.xxx.xxx...
 Connected to xx.xx.ru.
 Escape character is '^]'.
 GET /test.pl HTTP/1.1
 Accept: */*
 Host: xx.xx.ru
 
 HTTP/1.1 200 OK
 Date: Mon, 04 Jun 2001 14:49:24 GMT
 Server: Apache/1.3.12 (Unix) mod_perl/1.24
 Transfer-Encoding: chunked
 Content-Type: text/html
 
 1
 1234567
 0

 What does mean number 1 before line 1234567? And what does mean 0 after all?
 Is there a way to cut off the line with number 1 and cut off the line with number 
0?
 I need only line 1234567 in response! It is vital for me!
 
 
 Now look what will be, if I ask HTTP version 1.0:
 bsd2# telnet xx.xx.ru 80
 Trying 212.188.13.65...
 Connected to xx.xx.ru.
 Escape character is '^]'.
 GET /test.pl HTTP/1.0
 Accept: */*
 Host: xx.xx.ru
 
 HTTP/1.1 200 OK
 Date: Mon, 04 Jun 2001 15:39:16 GMT
 Server: Apache/1.3.9 (Unix) mod_perl/1.21 rus/PL28.18
 Connection: close
 Content-Type: text/html; charset=koi8-r
 
 1234567
 
 
 Thats all right with HTTP/1.0! No additional lines in output and no Header 
Transfer-Encoding: chunked in response.
 
 But I need , it to be all right in case of HTTP/1.1 !
 
 Is there any ideas?

guess

here's the key the the answer you're looking for:

Transfer-Encoding: chunked

for wise browsing software, these numbers are used in
re-constructing the original html from the chunks as they
arrive.

if you're just sending your stuff to an average joe running a
standard web browser, they should all understand this stuff out
of the box. if you're doing something fancy (proxy filter,
maybe?) perhaps you need to check the specs for the HTTP/1.1
protocols and accomodate them. :)

guess

-- 
#95: We are waking up and linking to each other. We are watching. But
we are not waiting.  -- www.cluetrain.com

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!



Re: HTTP 1.1

2001-06-04 Thread Andrew Ho

Hello,

RSStrange numbers appeares, when I use HTTP 1.1 protocol to get response
RSfrom my mod_perl server...
RS
RSWhat does mean number 1 before line 1234567? And what does mean 0
RSafter all? Is there a way to cut off the line with number 1 and cut
RSoff the line with number 0? I need only line 1234567 in response! It
RSis vital for me!

The numbers are chunk sizes, which is part of chunked Transfer-Encoding,
part of the HTTP/1.1 specification. You should read this:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1

For dynamically generated content, there is no Content-Length (unless your
script sets one with $r-header_out('Content-Length' = $length) or you
use the associated method in Apache::File). In HTTP/1.0, the server closes
the connection after the script exists, so the missing Content-Length does
not present a problem.

With HTTP/1.1 Keep-Alive, the browser needs to know when to stop reading
the response. The chunked Transfer-Encoding sends chunk sizes, then
chunks, like lots of mini Content-Length fields.

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
--




Re: Help with Cookie

2001-06-04 Thread Issac Goldstand



Sometimes, that's a result of setting the path of 
the cookie incorrectly... see CGI::Cookie or Apache::Cookie for details on 
how to set them...

 Issac

- Original Message - 

  From: 
  Bird Lei 
  
  To: [EMAIL PROTECTED] 
  Sent: Monday, June 04, 2001 09:54
  Subject: Help with Cookie
  *Sometimes* my script cannot get the cookie info. I just 
  wondering if this could be problems *other than* my script (eg ISP's caching, 
  and so on).I am using CGI.pm to read cookie. The script that has 
  problem is output the content of an image, that is, the users have to login to 
  view the image. And another script, which also requires the same cookie 
  info, generates the layout.That is, i have a script called 
  photogallery.cgi that generates the follow output:output of 
  photogallery.cgi ---htmlsomething here...the image 
  goes here img 
  scr="image.cgi?file_id=1234".../html---Then the 
  script image.cgi will write to the browser the image content. 
  Sometimes this script (image.cgi) cannot read the cookie info.I 
  guess the problem should come from my code or the server setting.However, 
  because I have investigated my script for quite a long time and cannot get a 
  clue of what went wrong. So I want to check if others ever experienced 
  this problem before.I am using Perl 5.6.0, mod_perl/1.24 Apache/1.3.14 
  IE 5.5.Bird 


Re: Help with Cookie

2001-06-04 Thread Bird Lei

However, I have set the path to /
Wondering if it causes any problem if I am using CGI.pm to read the
cookie when CGI::Cookie and Apache::Cookie both provide a way of fetching
the cookie.

my $q = new CGI;
my %cookie_info = $q-cookie('cookie_name');

Bird

At 09:38 PM 2001/6/4 +0200, Issac Goldstand wrote:
Sometimes,
that's a result of setting the path of the cookie incorrectly...
see CGI::Cookie or Apache::Cookie for details on how to set
them...

 Issac

- Original Message - 

From: Bird Lei 
To: [EMAIL PROTECTED] 
Sent: Monday, June 04, 2001 09:54
Subject: Help with Cookie


*Sometimes* my script cannot get the cookie info. I just
wondering if this could be problems *other than* my script (eg ISP's
caching, and so on).


I am using CGI.pm to read cookie. The script that has problem
is output the content of an image, that is, the users have to login to
view the image. And another script, which also requires the same
cookie info, generates the layout.


That is, i have a script called photogallery.cgi that generates the
follow output:


output of photogallery.cgi 
---
html
something here...
the image goes here img
scr=image.cgi?file_id=1234
...
/html
---
Then the script image.cgi will write to the browser the image
content. Sometimes this script (image.cgi) cannot read the cookie
info.


I guess the problem should come from my code or the server setting.
However, because I have investigated my script for quite a long time
and cannot get a clue of what went wrong. So I want to check if
others ever experienced this problem before.


I am using Perl 5.6.0, mod_perl/1.24 Apache/1.3.14 
IE 5.5.


Bird