RFC: mod_proxy_add_uri.c Apache module
I have written a module for Apache which sets the X-Original-URI field to the original URI when doing a ProxyPass, similar to what mod_proxy_add_forward.c does for the remote IP address. The code is available at http://tjmather.com/mod_proxy_add_uri.c Any comments or suggestions welcome. _ T.J. Mather http://tjmather.com http://cpan2.org/ New CPAN Search Engine http://www.anidea.com/ Digital Asset Management http://www.theinnkeeper.com/Bed and Breakfast Directory
DBI-connect SegFault blues
I've been writing a handler on a test box which uses the DBI-connect method, no problem, only my Perl authoring skills are at fault. Its based on Slackware 7.1, with Apache 1.3.14, mod_perl 1.24_01, and mod_ssl 2.7.1. I have DBI 1.14 and msql-mysql 1.2215 with Perl 5.6.0. MySQL version is 3.22.32. Once I got this satisfactory, I transferred it to the "production" box, which is running the same versions of everything, except it also has PHP 4.0.4pl1 and also mod_gzip 1.3.14.6e. Apart from that it has the same versions of everything, same base distro too. On this box, I'm getting the behaviour noted by a few other posts I've read on the archive. This is the DBI-connect leading to a segfault with little or no useful information in the logs. I've gone through the archive, and I can't find any solution apart from a source hack which is advised against. Is there any other solution to this problem? I can't down the production apache box without good cause as apart from my handler, the box is behaving as expected. BTW I can write trivial DBI scripts which when run from a shell, work fine, it's just when run under a handler (.pm). Any pointers are appreciated Thanks Matt
Problem with connect to mysql - seg faults
Hi, I wrote a script that search the mysql database. At first I ran it as plain CGI it works well, but problem is when it runs with mod_perl - it starts with seg fault, apache log: [Sat Feb 24 10:44:51 2001] [notice] child pid 24856 exit signal Segmentation fault (11) It seems that seg fault caused by the connect method of DBI, because when I comment this line the script runs OK. But the strange thing is that: when I put this line (with DBI-connect) out of the program flow, to some place where it won't be executed the script still seg faults - maybe it is something wrong at compile time? My config: Debian Potato, Mysql 3.22.32, Apache 1.3.14, mod_perl 1.25, Perl 5.6, DBI 1.14, mysql DBD 1.2215 Thanks for any help. Regards, Mirek Rewak [EMAIL PROTECTED]
Win32 Perl with Apache.
I've been trying to use ActiveState Perl 5.6.0 (623) with Apache/1.3.14 (Win32). I've configured ScriptAlias and used proper #!/path/to/perl. Apache spawns Perl process, but it never returns anything and hangs, hangs and ... still hanging forever, even if I restart Apache child processes remain dead. Is there a way I can make latest ActiveState Perl working with Apache. Executable programs like counters return output and everything is smooth. I need perl to work with Apache. Ideas appreciated. One, Roman.
apache::asp
Hello I was wondering if the support for asp in apache also includes ODBC access from a asp script to a MS Access database or other ODBC source. Like it is posible in a MS Web server? Kind regards Jacques
Re: apache::asp
"[EMAIL PROTECTED]" wrote: Hello I was wondering if the support for asp in apache also includes ODBC access from a asp script to a MS Access database or other ODBC source. Like it is posible in a MS Web server? Perl database access is handled through the DBI layer, check out: http://dbi.symbolstone.org/ In general, I don't think you will find much support for Access on unix, however, if you are using Apache::ASP + mod_perl on Win32 platform, you may get an ADO object through the $Server-CreateObject() API. Generally, people recommend that you look at MySQL for database access if you are looking at moving to Unix. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
files with same ext, but different handler based on partial name
Hi, I want to do configure my mod_perl as: "All the files having extension .cgi should be run as standard CGI, except *fixname*.cgi , if any file match *fixname*.pl , it should run as mod_perl. " Is it possible to files having the same ext , but depend on partial file name , apache consider them differently, files may be located any where not in a special directory. I wat to do something like: Files *fixname*.cgi SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader On Options +ExecCGI /Files AddHandler cgi-script .cgi Is it possible? Regards, -Surat Singh Bhati
possible solution for exec cgi SSI in mod_perl
Hi, I am using lots of exec cgi SSI in my site, all the CGI called using exec are written in perl. !--#exec cgi="standardcgi.cgi"-- I want to take advantage of mod_perl for performance, but as I know "exec" will run as mod_cgi , not as mod_perl. Can I use !--#include virtual="modperlscript.pl"-- ? If above will run, will be run as a sub request.. ? Any other better solution to server the page included mod_perl scripts SSI in it, without running the subrequest/new process? Regards, -Surat Singh Bhati
Re: possible solution for exec cgi SSI in mod_perl
If you build modperl with 'perl Makefile.PL EVERYTHING=1' (or, at least with 'PERL_SSI=1', then your server side includes will have an additional option that looks like this: !--#perl sub="DoSomething"-- This will invoke routine 'DoSomething' when this page is expanded. You'll need to pre-load your module with a PerlRequire or PerlModule directive. You could also use Apache::SSI as the handler to do the same type of thing. Many details of how this works in the Eagle book. One warning: mod_perl *must* be built statically for PerlSSI stuff to work -- if you try to build it dynamically, the build tool prints a warning that "PerlSSI disabled in DSO build", or something like that. HTH, Steve On Sun, 25 Feb 2001, Surat Singh Bhati wrote: Hi, I am using lots of exec cgi SSI in my site, all the CGI called using exec are written in perl. !--#exec cgi="standardcgi.cgi"-- I want to take advantage of mod_perl for performance, but as I know "exec" will run as mod_cgi , not as mod_perl. Can I use !--#include virtual="modperlscript.pl"-- ? If above will run, will be run as a sub request.. ? Any other better solution to server the page included mod_perl scripts SSI in it, without running the subrequest/new process? Regards, -Surat Singh Bhati =-=-=-=-=-=-=-=-=-=- My God! What have I done? -=-=-=-=-=-=-=-=-=-= Steve Reppucci [EMAIL PROTECTED] | Logical Choice Software http://logsoft.com/ |
RE: possible solution for exec cgi SSI in mod_perl
Here's another way around it. You could use HTML::Template in place of SSI. Jamie -Original Message- From: Surat Singh Bhati [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 25, 2001 7:28 AM To: [EMAIL PROTECTED] Subject: possible solution for "exec cgi SSI" in mod_perl Hi, I am using lots of exec cgi SSI in my site, all the CGI called using exec are written in perl. !--#exec cgi="standardcgi.cgi"-- I want to take advantage of mod_perl for performance, but as I know "exec" will run as mod_cgi , not as mod_perl. Can I use !--#include virtual="modperlscript.pl"-- ? If above will run, will be run as a sub request.. ? Any other better solution to server the page included mod_perl scripts SSI in it, without running the subrequest/new process? Regards, -Surat Singh Bhati
Is it Apache or me?
I'm not quite sure how this works, and maybe I missed it in the Eagle book. I have a handler set in httpd.conf like this: Location / Set-Handler perl-script PerlHandler app::main /Location Now this works great when I want to go to the first page of the server. However if I try to go to a static page, that page gets intercepted and the app::main goes in to action. The handler doesn't intercept any of the other set locations. Why is it intercepting static pages? Is it a standard rule that a handler for Location / is never set? Thanks, Jamie Krasnoo www.MyEBoard.com [EMAIL PROTECTED] public key: http://www.planetphat.com/jkrasnoo/pgp.html
Re: Is it Apache or me?
if you set a handler for / it will handle every request that way. you can either have all pages that are generated be /foo/ and set that as the location, or you can force all files with a certain suffix to be handled by mod_perl: Files ~ "*\.pl". sterling On Sun, 25 Feb 2001, Jamie Krasnoo wrote: I'm not quite sure how this works, and maybe I missed it in the Eagle book. I have a handler set in httpd.conf like this: Location / Set-Handler perl-script PerlHandler app::main /Location Now this works great when I want to go to the first page of the server. However if I try to go to a static page, that page gets intercepted and the app::main goes in to action. The handler doesn't intercept any of the other set locations. Why is it intercepting static pages? Is it a standard rule that a handler for Location / is never set? Thanks, Jamie Krasnoo www.MyEBoard.com [EMAIL PROTECTED] public key: http://www.planetphat.com/jkrasnoo/pgp.html
Re: Is it Apache or me?
[EMAIL PROTECTED] (Jamie Krasnoo) wrote: I'm not quite sure how this works, and maybe I missed it in the Eagle book. I have a handler set in httpd.conf like this: Location / Set-Handler perl-script PerlHandler app::main /Location Now this works great when I want to go to the first page of the server. However if I try to go to a static page, that page gets intercepted and the app::main goes in to action. The handler doesn't intercept any of the other set locations. Why is it intercepting static pages? Is it a standard rule that a handler for Location / is never set? It sounds like you want this (or similar): Files index.html Set-Handler perl-script PerlHandler app::main /Files Using Location / sets things for the entire server, because it means "everything below /". ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
RE: Is it Apache or me?
Found a way around it. I used LocationMatch "^/$". Now it does what I want it to do. Thanks for your help guys. Jamie -Original Message- From: sterling [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 25, 2001 9:26 PM To: Jamie Krasnoo Cc: Modperl Subject: Re: Is it Apache or me? if you set a handler for / it will handle every request that way. you can either have all pages that are generated be /foo/ and set that as the location, or you can force all files with a certain suffix to be handled by mod_perl: Files ~ "*\.pl". sterling On Sun, 25 Feb 2001, Jamie Krasnoo wrote: I'm not quite sure how this works, and maybe I missed it in the Eagle book. I have a handler set in httpd.conf like this: Location / Set-Handler perl-script PerlHandler app::main /Location Now this works great when I want to go to the first page of the server. However if I try to go to a static page, that page gets intercepted and the app::main goes in to action. The handler doesn't intercept any of the other set locations. Why is it intercepting static pages? Is it a standard rule that a handler for Location / is never set? Thanks, Jamie Krasnoo www.MyEBoard.com [EMAIL PROTECTED] public key: http://www.planetphat.com/jkrasnoo/pgp.html