Creating a filter for all text/html files

2005-01-30 Thread Scott Gifford
Hello, I'm working on moving a Web server to a new location, and to test it, I'd like to use a simple filter to replace all references to the old server name with the IP address of the new server. This is just for testing, so it's OK that it's not a perfect solution. Basically, I'm doing: s

Re: Creating a filter for all text/html files

2005-02-02 Thread Scott Gifford
"Philippe M. Chiasson" <[EMAIL PROTECTED]> writes: > Scott Gifford wrote: >> Hello, >> [...] >> >> I've got it working right now, but I'd like it to know the >> Content-Type that Apache would use for a document, so I can decide >&

Re: mod_perl/Apache troubles with cell phone

2005-03-09 Thread Scott Gifford
Tom Schindl <[EMAIL PROTECTED]> writes: > Is the content-type set appropiately? I don't know what its supposed > to be on for a cell-phone. Any could to help you would be appreciated. It should be text/vnd.wap.wml ScottG.

Re: Restarting apache from child?

2005-03-15 Thread Scott Gifford
Maxim Nechaev <[EMAIL PROTECTED]> writes: > I need to restart or graceful restart apache server from one of his > child. It is possible? If yes, how to do this more correctly? The main Apache process runs as root, and each Apache child process runs as a less-privileged user, and so would not have

Re: Restarting apache from child?

2005-03-15 Thread Scott Gifford
"Jain, Abhay K, ALABS" <[EMAIL PROTECTED]> writes: [...] > Scripts such as perl or ksh do not become root with setuid. > They really do not get the same privilege. Setuid to root > works ok with a compiled executable. It's OS-specific, so that may or may not be true. Some OS's, like Solaris, im

Re: shared memory

2005-03-15 Thread Scott Gifford
André Warnier <[EMAIL PROTECTED]> writes: [...] > I have previously gone though a lot of perl and mod_perl > documentation, and perl module descriptions, and I never seemed to > find a clear answer about wether yes or no it was possible to share > in-memory data between 2 perl processes (or threa

Re: Restarting apache from child

2005-03-16 Thread Scott Gifford
Maxim Nechaev <[EMAIL PROTECTED]> writes: > Scott, thanks for response! > > SG> The main Apache process runs as root, and each Apache child process > SG> runs as a less-privileged user, and so would not have permission to > SG> signal the main process to tell it to reload. > > Ok i understand diff

Filter on top of a CGI script

2005-03-22 Thread Scott Gifford
Hello, I've got a filter which replaces references to a particular hostname with another name, to allow testing of a new server. The filter is very simple, and works great for static files (thanks in part to some earlier help from this list!) But, I can't get it to work for CGI scripts. If I pu

Re: Filter on top of a CGI script

2005-03-22 Thread Scott Gifford
Thanks for you response, Slava. More below... Slava Bizyayev <[EMAIL PROTECTED]> writes: > Hi Scott, > > As far as I understand, your handler Apache::SiteMoved does all the > dirty work for you on Apache-1, replacing the hostname. Yes. > Additionally, you want your CGI script to remain as a C

Re: [OT] checking for legal chars in a filename passed in by upload params?

2005-04-11 Thread Scott Gifford
Carl Brewer <[EMAIL PROTECTED]> writes: [...] > I'm not too worried about the upload filenames, but the defensive > programmer in me somewhere says if I'm going to write this, I should > prevent the uploadee from doing bad things. The uploadee *should* > be a trusted user, but may not be... I d

Re: Web Content Compression FAQ - update

2005-04-18 Thread Scott Gifford
Slava Bizyayev <[EMAIL PROTECTED]> writes: > Thanks, Stas! > On Mon, 2005-04-18 at 12:10, Stas Bekman wrote: [...] >> Also, please fix your original: >> >> - >From the perspective of global architecture and scalability planning, >> + From the perspective of global architecture and scalability p

Re: Web Content Compression FAQ - update

2005-04-18 Thread Scott Gifford
Stas Bekman <[EMAIL PROTECTED]> writes: > Scott Gifford wrote: >> Slava Bizyayev <[EMAIL PROTECTED]> writes: [...] >>>Strangely... There is no '>' in my original. Neither I find in >>>attachment that I sent... >> That's a standard

Re: module requires either Apache::Foo or Apache2::Foo

2005-06-27 Thread Scott Gifford
I don't have an answer for your original question, but... Michael Peters <[EMAIL PROTECTED]> writes: [...] > As a side note, I know I can split it up into 2 different distributions > using the 'Apache' and 'Apache2' names, but I really don't want to do > that since 99% or the modules code is the

Re: is there a templating system that....

2005-08-12 Thread Scott Gifford
Jonathan Vanasco <[EMAIL PROTECTED]> writes: [...] > If/else and loops are already 'too much' -- I essentially just want > variable substitution. I want designers to be able to work on a page > and not need to know anything about the code/logic. Names go here, > dates go here, etc. I have a

Re: -M in modperl

2006-01-12 Thread Scott Gifford
Hi Luke, When posting a new message to the list, please start a new thread instead of replying to an existing one and erasing everything. Mail clients put References: headers in which allow Web archives and smart mail clients to keep track related messages together. In your case, your References

Can't print to selected filehandle?

2006-02-21 Thread Scott Gifford
Any idea why this works from the command-line, but not from within mod_perl? #!/usr/bin/perl -Tw use strict; print "Content-type: text/plain\n\n"; local *FH = select; print "FH: ",*FH,"\n"; print FH "Printing to FH\n"; p(\*FH,"Printing to FH via p().\n");

Re: Can't print to selected filehandle?

2006-02-21 Thread Scott Gifford
Frank Wiles <[EMAIL PROTECTED]> writes: [...] > First off I would convert it to using IO::File or somehow get > rid of using globs. Such as my $fh = select; But this won't > solve your error, just makes the code easier to work with. I actually tried that, but couldn't get it to work:

Re: Help: ENV shared between requests???

2006-07-30 Thread Scott Gifford
"Fred Tyler" <[EMAIL PROTECTED]> writes: > I was trying to use $ENV{'HTTP_REFERER'} in a certain script, and as I > reloaded the script over and over I noticed that it would constantly > be changing when the page was loaded directly (and therefore there > should not have been any HTTP_REFERER at a

Authentication Problem

2007-04-17 Thread Scott Gifford
Hello, I'm having trouble with PerlAuthenHandler. The symptom is that in a browser (Firefox at least), I'm prompted for a password the first time I visit a page. If I enter it incorrectly, I'm not prompted again, but instead just see the error page. The cause seems to be that when mod_perl gets

Re: Authentication Problem

2007-04-17 Thread Scott Gifford
Scott Gifford <[EMAIL PROTECTED]> writes: [...] > The cause seems to be that when mod_perl gets an "Authorization" > header in the request, it doesn't supply a "WWW-Authenticate" header > in the response. Nevermind, found it, the solution was t

Re: asynchronous perl authentication!?

2007-06-03 Thread Scott Gifford
_spitFIRE <[EMAIL PROTECTED]> writes: > Hi All, > I have written a simple perl module (using apache authcookie) for > authenticating users. However, whenever the user types a wrong password, > the entire page refreshes. Is it possible to do a ajax style authentication > here??? I'm sorry if my u

Re: opinions of mod_perl users on MIME email sending

2007-06-18 Thread Scott Gifford
John ORourke <[EMAIL PROTECTED]> writes: > Hi folks, > > I'm wondering what modules people use for sending email? At the > moment I'm using MIME::Lite but I'm doing several things myself which > a bigger module might do for me: You can try Mail::Box - http://search.cpan.org/~markov/Mail-Bo

Re: Apache Subprocess

2007-06-21 Thread Scott Gifford
Hi Khan, <[EMAIL PROTECTED]> writes: [...] > I was trying in the lines of below code from http://perl.apache.org/docs/2.0/ > api/Apache/SubProcess.html . > > # write to/read from the process > $command = "/tmp/in_out_err.pl"; > ($in_fh, $out_fh, $err_fh) = $r->spawn_proc_prog($command);

Re: Apache Subprocess

2007-06-22 Thread Scott Gifford
<[EMAIL PROTECTED]> writes: > Hi Scott, > > I do not see anything in error log, The print line before and after the > command also works fine,The webserver has permission to run the command > since I can execute the same command using backtick like > `/tmp/in_out_err.pl` Huh, that is very odd. A

Re: CGI->params() should be tainted, right?

2007-11-26 Thread Scott Gifford
jalex <[EMAIL PROTECTED]> writes: > I'm running mod_perl 2.0.2 under apache 2.0.54. After adding "PerlSwitches > -wT" to my apache config, I wanted to test that I had taint mode was indeed > working, so I wrote a test script that purposely misused a CGI parameter, > expecting the taint exception t

Re: CGI->params() should be tainted, right?

2007-11-30 Thread Scott Gifford
jalex <[EMAIL PROTECTED]> writes: [...] > Yes, I am aware various workarounds exist, however I don't think whether > this is a bug or not is really at all arguable: anything that is marked as > tainted in perl needs to be also marked tainted in mod_perl2. There is > nothing in the mod_perl docume

Re: a mp/perl equivalent to sendmail.php?

2008-01-28 Thread Scott Gifford
Carl Brewer <[EMAIL PROTECTED]> writes: > I have a client who wants to send email from a flash script (do you > call flash stuff scripts?), and he has asked me to install > sendmail.php for him. I don't want to! Can anyone here recommend a > modperl (or just plain perl) equivalent that I can loc

Re: return DECLINED or OK?

2008-02-29 Thread Scott Gifford
"J. Peng" <[EMAIL PROTECTED]> writes: > On Fri, Feb 29, 2008 at 7:03 PM, Torsten Foertsch > <[EMAIL PROTECTED]> wrote: >> >> Example continued: The entry /var/www/a/b exists on disk either as file or >> as >> directory but /var/www/a/b/c does not. Then after MapToStorage $r->filename >> is /va

Re: live and dev versions of a module on the same server

2008-10-04 Thread Scott Gifford
"Perrin Harkins" <[EMAIL PROTECTED]> writes: > On Fri, Oct 3, 2008 at 4:25 PM, Phil Carmody <[EMAIL PROTECTED]> wrote: >> I presume that all hosting services which offer LAMP do so via virtual >> machines then, or via Apache 2. > > No, they typically just offer CGI. This is not an issue with CGI

Environment variable problem in mod_perl 2

2009-06-02 Thread Scott Gifford
[ also posted on PerlMonks ] I'm working on porting some code that's been running on mod_perl 1 for a very long time to mod_perl 2. Mostly things have gone smoothly, but I'm having trouble with environment variables. Sometimes my scripts go off and run other scripts, and expect to be able to set t

Re: Environment variable problem in mod_perl 2

2009-06-03 Thread Scott Gifford
ome suggested text for: http://perl.apache.org/docs/2.0/user/porting/compat.html#Issues_with_Environment_Variables if it would be helpful. Scott. > On Wed, Jun 3, 2009 at 2:58 AM, Scott Gifford > wrote: > > [ also posted on PerlMonks ] > > I'm working

Re: File Descriptor used by FileHandle under mod_perl 2.0.4 - is it a perl/mod_perl bug ?

2009-06-30 Thread Scott Gifford
Shibi NS writes: [...] > my $log = new FileHandle("process.log", "a"); > > When I print the $log->fileno it print FD as 0 and I have couple other log > files opened after this all of these having random numbers like 12,15 etc. my > believe is FD 0 used for STDIN . Is this is bug or aim doing >

Re: File Descriptor used by FileHandle under mod_perl 2.0.4 - is it a perl/mod_perl bug ?

2009-06-30 Thread Scott Gifford
Shibi NS writes: [...] > is my assumption is wrong "FD 0" is reserved for STDIN ? It's partly right: FD 0 is standard input by convention (and also by definition) but it's not reserved or otherwise treated specially by the OS or by Perl. Scott.

Re: first time debugging apache/mod_perl Seg fault

2009-07-14 Thread Scott Gifford
Alan McKay writes: > Here is what I am doing based on the mod-perl debugging page I > referred to in my first email. I basically load the core dump in > gdb, and then alternately do "up" and "curinfo" on each line shown. > Sometimes I end up with what I got here where I get to a certain point >

Re: Ways to scale a mod_perl site

2009-09-16 Thread Scott Gifford
Igor Chudov writes: > My algebra.com server serves about 77k pageviews and a little over a million > objects requests per day (with half of it being served in just 4 hours). I > peak > out at 35 requests per second currently. Some high-level advice: Profile everything you can to see where your

Re: Ways to scale a mod_perl site

2009-09-18 Thread Scott Gifford
Brad Van Sickle writes: >> >>> 3) Being enabled by item 2, add more webservers and balancers >>> 4) Create a separate database for cookie data (Apache::Session objects) >>> ??? -- not sure if good idea -- >> >> I've never seen the need to do that. In fact, I would suggest you >> drop sessions alt

