Re: Invoking single app for everything in a hierarchy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Erik Westland wrote:
Justin et al,

That is promising, but I can't alter any of the request parameters before the filter has a chance to record them.
I haven't tried this solution yet, but I believe URL rewriting will change the request params to reflect the new target. This could work if my filter was run before the URL rewriting, but I am using an output filter (e.g. PerlOutputFilterHandler). I might be able to split my handler into input and output handlers, but that approach will likely have consequences of it's own.

Any other thoughts?

Thanks for your time,
Erik


When you perform an internal rewrite (with the [L] flag), the GET/POST data is passed along automatically to the destination page. The URL in the end-user's browser will stay the same, but Apache will execute the other script (in this case, /cgi-bin/helloworld.cgi). Since I have not done much programming with Perl in regards to creating web pages, I can't say exactly which variables will hold everything you need. I know that GET/POST data is passed via $ENV{'QUERY_STRING'} or STDIN, but if you want to retrieve variables set by Apache, such as the original script name or URL, I can't give definitive answers for that. I think the %ENV hash will hold the rest of the info you need.

Justin Pasher

----- Original Message ----
From: Justin Pasher <justinp@xxxxxxxxxxxxxxxxxxx>
To: users@xxxxxxxxxxxxxxxx
Sent: Tuesday, October 21, 2008 11:00:33 AM
Subject: Re:  Invoking single app for everything in a hierarchy

Erik Westland wrote:
Hello,

I would like to direct requests for everything (cgi, pl, html, etc) under the root directory to a single CGI. The catch is that I would like the parameters to remain unchanged; passed to the single handler.

For example, for the following:
- /index.html
- /foo/fake.cgi
- /goo/moo/not-real-either.pl
- /another/faker.gif

I would like to invoke a single application (e.g. helloworld.cgi), but want to retain the original request info (e.g. post/get, params, referrer,...).

I am trying to test (load/functionality) a custom filter and want to run production access logs via JMeter. The logs contain a number of applications that I don't have deployed, I just need something to respond to the request. The filter inspects the request params, but doesn't care about the content of the response. JMeter will want a 200 return code though.

Hope this is clear enough...

Cheers and thanks,
Erik

Unless I'm misunderstanding the task, a simple RewriteRule will accomplish this.

RewriteRule .* /cgi-bin/helloworld.cgi [L]



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux