Re: mod_proxy and mod_perl in guide
These are protected files so we have to use authentication and authorization that is done by mod_perl. And Internet Explorer that use most of our customers has bug that prevents displaying of PDF (and any other large non-dynamic non-HTML) files if the URL to that file was result of "Redirect". Thanks for help. Andrei On Mon, Sep 17, 2001 at 08:55:03AM -0700, ed phillips wrote: > Thanks Vivek, > > Andrei, use the front end to directly handle any binaries, static files, > etc. > > I doubt they are generating of these on the fly. > > > > Vivek Khera wrote: > > > > > "AAV" == Andrei A Voropaev <[EMAIL PROTECTED]> writes: > > > > AAV> In our system we have to pass large PDF files thru mod_perl to > > AAV> proxy and we noticed that it takes the same time as sending it > > AAV> directly to customer. > > > > Why do you have to pass the PDF thru mod_perl? Are you generating it > > on the fly? If not, configure your proxy front end to intercept > > static documents like .pdf .txt .html etc. to be handled by the front > > end directly. I use mod_rewrite for this, and my configs have been > > posted to this list at least twice. > > > > -- > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > Vivek Khera, Ph.D.Khera Communications, Inc. > > Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 > > AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: Updating $r->connection->aborted before $r->print() ?
Geoffrey Young wrote: > > my $fileno = $r->connection->fileno; > > $s = IO::Select->new($fileno); > > die "aborted" if grep { m/$fileno/ } $s->can_read(1); > > HTH > Thanks for this. The code that I ended up using for Apache::ASP was: # IsClientConnected ? Might already be disconnected for busy site, if # a user hits stop/reload my $is_connected = 1; my $fileno = $r->connection->fileno; if(defined $fileno) { my $s = IO::Select->new($fileno); if($s->can_read(0)) { $is_connected = 0; } } The difference being the can_read(0) from can_read(1). The 1 would create an unnecessary wait of 1 second I found, whereas 0 does not, yet reports the aborted condition accurately. Thanks again! -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::Hello
Ray and Lara Recendez wrote: > I am trying to get Apache::Hello to work. <...> > #!/usr/local/bin/perl Turn PerlWarn On as described here: http://perl.apache.org/src/mod_perl.html#SWITCHES Also try running Apache in single-user mode: /usr/local/apache/bin/apachectl -X This helps you pick up problems in simple scripts.
Re: Pre-announce Apache::ConfigParser
- Original Message - From: "Blair Zajac" <[EMAIL PROTECTED]> To: "Geoffrey Young" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, September 13, 2001 1:52 AM Subject: Re: Pre-announce Apache::ConfigParser > Apache::Admin::Config > Pros > > Cons > Lack of documentation > Test suite with 2 tests Purpose of this module was to parse, modify and write an apache (or apache like) configuration file without modifying the indentation and comments. It's very basic and not handle anything more than read, parse, write. More complexical module can be implemented on the top of it. The documentation is now writen, check at the 0.06 version : ftp://ftp.rhapsodyk.net/pub/devel/perl/Apache-Admin-Config-0.06.readme regards -- ___ O l i v i e rP o i t r e y USA disaster support http://www.osdn.com/911.shtml
Re: Apache::Hello
On Mon, 17 Sep 2001 13:15:44 -0700 Ray and Lara Recendez <[EMAIL PROTECTED]> wrote: > # vi Hello.pm > "Hello.pm" 26 lines, 392 characters > package Apache::Hello; > # File: Apache/Hello.pm > > use strict; > use Apache::Constants qw(:common); > > sub handler { >my $r = shift; >$r->content-type('text/html'); s/content-type/content_type/ Maybe you've got the error msg like "Undefined subroutine &Apache::Hello::type called at ..." -- Tatsuhiko Miyagawa <[EMAIL PROTECTED]>
Apache::Hello
PLEASE HELP. I am trying to get Apache::Hello to work. I saved it as Hello.pm in lib/perl/Apache. Below are my setup files and pertinent info. When I access the virtual location (hello/world) from Apache's root directory, my browser returns the following message: "The document contains no data." I can successfully run Apache's built-in server-status module. I don't receive any errors when starting Apache and don' t see any errors in the logs. Any suggestions? Apache Version 1.3.9 mod_perl Version 1.26 Perl Version 5.6.1 # vi startup.pl "startup.pl" 19 lines, 372 characters #!/usr/local/bin/perl # modify the include path before we do anything else BEGIN { use Apache (); use lib Apache->server_root_relative('lib/perl'); } # commonly used modules use Apache::Registry (); use Apache::Constants (); use CGI qw(-compile :all); use CGI::Carp (); # put any other common modules here # use Apache::DBI (); # use LWP (); # use DB_File (); 1; # vi perl.conf "perl.conf" 10 lines, 318 characters #Tells Apache to load and run the startup script when it is first launched. PerlRequire conf/startup.pl PerlFreshRestartOn ###I also tried this in httpd.conf because it was not working and server-status is in httpd.conf SetHandler perl-script PerlHandler Apache::Hello # vi Hello.pm "Hello.pm" 26 lines, 392 characters package Apache::Hello; # File: Apache/Hello.pm use strict; use Apache::Constants qw(:common); sub handler { my $r = shift; $r->content-type('text/html'); $r->send_http_header; my $host = $r->get_remote_host; $r->print(< Hello There Hello $host Who would take this book seriously if the first example didn't say "hello world"? END return OK; } 1; Thanks, Ray
Trouble getting apache run on Sun Sparc 5.7
We are getting the follwoing error when we try to run apache.We've tried modifying the maxRequestPerChild parameter to 10 from 0, but that didn't help.We can see only the root process running immediately after starting the apache server.But if left like that for 2 days we could see the child processes start slowly and then the site comes up.Why don't the child processes start immediately? We are not able to understand how to solve the problem - Please help. [Mon Sep 17 14:15:36 2001] [notice] child pid 20936 exit signal Segmentation Fault (11) [Mon Sep 17 14:15:36 2001] [notice] child pid 20935 exit signal Segmentation Fault (11) [Mon Sep 17 14:15:36 2001] [notice] child pid 20934 exit signal Segmentation Fault (11) [Mon Sep 17 14:15:36 2001] [notice] child pid 20931 exit signal Segmentation Fault (11) [Mon Sep 17 14:15:36 2001] [notice] child pid 20965 exit signal Segmentation Fault (11) [Mon Sep 17 14:15:36 2001] [notice] child pid 20932 exit signal Segmentation Fault (11) [Mon Sep 17 14:15:36 2001] [notice] child pid 20929 exit signal Segmentation Fault (11) [Mon Sep 17 14:15:36 2001] [notice] child pid 20930 exit signal Segmentation Fault (11) Thanks, Santhi
Re: problems with BerkeleyDB and apache
On Mon, 17 Sep 2001, Gustav Kristoffer Ek wrote: > trying to use BerkeleyDB with Apache/1.3.21-dev, but I keep getting > "BerkeleyDB needs compatible versions of libdb & db.h ... you have db.h > version 3.1.17 and libdb version 2.4.14" try, export LD_PRELOAD=/usr/local/lib/libdb3.so before you start apache. (substitute with the correct path to the correct libdb3.so). - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do(); more than a billion impressions per week, http://valueclick.com
problems with BerkeleyDB and apache
trying to use BerkeleyDB with Apache/1.3.21-dev, but I keep getting "BerkeleyDB needs compatible versions of libdb & db.h ... you have db.h version 3.1.17 and libdb version 2.4.14" I have compiled BerkeleyDB to use db3, but apache is compiled to use db2, could it be the reason? It works just fine when I use BerkeleyDB without apache, but when I load the module from an apache proces I got the error. can I compile apache with db3 in any way? - gustav -- 1st graffitiist: QUESTION AUTHORITY! 2nd graffitiist: Why? Gustav Kristoffer Ek http://ek.dk/ +45 20 40 00 05
Re: apache/mod_perl socket bug on Win32
Avi Ben-Harush wrote: > > it seems that apache/mod_perl have a problem with sockets on win32. after the socket >has been opened successfully (I double check to > see if the socket handler is defined with "fileno($socket)") the print to the socket >is failing due to an "invalid argument" error > . it seems that this bug exists for some time >http://archive.davin.ottawa.on.ca/modperl/1999-02/msg00129.phtml. > someone suggested that to avoid the problem the apache should use only one thread, >unfortunately I can't use a one thread system. > do you of any other solutions to this problem ? > > I'm using apache 1.3.20 for win32, mod_perl 1.25_01-dev. > I would try a one threaded mod_perl system as a mod_perl backend that you ProxyPass to from a front end server. This might work out though I don't know how Win32 installation would work for this. See this link for the dual httpd setup: http://perl.apache.org/guide/scenario.html#mod_proxy I have only used mod_perl on a WinNT for development, so have not had to work through this problem before, but this is the approach I would take if I were to. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: for files that don't exist
dss <[EMAIL PROTECTED]> said something to this effect on 09/17/2001: > The issue is that I'm using "virtual" urls, so these .phtml > files don't actually exist and on the server. I'm curious if my approach is the best way. Shouldn't be what you want? (darren) -- If it turns out that there is a God, I don't think that he's evil. But the worst that you can say about him is that basically he's an underachiever. -- Woody Allen
RE: Knowing if a apache server is compiled with mod_perl
You could also do something like: grep 'Apache' /path/to/error_log --Joe Breeden -- Sent from my Outlook 2000 Wired Deskheld (www.microsoft.com) > -Original Message- > From: Mark Schmick [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 17, 2001 2:05 PM > To: Adam Worrall; Mat > Cc: [EMAIL PROTECTED] > Subject: Re: Knowing if a apache server is compiled with mod_perl > > > Adam's technique below doesn't work for me, but this does > (assuming you > have LWP installed): > > sh> HEAD -de http://|grep Server: > > -Mark > > At 05:20 PM 9/17/2001 +0100, Adam Worrall wrote: > > > "Mat" == Mat <[EMAIL PROTECTED]> writes: > > > > Mat> Hi everyone, I'd like to know if there is a simple > way to find > > Mat> if an apache server is compiled with mod_perl and > with which > > Mat> version. > > > >This does it for me: > > > > $ strings /some/httpd | grep 'mod_perl\/' > > > >The 'strings' command works under Linux and Solaris, I think > it's fairly > >standard ... and handy :) > > > > - Adam > >
Re: Knowing if a apache server is compiled with mod_perl
Adam's technique below doesn't work for me, but this does (assuming you have LWP installed): sh> HEAD -de http://|grep Server: -Mark At 05:20 PM 9/17/2001 +0100, Adam Worrall wrote: > > "Mat" == Mat <[EMAIL PROTECTED]> writes: > > Mat> Hi everyone, I'd like to know if there is a simple way to find > Mat> if an apache server is compiled with mod_perl and with which > Mat> version. > >This does it for me: > > $ strings /some/httpd | grep 'mod_perl\/' > >The 'strings' command works under Linux and Solaris, I think it's fairly >standard ... and handy :) > > - Adam
Knowing if a apache server is compiled with mod_perl
> "Mat" == Mat <[EMAIL PROTECTED]> writes: Mat> Hi everyone, I'd like to know if there is a simple way to find Mat> if an apache server is compiled with mod_perl and with which Mat> version. This does it for me: $ strings /some/httpd | grep 'mod_perl\/' The 'strings' command works under Linux and Solaris, I think it's fairly standard ... and handy :) - Adam
Re: mod_proxy and mod_perl in guide
Thanks Vivek, Andrei, use the front end to directly handle any binaries, static files, etc. I doubt they are generating of these on the fly. Vivek Khera wrote: > > > "AAV" == Andrei A Voropaev <[EMAIL PROTECTED]> writes: > > AAV> In our system we have to pass large PDF files thru mod_perl to > AAV> proxy and we noticed that it takes the same time as sending it > AAV> directly to customer. > > Why do you have to pass the PDF thru mod_perl? Are you generating it > on the fly? If not, configure your proxy front end to intercept > static documents like .pdf .txt .html etc. to be handled by the front > end directly. I use mod_rewrite for this, and my configs have been > posted to this list at least twice. > > -- > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > Vivek Khera, Ph.D.Khera Communications, Inc. > Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 > AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: Can't build (was Re: Apache.pm fails to load...)
--- Stas Bekman <[EMAIL PROTECTED]> wrote: > U n d e r a c h i e v e r wrote: > >>>what do you see when you do: > >>> > >>>ls -l /usr/local/ssl/lib/libssl.so.0 > >>> > > > > -rw-r--r-- 1 bin bin 844468 Oct 29 2000 > > /usr/local/ssl/lib/libssl.so.0 > > > > so mine's not a symlink nor an executable... > > > that's a weird thing, did you install openssl from src or got it in > the > binary form? > have you tried to set the +x bit? i may have had a binary installation of openssl on the system some time ago, but the source of the latest version has been compiled and installed since before trying to get mod_perl going. i'm going to leave this aside for the time being, return to getting the other components built and then try again as a DSO as others have suggested... thanks to everyone for prompt and helpful responses. i'll be posting again shortly if i can't get it going ... = u n d e r a c h i e v e r (and proud) <[EMAIL PROTECTED]> __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: mod_proxy and mod_perl in guide
> "AAV" == Andrei A Voropaev <[EMAIL PROTECTED]> writes: AAV> In our system we have to pass large PDF files thru mod_perl to AAV> proxy and we noticed that it takes the same time as sending it AAV> directly to customer. Why do you have to pass the PDF thru mod_perl? Are you generating it on the fly? If not, configure your proxy front end to intercept static documents like .pdf .txt .html etc. to be handled by the front end directly. I use mod_rewrite for this, and my configs have been posted to this list at least twice. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: for files that don't exist
--- Perrin Harkins <[EMAIL PROTECTED]> wrote: > It's easier to use a directory structure, i.e. > everything under /perl/ is > handled by your controller module. You should also > look at > Apache::Dispatch. Thanks. Unfortunately I'm trying to please the designers and forcing them to put everything under a certain directory won't go :(. They're used to coldfusion/php, and I have to keep the structure of existing sites. They did go for another extension for the TT stuff though. I will check out Apache::Dispatch...thanks. __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: for files that don't exist
> I'd like to have a "controller" module, where any url > that has a ".phtml" page will call the handler in the > controller module. Within the controller module I use > logic to determine which module (if any) should > process the request using push_handlers. > > The issue is that I'm using "virtual" urls, so these > .phtml files don't actually exist and > wants a physical file on the server. I'm curious if my > approach is the best way. It's easier to use a directory structure, i.e. everything under /perl/ is handled by your controller module. You should also look at Apache::Dispatch. - Perrin
Re: for files that don't exist
Ooops, that should be: Apache::Controller (simplified for clarity) --- package Apache::Controller; use strict; use Apache::Constants qw( :common ); sub handler { my $r = shift; my $cv; if( $r->uri =~ m{\.phtml$} ) { $cv = 'Apache::PHTML'; } else { return DECLINED; } $r->push_handlers(PerlHandler => $cv); OK; } 1; __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: Knowing if a apache server is compiled with mod_perl
You want to parse through the info returned from... httpd -l For example, here's my httpd -l... trex% httpd -l Compiled-in modules: http_core.c mod_env.c mod_log_config.c mod_mime.c mod_negotiation.c mod_status.c mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_asis.c mod_imap.c mod_actions.c mod_userdir.c mod_alias.c mod_access.c mod_auth.c mod_setenvif.c Hope this helps! Ron Mat wrote: > > Hi everyone, >I'd like to know if there is a simple way to find if an apache server > is compiled with mod_perl and with which version. My aim is to write a > script which compile mod_perl if it is not installed. >For the moment I've found only two ways, launch the actual server and > telnet it to parse the server signature. But it has the disadvantages of > having the Apache server running and the server signature on. >The other way would be to get the return of httpd -v, but I won't > have the version and I think this won't work if the module is compiled > in dso. > >So is it possible from the Apache binary to check mod_perl ? > > Cheers, >Mat
for files that don't exist
I'd like to have a "controller" module, where any url that has a ".phtml" page will call the handler in the controller module. Within the controller module I use logic to determine which module (if any) should process the request using push_handlers. The issue is that I'm using "virtual" urls, so these .phtml files don't actually exist and wants a physical file on the server. I'm curious if my approach is the best way. httpd.conf -- PerlModule Apache::Controller SetHandler perl-script PerlHandler Apache::Controller Apache::Controller (simplified for clarity) --- package Apache::Controller; use strict; use Apache::Constants qw( :common ); sub handler { my $r = shift; my $cv; if( $r->uri =~ m{\.phtml$} ) { $cv = 'Apache::PHTML'; } else { return DECLINED; } OK; } 1; Now every request to apache will have to go through this handler...is this the best way to do this? Thanks. __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: Can't build mod_ssl + mod_perl
Peter Lister wrote: > apache_1.3.20 mod_perl-1.26 mod_ssl-2.8.4-1.3.20 > > I can't build Apache with these together if the mod_ssl build works, > mod_perl is not built in. If I build mod_perl in the approved manner, > the mod_ssl build files. > > I have followed the recipe in INSTALL.SSL - and it doesn't help. Has > anyone got a recipe for doing this? I didn't try recently, but try the steps from (don't remember whether they are different from INSTALL.SSL) http://perl.apache.org/guide/install.html#mod_perl_and_mod_ssl_openssl_ In any case you should post the errors. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Can't build (was Re: Apache.pm fails to load...)
U n d e r a c h i e v e r wrote: a search for libssl reveals: find / -name libssl.so.0 /usr/local/ssl/lib/libssl.so.0 > >>>what do you see when you do: >>> >>>ls -l /usr/local/ssl/lib/libssl.so.0 >>> > > -rw-r--r-- 1 bin bin 844468 Oct 29 2000 > /usr/local/ssl/lib/libssl.so.0 > > so mine's not a symlink nor an executable... that's a weird thing, did you install openssl from src or got it in the binary form? have you tried to set the +x bit? >>or your /etc/ld.so.conf doesn't have /usr/local/ssl/lib. >> > > indeed, i do not /have/ an ld.so.conf ... the closest match seems to be > an ld.so.1 in /etc/lib, but that's a binary :) > i also don't have an ldconfig executable no, no. it shouldn't be there. That's why you tell the configure code where to find the library. It uses this path during the linking stage and for finding header files. > ssh has been compiled and happily running against this version of > openssl for a couple of weeks. I've re-made and re-installed openssl > (windows habits die hard) before posting this message, but the whole > build still fails in exactly the same way as previously reported. > > when i build apache directly (that is to say running configure and make > in the ./apache_ directory, as opposed to in mod_perl) it does not > stall on a missing ssl library, and happily compiles with mod_ssl. weirdo, it fails to open the file, so how about trying to use strace(1) or similar and see what it actually tries to open? log the output into a file and then look there. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Can't build mod_ssl + mod_perl
Peter Lister wrote: > apache_1.3.20 mod_perl-1.26 mod_ssl-2.8.4-1.3.20 > > I can't build Apache with these together if the mod_ssl build works, > mod_perl is not built in. If I build mod_perl in the approved manner, > the mod_ssl build files. > > I have followed the recipe in INSTALL.SSL - and it doesn't help. Has > anyone got a recipe for doing this? Here is a script that I use for making apache+modperl+ssl as a dso: (Make sure to change any path references to your needs) --BEGIN-- #!/bin/sh # SRC_DIR=$* ## if [ "$SRC_DIR" = "." ]; then SRC_DIR=$PWD fi PATH=/usr/bin:/usr/sbin:/opt/sfw/bin:/usr/ccs/bin PREFIX=/opt/apache MODPERL_DIR=$SRC_DIR/modperl APACHE_DIR=$SRC_DIR/apache MODSSL_DIR=$SRC_DIR/modssl SSL_BASE=/opt/sfw EAPI_MM=$SRC_DIR/mm export SSL_BASE RSA_BASE EAPI_MM PATH # This can be GNU or Apache LAYOUT=Apache MAKE=`which gmake` ## ## important hint for the first-time users ## if [ $# -eq 0 ]; then echo " + Warning: Configuring Apache without a src dir." echo " + This is probably not what you really want." echo " + Please supply as argument the directory where the src are found." echo exit 0 else if [ $# -gt 1 ]; then echo " + Warning: Configuring Apache with multiple src dirs.." echo " + This is probably not what you really want." echo " + Please supply as argument the directory where the src are found." echo exit 0 fi fi ### IMPORTANT ### # # If you already have a certificate, then fill in their locations: # CERT=/path/to/your/server.crt #CERT=/opt/raven/module/pki/certs/signedCert.cert #KEY=/opt/raven/module/pki/keys/internal.ec-group.com.key NOTHING MORE TO CONFIGURE ## # FOR FIRST CLEAN SOURCES DO: echo "Going to $EAPI_MM" cd $EAPI_MM CFLAGS=$CFLAGS \ ./configure --disable-shared if [ $? -ne 0 ]; then echo "Configure MM failure!!!" exit 1 fi $MAKE if [ $? -ne 0 ]; then echo "Unable to make MM!!" exit 1 fi # FOR FIRST CLEAN SOURCES DO: echo "Going to $APACHE_DIR" cd $APACHE_DIR CFLAGS=$CFLAGS \ ./configure --prefix=$PREFIX \ --with-layout=$LAYOUT if [ $? -ne 0 ]; then echo "Configure Apache failure!!!" exit 1 fi # FOR MOD_SSL FIRST DO: echo "Going to $MODSSL_DIR" cd $MODSSL_DIR if [ "$CERT" = "/path/to/your/server.crt" ]; then echo "Configuring without certificates" CFLAGS=$CFLAGS \ ./configure --prefix=$PREFIX \ --with-apache=$APACHE_DIR else echo "Configuring with certificates" CFLAGS=$CFLAGS \ ./configure --prefix=$PREFIX \ --with-apache=$APACHE_DIR \ --with-crt=$CERT \ --with-key=$KEY fi if [ $? -ne 0 ]; then echo "Failure to configure mod_ssl!!!" exit 1 fi # FOR MOD_PERL FIRST DO: echo "Going to $MODPERL_DIR" cd $MODPERL_DIR perl Makefile.PL \ APACHE_SRC=$APACHE_DIR/src \ DO_HTTPD=1 \ USE_APACI=1 \ PREP_HTTPD=1 \ USE_DSO=1 \ EVERYTHING=1 if [ $? -ne 0 ]; then echo "Configure Mod Perl failure!!!" exit 1 fi echo "Making modperl" $MAKE && $MAKE install echo "Going back to $APACHE_DIR" cd $APACHE_DIR CFLAGS=$CFLAGS \ ./configure --prefix=$PREFIX \ --with-layout=$LAYOUT \ --activate-module=src/modules/perl/libperl.a \ --enable-shared=ssl \ --enable-shared=perl \ --enable-module=most \ --enable-module=auth_dbm if [ $? -ne 0 ]; then echo "Unable to configure Apache/ModPerl/SSL!!" exit 1 fi echo "Making the final Apache/ModPerl/SSL" $MAKE if [ $? -ne 0 ]; then echo "Unable to make Apache/ModPerl/SSL!!" exit 1 fi ## Ok, if there are no certificates, then make a certificate if [ "$CERT" = "/path/to/your/server.crt" ]; then echo "Making test certificate" make certificate TYPE=test fi INSTALL FINALLY!!! $MAKE install --END-- -- Brian Millett Enterprise Consulting Group "Shifts in paradigms (314) 205-9030 often cause nose bleeds." [EMAIL PROTECTED] Greg Glenn
RE: Can't build (was Re: Apache.pm fails to load...)
Maybe you could build mod_perl as a DSO with APXS. That way you could build it after the apache/mod_ssl is built and working. --Joe Breeden -- Sent from my Outlook 2000 Wired Deskheld (www.microsoft.com) > -Original Message- > From: U n d e r a c h i e v e r [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 17, 2001 8:36 AM > To: Philippe M . Chiasson; Stas Bekman; [EMAIL PROTECTED] > Subject: Re: Can't build (was Re: Apache.pm fails to load...) > > > > > > a search for libssl reveals: > > > > > > > > find / -name libssl.so.0 > > > > /usr/local/ssl/lib/libssl.so.0 > > > > what do you see when you do: > > > > > > ls -l /usr/local/ssl/lib/libssl.so.0 > > -rw-r--r-- 1 bin bin 844468 Oct 29 2000 > /usr/local/ssl/lib/libssl.so.0 > > so mine's not a symlink nor an executable... > > > or your /etc/ld.so.conf doesn't have /usr/local/ssl/lib. > > indeed, i do not /have/ an ld.so.conf ... the closest match > seems to be > an ld.so.1 in /etc/lib, but that's a binary :) > i also don't have an ldconfig executable > > ssh has been compiled and happily running against this version of > openssl for a couple of weeks. I've re-made and re-installed openssl > (windows habits die hard) before posting this message, but the whole > build still fails in exactly the same way as previously reported. > > when i build apache directly (that is to say running > configure and make > in the ./apache_ directory, as opposed to in mod_perl) it does not > stall on a missing ssl library, and happily compiles with mod_ssl. > > > > = > u n d e r a c h i e v e r (and proud) > <[EMAIL PROTECTED]> > > __ > Terrorist Attacks on U.S. - How can you help? > Donate cash, emergency relief information > http://dailynews.yahoo.com/fc/US/Emergency_Information/ >
Re: Can't build (was Re: Apache.pm fails to load...)
> > > a search for libssl reveals: > > > > > > find / -name libssl.so.0 > > > /usr/local/ssl/lib/libssl.so.0 > > what do you see when you do: > > > > ls -l /usr/local/ssl/lib/libssl.so.0 -rw-r--r-- 1 bin bin 844468 Oct 29 2000 /usr/local/ssl/lib/libssl.so.0 so mine's not a symlink nor an executable... > or your /etc/ld.so.conf doesn't have /usr/local/ssl/lib. indeed, i do not /have/ an ld.so.conf ... the closest match seems to be an ld.so.1 in /etc/lib, but that's a binary :) i also don't have an ldconfig executable ssh has been compiled and happily running against this version of openssl for a couple of weeks. I've re-made and re-installed openssl (windows habits die hard) before posting this message, but the whole build still fails in exactly the same way as previously reported. when i build apache directly (that is to say running configure and make in the ./apache_ directory, as opposed to in mod_perl) it does not stall on a missing ssl library, and happily compiles with mod_ssl. = u n d e r a c h i e v e r (and proud) <[EMAIL PROTECTED]> __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: mod_proxy and mod_perl in guide
> After checking Apache code for mod_proxy looks like it is normal behaviour. > File modules/proxy/proxy_util.c function ap_proxy_send_fb. This function > reads from originating server into buffer and then writes to the customer from > this buffer. BUT the socket is closed AFTER all the data is sent to the > client (file module/proxy/proxy_http.c function ap_proxy_http_handler. So > the heavy mod_perl server is not released for serving other requests untill > the data is sent to the client by proxy. > > Maybe I'm missing something but the practice shows that this is true and Guide > contains error. Maybe the thing you're missing is that mod_proxy takes care of the lingering close. Those of us who have tried the two-server setup have all seen dramatic reductions in the number of mod_perl processes required. - Perrin
Re: Can't build (was Re: Apache.pm fails to load...)
On Mon, Sep 17, 2001 at 08:02:02PM +0800, Stas Bekman wrote: > U n d e r a c h i e v e r wrote: > > > --- Stas Bekman <[EMAIL PROTECTED]> wrote: > > > >>mod_perl guide is your friend: > >> > >> > >> > > http://perl.apache.org/guide/install.html#mod_perl_and_mod_ssl_openssl > > > > thanks for the tip, but that doesn't work for me. following the > > instructions on the page, i find i get the following errors after the > > 'make' in 'mod_perl'. here's the error:- > > > > ld.so.1: ./gen_test_char: fatal: libssl.so.0: open failed: No such file > > or dire > > *** Error code 137 > > make: Fatal error: Command failed for target Test_char.h' > > Current working directory /export/home/gary/apache_1.3.20/src/main > > *** Error code 1 > > make: Fatal error: Command failed for target Subdirs' > > Current working directory /export/home/gary/apache_1.3.20/src > > *** Error code 1 > > make: Fatal error: Command failed for target Build-std' > > Current working directory /export/home/gary/apache_1.3.20 > > *** Error code 1 > > make: Fatal error: Command failed for target Build' > > Current working directory /export/home/gary/apache_1.3.20 > > *** Error code 1 > > make: Fatal error: Command failed for target Apaci_httpd' > > > > here's the instructions executed:- > > > > export > > PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:/export > > cd openssl-0.9.6b/ > > ./config > > make && make test && make install > > cd .. > > cd mod_ssl-2.8.4-1.3.20/ > > ./configure --with-apache=../apache_1.3.20/ > > cd .. > > cd mod_perl-1.26/ > > perl Makefile.PL USE_APACI=1 EVERYTHING=1 DO_HTTPD=1 \ > > SSL_BASE=/usr/local/ssl \ > > APACHE_PREFIX=/usr/local/apachessl \ > > APACHE_SRC=../apache_1.3.20/src \ > > APACI_ARGS='--enable-module=ssl > > --enable-module=rewrite' > > make > > > > a search for libssl reveals: > > > > find / -name libssl.so.0 > > /usr/local/ssl/lib/libssl.so.0 > > > > can anyone help out at this stage? thanks very > > what do you see when you do: > > ls -l /usr/local/ssl/lib/libssl.so.0 > > For example on my machine I get: > > /home/stas> ls -l /usr/lib/libssl.so.0 > > lrwxrwxrwx1 root root 15 Sep 14 23:36 /usr/lib/libssl.so.0 -> >libssl.so.0.9.6 > > Does the symlink point correctly to the real libssl.so? or your /etc/ld.so.conf doesn't have /usr/local/ssl/lib. In wich case, add it to ld.so.conf and run ldconfig as root > -- > > > _ > Stas Bekman JAm_pH -- Just Another mod_perl Hacker > http://stason.org/ mod_perl Guide http://perl.apache.org/guide > mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ > http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ > > -- Philippe M. Chiasson <[EMAIL PROTECTED]> Extropia's Resident System Guru http://www.eXtropia.com/ Just because something is obviously happening doesn't mean something obvious is happening. -- Larry Wall perl -e '$$=\${gozer};{$_=unpack(P26,pack(L,$$));/^Just Another Perl Hacker!\n$/&&print||$$++&&redo}' PGP signature
apache/mod_perl socket bug on Win32
it seems that apache/mod_perl have a problem with sockets on win32. after the socket has been opened successfully (I double check to see if the socket handler is defined with "fileno($socket)") the print to the socket is failing due to an "invalid argument" error . it seems that this bug exists for some time http://archive.davin.ottawa.on.ca/modperl/1999-02/msg00129.phtml. someone suggested that to avoid the problem the apache should use only one thread, unfortunately I can't use a one thread system. do you of any other solutions to this problem ? I'm using apache 1.3.20 for win32, mod_perl 1.25_01-dev. 10X.
Can't build mod_ssl + mod_perl
apache_1.3.20 mod_perl-1.26 mod_ssl-2.8.4-1.3.20 I can't build Apache with these together if the mod_ssl build works, mod_perl is not built in. If I build mod_perl in the approved manner, the mod_ssl build files. I have followed the recipe in INSTALL.SSL - and it doesn't help. Has anyone got a recipe for doing this?
Re: Can't build (was Re: Apache.pm fails to load...)
> > find / -name libssl.so.0 > > /usr/local/ssl/lib/libssl.so.0 That seems like a nonstandard library path. Is it there in /etc/ld.so.conf and even if it is did you run ldconfig after adding it there ?? Mithun
Persistent DB connections
Hi, Im very near to the solution of my problem, but there's still a thing that's not working properly. Before running my perl script (f1.pl) i see five httpd@hostname sessions in Oracle V$session but at the moment in which i run f1.pl there appear a seventh session alone such f1.pl@hostname. The mechanism of persistent connections seems to be not workinkg properly. What goes wrong? --- Fl@vio D' Amore DATAMAT S.p.A. Via Laurentina 760 00143 Rome - Italy DATASIM - Product Support Phone: +39-06-50.27.4350 case.zip
RE: Template or XML?
> -Original Message- > From: Alexandr Efimov [mailto:[EMAIL PROTECTED]] > > >Yes. AxKit's XSP module does this. Your SQL can be generated with the > >AxKit::XSP::ESQL module, and then you can loop over the results > >in your XSLT stylesheet using either xsl:foreach or (better still) > > using a template. > > Actually using AxKit::XSP::ESQL module seems to be much > more complicated compared to calling a function in Template Toolkit, > for example, it is inconvenient to write code like this: > -- > > Sybase > database=mydb > matt > millionaire > > SELECT MessageId, Subject FROM Messages > > - > in Template, it would be something like > [% data=fetch({sql=>"SELECT MessageId, Subject FROM Messages"}) %] > and we can connect to database only once, probably before > processing a Template. Also, logic seems to be easier to implement > with Template than with AxKit. The idea should be to have that stuff in an external file, just as I'm sure you do with TT. You can do that with either entities or XInclude (though the latter requires the current 1.5 beta). That way it becomes a bit easier. Either that, or do what I've done on projects - write your own taglib that completely and utterly hides the SQL from your pages. Matt. _ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service.
RE: Template or XML?
> -Original Message- > From: Alexandr Efimov [mailto:[EMAIL PROTECTED]] > > Our questions are: > 1. Are there any mod-perl packages created for similar tasks? > 2. Can constructions similar to > > ... > > > (which is now translated into [% FOREACH ... %] template blocks) > be implemented with standard XML parser? Yes. AxKit's XSP module does this. Your SQL can be generated with the AxKit::XSP::ESQL module, and then you can loop over the results in your XSLT stylesheet using either xsl:foreach or (better still) using a template. (I hope to have the AxKit site back online soonish, but BT have screwed up something at the local telephone exchange so my DSL line won't forward authentication requests (which uses Radius) to my ISP, so I have DSL installed but not working. Thanks to all offers to host somewhere, but I'd rather not get everything setup somewhere else only to have to set it all back up at home a week later). Matt. _ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service.
Knowing if a apache server is compiled with mod_perl
Hi everyone, I'd like to know if there is a simple way to find if an apache server is compiled with mod_perl and with which version. My aim is to write a script which compile mod_perl if it is not installed. For the moment I've found only two ways, launch the actual server and telnet it to parse the server signature. But it has the disadvantages of having the Apache server running and the server signature on. The other way would be to get the return of httpd -v, but I won't have the version and I think this won't work if the module is compiled in dso. So is it possible from the Apache binary to check mod_perl ? Cheers, Mat
Re: Knowledge Base for 2.0
On Sun, 16 Sep 2001, Jim wrote: > I'll try to spit out some more thoughts as they come. Please feel > free to contribute. Now's the time to get the wish list put together. Some ideas (from the user's perspective): It would be nice if, the user interface provided a configuration and version form that the user could select for responses. For example, an article may cover all Apache versions between certain version numbers, or all versions above some value. It would be nice if, a sort priority were available. In other words, the date of the article or the keywords may be most important. (etc.) It would be nice if, the knowledge base could connect the information dots. In other words, would contain references (links) to related information. Of these, "Guide", "Debugging", and "Archive" references would be useful. It would be nice if, the information entered during a query could be used to post to an email list. In other words, if the user does not finding useful information, that it would be easy to post a message, that would get human feedback. ++ | George Sanderson <[EMAIL PROTECTED]> | http://www.xorgate.com ++
Re: Can't build (was Re: Apache.pm fails to load...)
U n d e r a c h i e v e r wrote: > --- Stas Bekman <[EMAIL PROTECTED]> wrote: > >>mod_perl guide is your friend: >> >> >> > http://perl.apache.org/guide/install.html#mod_perl_and_mod_ssl_openssl > > thanks for the tip, but that doesn't work for me. following the > instructions on the page, i find i get the following errors after the > 'make' in 'mod_perl'. here's the error:- > > ld.so.1: ./gen_test_char: fatal: libssl.so.0: open failed: No such file > or dire > *** Error code 137 > make: Fatal error: Command failed for target Test_char.h' > Current working directory /export/home/gary/apache_1.3.20/src/main > *** Error code 1 > make: Fatal error: Command failed for target Subdirs' > Current working directory /export/home/gary/apache_1.3.20/src > *** Error code 1 > make: Fatal error: Command failed for target Build-std' > Current working directory /export/home/gary/apache_1.3.20 > *** Error code 1 > make: Fatal error: Command failed for target Build' > Current working directory /export/home/gary/apache_1.3.20 > *** Error code 1 > make: Fatal error: Command failed for target Apaci_httpd' > > here's the instructions executed:- > > export > PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:/export > cd openssl-0.9.6b/ > ./config > make && make test && make install > cd .. > cd mod_ssl-2.8.4-1.3.20/ > ./configure --with-apache=../apache_1.3.20/ > cd .. > cd mod_perl-1.26/ > perl Makefile.PL USE_APACI=1 EVERYTHING=1 DO_HTTPD=1 \ > SSL_BASE=/usr/local/ssl \ > APACHE_PREFIX=/usr/local/apachessl \ > APACHE_SRC=../apache_1.3.20/src \ > APACI_ARGS='--enable-module=ssl > --enable-module=rewrite' > make > > a search for libssl reveals: > > find / -name libssl.so.0 > /usr/local/ssl/lib/libssl.so.0 > > can anyone help out at this stage? thanks very what do you see when you do: ls -l /usr/local/ssl/lib/libssl.so.0 For example on my machine I get: /home/stas> ls -l /usr/lib/libssl.so.0 lrwxrwxrwx1 root root 15 Sep 14 23:36 /usr/lib/libssl.so.0 -> libssl.so.0.9.6 Does the symlink point correctly to the real libssl.so? -- _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Can't build (was Re: Apache.pm fails to load...)
--- Stas Bekman <[EMAIL PROTECTED]> wrote: > mod_perl guide is your friend: > > http://perl.apache.org/guide/install.html#mod_perl_and_mod_ssl_openssl thanks for the tip, but that doesn't work for me. following the instructions on the page, i find i get the following errors after the 'make' in 'mod_perl'. here's the error:- ld.so.1: ./gen_test_char: fatal: libssl.so.0: open failed: No such file or dire *** Error code 137 make: Fatal error: Command failed for target Test_char.h' Current working directory /export/home/gary/apache_1.3.20/src/main *** Error code 1 make: Fatal error: Command failed for target Subdirs' Current working directory /export/home/gary/apache_1.3.20/src *** Error code 1 make: Fatal error: Command failed for target Build-std' Current working directory /export/home/gary/apache_1.3.20 *** Error code 1 make: Fatal error: Command failed for target Build' Current working directory /export/home/gary/apache_1.3.20 *** Error code 1 make: Fatal error: Command failed for target Apaci_httpd' here's the instructions executed:- export PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:/export cd openssl-0.9.6b/ ./config make && make test && make install cd .. cd mod_ssl-2.8.4-1.3.20/ ./configure --with-apache=../apache_1.3.20/ cd .. cd mod_perl-1.26/ perl Makefile.PL USE_APACI=1 EVERYTHING=1 DO_HTTPD=1 \ SSL_BASE=/usr/local/ssl \ APACHE_PREFIX=/usr/local/apachessl \ APACHE_SRC=../apache_1.3.20/src \ APACI_ARGS='--enable-module=ssl --enable-module=rewrite' make a search for libssl reveals: find / -name libssl.so.0 /usr/local/ssl/lib/libssl.so.0 can anyone help out at this stage? thanks very = u n d e r a c h i e v e r (and proud) <[EMAIL PROTECTED]> __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/
Re: Apache.pm fails to load...
On Sat, 15 Sep 2001, U n d e r a c h i e v e r wrote: > Hi > > I'm making a fresh build of Apache on Solaris 8 with mod_perl and > mod_ssl. > > When I load apache i get > Apache.pm failed to load! > in the error log and the application bombs out. mod_perl guide is your friend: http://perl.apache.org/guide/install.html#mod_perl_and_mod_ssl_openssl_ _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
RE: Updating $r->connection->aborted before $r->print() ?
On Sat, 15 Sep 2001, Geoffrey Young wrote: > >> my $fileno = $r->connection->fileno; > >> $s = IO::Select->new($fileno); > >> > >> die "aborted" if grep { m/$fileno/ } $s->can_read(1); > > >Hmm, does this actually work Geoff? What happens if mod_perl is running > >as a back-end? In this case $r->connection->aborted doesn't work even if > >you print. > > yes, it worked for me. actually, I guess I should have been clearer - this > has nothing to do with $c->aborted or $r->print (well, on the outside > anyway). for $c->aborted you have to wait for Apache to flush the print > buffers. actually, in my tests $r->rflush didn't help things behave - only > $|=1 did. > > $s->can_read should always work because Apache marks the client output file > descriptor with a zero-length packet for reading when the client dies. so, > when you can read from where you ought to be writing, you can assume a > broken connection. > > at least this is my understanding. wish I could take credit, though - Eric > discovered/documented this one a while ago:) cool! Somehow I've missed this patch. > at any rate, this worked for me just fine in some tests, but I never tested > it against a front-end/back-end setup. seems like you would never be able > to detect a broken client connection from in a proxy setup anyway, but > that's not my area to comment on... I'll give it a run when I get some time to play with it and update the guide appropriately. Thanks Geoff! _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Knowledge Base for 2.0
On Sun, 16 Sep 2001, Jim Smith wrote: > On Sun, Sep 16, 2001 at 02:37:50PM -0500, Jim wrote: > > Last month, there was some mention of putting together a knowledge > > base for the mod_perl 2.0 documentation. I'm getting to the point at > > work that I can start throwing some time to it. Here are some > > thoughts I'm having regarding the design (programming target). > > If this needs to go on the docs-dev list, I'll take it there. It'll take awhile before there will be enough people on that list, therefore please keep the posts here for now, so we could get more feedback. After a while when the docs-dev list will become more active we will move the discussion there. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Knowledge Base for 2.0
On Sun, 16 Sep 2001, Jim wrote: > Last month, there was some mention of putting together a knowledge > base for the mod_perl 2.0 documentation. I'm getting to the point at > work that I can start throwing some time to it. Here are some > thoughts I'm having regarding the design (programming target). > > I am able to provide hosting at least during development. I'll put > out a URL when we get something together. That's great! Once it's working, we may start using it for all ASF projects and then it'll be easy to host it on ASF machines. I've just stumbled upon SuSe knowledge base -- very nice: http://sdb.suse.de/en/sdb/html/index.html > I think the first thing we need to do is figure out what we want the > knowledge base to do. I would like to see this be a general purpose > application that happens to do the job well enough for our use with > mod_perl docs as well as other unrealted areas. It is because of the > general use of the application that I may able to devote time at work > to the project. > > So... in general, my take on a KB is that it provides the following: > > o Easy access to the right document at the right time > This is for customers and customer support > o Easy management of documents > This is for the developers and writers > > These two items could easily be built as two independent interfaces > around a common backend. I'd like to take this fall semester and > develop the backend so we can work on front ends in the spring. > > The backend will need to support the following operations: > > o Indices of documents - keywords, title, author, etc. > o Management of documents - insert, delete, modify, classify > (setting keywords, ...) Also check http://thingy.kcilink.com/modperlguide/, which is a special version of the guide that generates a page per section rather than having huge pages. So it should be able to take a document and split it into factoids/sections and while keeping them in relation, like the URL above. So when you search, each item gets searched separately, but when you view a section, you can still easily jump to the adjusent sections in the original doc. > o Ranking of documents for search results > > o probably other things I'm not thinking about at the moment > > Documents will need to be understood in a variety of formats such as > docbook and pod. Probably use pod as the initial format since that is > what the mod_perl 2.0 docs will be written in. and we have some docs in modperl-docs cvs rep already. Not much yet, but it's the beginning. > We can use AI::Categorize to form the initial keywords for a document. > The system can learn as documents are added. > > We might want to include revision control someday -- perhaps use CVS, > which might allow for an easy CLI. Otherwise, we can create an > XML-RPC interface and design some CLI tools around it. Or both. > This would be in addition to any web-based interface we might have. > > I'll try to spit out some more thoughts as they come. Please feel > free to contribute. Now's the time to get the wish list put together. Cool! One thing I'd like to add is that the system should be capable of scratching its database and rebuilding everything from scratch. Consider some documentation being used as a source, getting modified, or some items become absolute and get removed, some items get added. Somehow the system should be able to handle this. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: mod_proxy and mod_perl in guide
On Mon, 17 Sep 2001, Andrei A. Voropaev wrote: > Hi! > > I have one question. According to the Guide there's buffering feature of > mod_proxy that allows to release heavy mod_perl process from delivering data > over slow connection to the user. > > In our system we have to pass large PDF files thru mod_perl to proxy and we > noticed that it takes the same time as sending it directly to customer. > > After checking Apache code for mod_proxy looks like it is normal behaviour. > File modules/proxy/proxy_util.c function ap_proxy_send_fb. This function > reads from originating server into buffer and then writes to the customer from > this buffer. BUT the socket is closed AFTER all the data is sent to the > client (file module/proxy/proxy_http.c function ap_proxy_http_handler. So > the heavy mod_perl server is not released for serving other requests untill > the data is sent to the client by proxy. > > Maybe I'm missing something but the practice shows that this is true and Guide > contains error. Please someone check this. Your observation is correct. But you didn't finish reading the whole thing. Have you read this section: http://perl.apache.org/guide/scenario.html#Setting_the_Buffering_Limits_on_ Also check the archives for 'lingerd' keyword. Here is what I've but it didn't enter the guide yet, since it's waiting to be reviewed by Roger Espel Llima, the author of lingerd. ...and waiting, and waiting, and waiting :( =head2 Closing Lingering Connections with Lingerd Because of some technical complications in TCP/IP, at the end of each client connection, it is not enough for Apache to close the socket and forget about it; instead, it needs to spend about one second I on the client. (More details can be found at http://httpd.apache.org/docs/misc/fin_wait_2.html) Lingerd is a daemon (service) designed to take over the job of properly closing network connections from an http server like Apache and immediately freeing it to handle a new connection. C can only do an effective job if HTTP Cs are turned off; since Cs are useful for images, the recommended setup is to have C serving mod_perl enabled Apache and plain Apache for images and other static objects. With a C setup, you don't have the proxy, so the buffering chain we have presented before for the proxy setup is much shorter here: FIGURE: | Apache Kernel |TCP/IP `o' | [mod_perl]=>[sendbuf] |==> /|\ | |/ \ Hence in this setup it becomes more important to have a big enough kernel send buffer. With lingerd, a big enough kernel send buffer, and keep-alives off, the job of spoonfeeding the data to a slow client is done by the OS kernel in the background. As a result, C makes it possible to serve the same load using considerably fewer Apache processes. This translates into a reduced load on the server. It can be used as an alternative to the proxy setups we have seen so far. For more information about C see: http://www.iagora.com/about/software/lingerd/ Let me know if it was useful and correct, and I'll put it into the guide. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/