Brian Mearns | 1 Nov 2009 02:42
Picon

Limit output filter by response code

I'm using external filters to minify javascript and CSS files as they
head out of the server. The minifier takes a good 500ms to run,
causing serious drag. So I put Squid in front of the server and
configured it as a caching proxy. The problem is, the filters are
running even on "304 Not Modified" responses, meaning there isn't
actually any content to minify.

So I want to be able to configure whether or not the filter is used
based on the response code. Is this possible? Alternatively, if I can
access the response code in the ext filter (as an env var or command
line parameter, for instance), then I can make the decision there.

Any help would be really great.
Thanks,
-Brian

--

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://keys.gnupg.net

---------------------------------------------------------------------
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 <at> httpd.apache.org
   "   from the digest: users-digest-unsubscribe <at> httpd.apache.org
For additional commands, e-mail: users-help <at> httpd.apache.org

Damian Traverso | 1 Nov 2009 15:58

Re: mod_proxy_ajp (2.2.13) + Tomcat 6.0.20 - APR does not understand this error code: proxy: read response failed

Hi, first of all, thanks for your answer.

And about the error, I also thought that could be the problem, but the
thing is when that error is logged on Apache, the Tomcat instances are
NOT using their MaxThreads capabilities.

Another issue we have is that, when this problem appears, the
processing threads on Tomcat start taking longer responses than
regular usage.

Thanks again,
-Damian

On Sat, Oct 31, 2009 at 7:46 PM, André Warnier <aw <at> ice-sa.com> wrote:
> Damian Traverso wrote:
>>
>> Hi,
>> we have one Apache-2.2.13 running mod_proxy_ajp + mod_proxy_balancer,
>> connected to (3) Tomcat-6.0.20 instances under Fedora release 8. We
>> are experiencing some issues with high CPU load on the Tomcat side,
>> and Apache starts logging errors like these
>>
>> [Fri Oct 30 14:47:43 2009] [error] (70007)The timeout specified has
>> expired: ajp_ilink_receive() can't receive header
>> [Fri Oct 30 14:47:43 2009] [error] ajp_read_header: ajp_ilink_receive
>> failed
>> [Fri Oct 30 14:47:43 2009] [error] (120006)APR does not understand
>> this error code: proxy: read response failed from
>>
>> On Tomcat side we are using the APR Native Connector, with this settings:
(Continue reading)

Andrei Iarus | 1 Nov 2009 16:50
Picon
Favicon

mod_rewrite and setenv

Hello,
 
I have looked a lot in Internet, and found many people complaining about the same problem, with no normal answer.
 
My problem:
mod_rewrite with its RewriteCond %{ENV:variable} form cannot read correctly the environment variables.
 
The variable is set directly in the .htaccess OR in the main httpd.conf. No matter, the variable won't be read. THe logging of the rewrite process will show that the value of %{ENV:variable} will be "".
 
I have found the same problem posted 5 years ago, with no answer, which is awkward (if this is a bug).
 
What I wrote was:
 
SetEnv APPLICATION_ENV development
 
RewriteCond %{ENV:APPLICATION_ENV} ^development$
RewriteRule ^.*$ /XXX/index.php [NC,L]
 
Unfortunately, it doesnt work. Any experience with that? Where should I complain further?

Eric Covener | 1 Nov 2009 17:10
Picon
Gravatar

Re: mod_rewrite and setenv

On Sun, Nov 1, 2009 at 10:50 AM, Andrei Iarus <poni1111 <at> yahoo.com> wrote:
Hello,
 
I have looked a lot in Internet, and found many people complaining about the same problem, with no normal answer.
 
My problem:
mod_rewrite with its RewriteCond %{ENV:variable} form cannot read correctly the environment variables.
 
The variable is set directly in the .htaccess OR in the main httpd.conf. No matter, the variable won't be read. THe logging of the rewrite process will show that the value of %{ENV:variable} will be "".
 
I have found the same problem posted 5 years ago, with no answer, which is awkward (if this is a bug).
 
What I wrote was:
 
SetEnv APPLICATION_ENV development
 
RewriteCond %{ENV:APPLICATION_ENV} ^development$
RewriteRule ^.*$ /XXX/index.php [NC,L]
 
Unfortunately, it doesnt work. Any experience with that? Where should I complain further?


Variables set by SetEnvIf are set earlier than those by SetEnv. Does that resolve your problem?

--
Eric Covener
covener <at> gmail.com
Rich Bowen | 1 Nov 2009 17:17
Favicon
Gravatar

Re: mod_rewrite and setenv


On Nov 1, 2009, at 10:50 , Andrei Iarus wrote:

Hello,
 
I have looked a lot in Internet, and found many people complaining about the same problem, with no normal answer.
 
My problem:
mod_rewrite with its RewriteCond %{ENV:variable} form cannot read correctly the environment variables.
 
The variable is set directly in the .htaccess OR in the main httpd.conf. No matter, the variable won't be read. THe logging of the rewrite process will show that the value of %{ENV:variable} will be "".
 
I have found the same problem posted 5 years ago, with no answer, which is awkward (if this is a bug).
 
What I wrote was:
 
SetEnv APPLICATION_ENV development
 
RewriteCond %{ENV:APPLICATION_ENV} ^development$
RewriteRule ^.*$ /XXX/index.php [NC,L]
 
Unfortunately, it doesnt work. Any experience with that? Where should I complain further?



This is a matter of order of processing. The rewrite directives run earlier than the SetEnv directives. You can set the env var with mod_rewrite:

RewriteRule ^ - [E:APPLICATION_ENV=development]

--
Rich Bowen