Re: Ways to scale a mod_perl site

2009-09-18 Thread Scott Gifford
Tina Mueller writes: > On Wed, 16 Sep 2009, Michael Peters wrote: > [...] >> If you need to store per-session data about a client that the client >> shouldn't be able to see, then you just encrypt that data, base-64 >> encode it and then put it into a cookie. > > How does the user invalidate that

Configuring virtual hosts on the fly

2009-10-11 Thread Scott Gifford
Hello, I'm working on an Apache configuration for a cluster of machines serving a variety of virtual hosts. New virtual hosts are provisioned by a Web application, and all information needed to set up the virtual hosts is in a database table. I would like my Apache to set up the virtual hosts on

Re: Configuring virtual hosts on the fly

2009-10-13 Thread Scott Gifford
Thanks William, comments inline... William T writes: > On Sun, Oct 11, 2009 at 11:54 AM, Scott Gifford > wrote: >> Hello, >> >> I'm working on an Apache configuration for a cluster of machines >> serving a variety of virtual hosts. > > I would not try t

Re: Configuring virtual hosts on the fly

2009-10-13 Thread Scott Gifford
Michael Peters writes: > Looking at this from a different perspective, have you tried writing a > monitoring program that looks for updates to the database and then > would restart the appropriate apache servers on the various > machines. It would do them one at a time (taking them out of rotatio

Re: Configuring virtual hosts on the fly

2009-10-13 Thread Scott Gifford
"Ryan Yagatich" writes: > What about mod_vhost_alias? ( > http://httpd.apache.org/docs/2.0/mod/mod_vhost_alias.html ) > > > Summary > > This module creates dynamically configured virtual hosts, by allowing the IP > address and/or the Host: header of the HTTP request to be used as part of > the p

Re: Configuring virtual hosts on the fly

2009-10-13 Thread Scott Gifford
Joel Richard writes: > I thought I'd weigh in on two items of note > > On Oct 13, 2009, at 12:17 PM, Scott Gifford wrote: > >> When I have done this in the past, I have done it with generating >> configuration files, so of course one misplaced newline or >>

Re: Configuring virtual hosts on the fly

2009-10-14 Thread Scott Gifford
Scott Gifford writes: [...] > I see some hooks in PerlTransHandler and PerlMapToStorageHandler that > seem like they can almost do what I want, but I don't see how to set > other virtual host parameters, like ServerAdmin, UseCanonicalName, > etc. I was able to get something

Re: AJAX pseudo-push

2009-11-12 Thread Scott Gifford
Nicolas George writes: > Hi. > > There is an increasingly popular technique to emulate server-initiated push > over HTTP. I'm sure everyone here knows it well, but for the sake of > completeness: the clients sends a XMLHttpRequest to the server in the > background; the server does not answer it i

Re: Zip on the fly problem

2010-01-12 Thread Scott Gifford
On Tue, Jan 12, 2010 at 7:49 AM, Thomas den Braber wrote: [ ... ] > The error is: 'IO error: seeking to rewrite local header : Invalid > argument' > That error means that after writing something to the ZIP archive, it tried to go backwards to put what it just wrote in the header, but found it co

Re: Apache2::SubProcess sucks

2010-02-20 Thread Scott Gifford
2010/2/20 Torsten Förtsch [ ... ] > - is there a portable way to get all open file descriptors of the current > process? Under Linux one can readdir(/proc/self/fd). On Darwin I once > simply > closed all fds from 0 to 1000. Some systems have getdtablesize(2), > sometimes > it is getrlimit. Someti

Re: Taint Mode Seems to be Ignored

2010-05-25 Thread Scott Gifford
Last I heard, taint mode in mod_perl didn't always work. See: http://marc.info/?l=apache-modperl&m=119749949626698&w=2 That was a while back, maybe it's been fixed by now. -Scott. On Tue, May 25, 2010 at 10:26 AM, Nik Ogura wrote: > Hello. > > Running Apache 2.2.12, mod_perl 2.0.4, per

Re: Efficiently monitoring httpd children and signalling those using too much memory/cpu

2011-08-22 Thread Scott Gifford
On Mon, Aug 22, 2011 at 8:10 PM, Jonathan Swartz wrote: > We use Apache/mod_perl 2 and occasionally get a child httpd process that > spins out of control, either consuming ever-increasing amounts of memory or > max cpu. Usually due to an infinite loop or other bug in a specific part of > the site

Re: about ModPerl::Registry

2011-09-16 Thread Scott Gifford
On Fri, Sep 16, 2011 at 12:12 AM, Jeff Pang wrote: > Hello, > > When my CGI scripts are moved to run under ModPerl::Registry, and when the > script is changed, should I restart Apache each time? > Hi Jeff, In general you do, but look at modules like Apache2::Reload

Re: mod_perl Filters: Selecting the most appropriate buffer size

2012-07-19 Thread Scott Gifford
On Tue, Jul 10, 2012 at 7:16 AM, Rommel Sharma wrote: > Hi All, > > ** ** > > I am going through the documentation on mod_perl filters at the link below: > > > ** ** > > http://perl.apache.org/docs/2.0/user/handlers/filters.html > > ** ** > > ** ** > > Examples set a buffer size to p