Andrei Iarus | 1 Nov 2009 18:14
Picon
Favicon

Re: mod_rewrite and setenv

Thanks very much for the fast responses. Can this info be added in the mod_rewrite documentation, as this is very important for future questions?
 
OR: can the order of processing be changed?

--- On Sun, 11/1/09, Rich Bowen <rbowen <at> rcbowen.com> wrote:

From: Rich Bowen <rbowen <at> rcbowen.com>
Subject: Re: [users <at> httpd] mod_rewrite and setenv
To: users <at> httpd.apache.org
Date: Sunday, November 1, 2009, 7:17 PM


On Nov 1, 2009, at 10:50 , Andrei Iarus wrote:

Hello,
 
I have looked a lot in Internet, and found many people complaining about the same problem, with no normal answer.
 
My problem:
mod_rewrite with its RewriteCond %{ENV:variable} form cannot read correctly the environment variables.
 
The variable is set directly in the .htaccess OR in the main httpd.conf. No matter, the variable won't be read. THe logging of the rewrite process will show that the value of %{ENV:variable} will be "".
 
I have found the same problem posted 5 years ago, with no answer, which is awkward (if this is a bug).
 
What I wrote was:
 
SetEnv APPLICATION_ENV development
 
RewriteCond %{ENV:APPLICATION_ENV} ^development$
RewriteRule ^.*$ /XXX/index.php [NC,L]
 
Unfortunately, it doesnt work. Any experience with that? Where should I complain further?



This is a matter of order of processing. The rewrite directives run earlier than the SetEnv directives. You can set the env var with mod_rewrite:

RewriteRule ^ - [E:APPLICATION_ENV=development]

--
Rich Bowen




André Warnier | 1 Nov 2009 20:36

Re: mod_rewrite and setenv

Andrei Iarus wrote:
> Thanks very much for the fast responses. Can this info be added in the mod_rewrite documentation, as this
is very important for future questions?
>  
It's already there, see :
http://httpd.apache.org/docs/2.2/env.html
Some Caveats

> OR: can the order of processing be changed?
> 
Are you kidding ?

---------------------------------------------------------------------
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 <at> httpd.apache.org
   "   from the digest: users-digest-unsubscribe <at> httpd.apache.org
For additional commands, e-mail: users-help <at> httpd.apache.org

ivan | 1 Nov 2009 21:00
Picon

disable OutputBuffer filtering

Hi,

I want to have a directory with file serving throttled to emulate a slow
connection for site debugging purposes. Is there an obvious solution i haven't
thought about? This is what i managed to come up with so far:

ExtFilterDefine slowdown mode=output cmd=/var/www/slow/slowCat
preservescontentlength
<Location /slow/≥
        SetOutputFilter slowdown
</Location>

The slowCat is a short program (written in haskell) which disables buffering and
pipes data from stdin to stdout, chracter by character, with a tiny sleep after
each character. When i try it in the shell, it works just right.

I would expect the server to send the data piecemeal to the client (and the
client to parse the data node by node, web browsers do that), but what happens
instead is a long delay and then the data arriving in a single burst. My
conclusion is that apache is buffering the data somewhere. What am i doing
wrond, is there any solution to this problem?

Any help much appreciated
Ivan Vadovic

The slowCat appears to work right and looks like this:

import System.Posix
import System.IO
import System.IO.Error

main :: IO ()
main = do hSetBuffering stdout NoBuffering
          hSetBuffering stdin NoBuffering
          try copy
          return ()

copy :: IO ()
copy = getChar >>= putChar >> usleep (10 ^ 4) >> copy

---------------------------------------------------------------------
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 <at> httpd.apache.org
   "   from the digest: users-digest-unsubscribe <at> httpd.apache.org
For additional commands, e-mail: users-help <at> httpd.apache.org

Eric Covener | 1 Nov 2009 21:02
Picon
Gravatar

Re: mod_rewrite and setenv

On Sun, Nov 1, 2009 at 2:36 PM, André Warnier <aw <at> ice-sa.com> wrote:
> Andrei Iarus wrote:
>>
>> Thanks very much for the fast responses. Can this info be added in the
>> mod_rewrite documentation, as this is very important for future questions?
>>
>
> It's already there, see :
> http://httpd.apache.org/docs/2.2/env.html
> Some Caveats

Added similar text to SetEnv today.

--

-- 
Eric Covener
covener <at> gmail.com

---------------------------------------------------------------------
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 <at> httpd.apache.org
   "   from the digest: users-digest-unsubscribe <at> httpd.apache.org
For additional commands, e-mail: users-help <at> httpd.apache.org

sieger007@gmail.com | 2 Nov 2009 02:30
Picon

Apache on F11. ANY APPROACH ?excluding images pdfs etc from Https ( ssl ) routing

Hi Folks

  • I am a squat on advanced Apache work. I would get a basic SSL functionality to work.
So https://foobar.com works fine and gets me all the login windows I designed. however currently all the images and other extensions like .pdf are also using the https routing.
some image referred on that https link
e.g. https://foobar.com/loginhere.jpeg c
can be displayed using https but not http
I would like to JUST limit https usage to the login window html and ALL other images pdf's not secured html ( one that do not need password ) should use HTTP NOT HTTPS
What I cannot really find ( and Apache modules make a graduate course , as I am realizing with all the futile digging in ) is HOW do I tell apache that if you find an image file ( .jpeg or .pdf ) if it comes to https convert all that into http .Has that something to do with rewrite or redirect modules .

  • Another thing is that http : // foobar.login.html should redirect to https : // foobar.login.html
    however http : // foobar.login.html will not show up at all. How do I achieve this .
    Thanks again

Gmane