[users@httpd] rewrite condition problem

2011-05-10 Thread Stefan Moravcik

Hello list,

I want to do a rewrite rule for all URLs to get rewritten to example.com

This works and can be done with very simple rule:
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^/(.*) http://www.example.com/$1 [R=301,L]


The problem is, when i want to exclude a URI.
So the scenario is to rewrite all TLDs to .com except those with 
/free_trial[1-11]?


The rule should look like follow:
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteCond %{REQUEST_URI} !^/free_trial[1-9]?1?
RewriteRule ^/(.*) http://www.example.com/$1 [R=301,L]


For some reason this doesn't work. The regex is ok, when i delete ! 
not char, everything works as expected. If the domain is not .com and 
the URI is free_trial to freetrial11, it will get rewritten, everything 
else is not. So i used the ! to get the revert result, everything get 
rewritten except free_trial to free_trial11. But with ! in place, 
everything including free_trials pages will get rewritten. It looks like 
REQUEST_URI with ! is ignored completely. Any suggestion how i could 
make this work or any idea, why my rewrite condition doesn't work.


Best Regards,
Stefan

-
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-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] 301 not being cached

2011-05-10 Thread Damon Green
Hi Folks,
I have an issue with mod_cache, it refuses to cache redirects (301) and
insists on cacheing 404 error responses, so really two issues.

I'm using Apache 2.2.17 and the mod_cache/mod_disk_cache from Apache 2.3
which serves stale content from its disk cache when the Tomcat is
unavailable. (patched version from the devs)

Trawling the list archives and docos imply that 404 responses should not be
cached, and that 30x responses should be, but the behaviour I'm seeing is
the opposite of that.

I need 301 redirects to remain working (from the cache) when we disable
Tomcat.

To test this Ive created a rewrite rule in the Apache conf:

RewriteRule ^/damon/(.*)http://www.slashdot.org [R=301,L]

Then cleared the cache, hit a page in /damon/, got redirected, nothing
created in the disk cache.
any 200 or 404 however creates files in the cache.



http://httpd.apache.org/docs/2.2/caching.html

# The response must have a HTTP status code of 200, 203, 300, 301 or 410.

This is largely a function 13.4 in the RFC:

   A response received with a status code of 200, 203, 206, 300, 301 or
   410 MAY be stored by a cache and used in reply to a subsequent
   request, subject to the expiration mechanism, unless a cache-control
   directive prohibits caching. However, a cache that does not support
   the Range and Content-Range headers MUST NOT cache 206 (Partial
   Content) responses.


Any advice or ideas gratefully received.

Regards,
Damon Green.


--


[users@httpd] Larry W Burton is out of the office.

2011-05-10 Thread Larry W Burton

I will be out of the office starting Tue 05/10/2011 and will not return
until Fri 08/12/2011.

I will respond to your message when I return.


NOTICE: This e-mail correspondence is subject to Public Records Law and may be 
disclosed to third parties.


-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] rewrite condition problem

2011-05-10 Thread Stefan Moravcik
Great, thank you very much, it helped. I forgot about drupal's nice URLs 
rewrite rules in .htaccess.

Drupal  has been rewriting ^/free_trial$ to ^/index.php?q=free_trial

so the final working solution is

RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteCond %{REQUEST_URI} !^/free_trial[1-9]?[1]? [OR]
RewriteCond %{REQUEST_URI} ^/index.php$
RewriteCond %{QUERY_STRING} !^q=free_trial[1-9]?[1]?
RewriteRule ^/(.*) http://www.example.com/$1 [R=301,L]

On 10/05/2011 12:52, Eric Covener wrote:

. Any suggestion how i could make this work or any idea,
why my rewrite condition doesn't work.

RewriteLog

-
The official User-To-User support forum of the Apache HTTP Server Project.
SeeURL:http://httpd.apache.org/userslist.html  for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org




-
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-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Larry W Burton is out of the office.

2011-05-10 Thread Carmel
On Tue, 10 May 2011 09:02:02 -0400
Larry W Burton lwbur...@ncat.edu articulated:

 I will be out of the office starting Tue 05/10/2011 and will not
 return until Fri 08/12/2011.
 
 I will respond to your message when I return.

SPRING: Birds chirping, flowers blooming and incorrectly configured auto
responders are spewing their garbage again.

-- 
Carmel ✌
carmel...@hotmail.com

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__

-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Incomplete file downloads if Apache HTTPD is killed

2011-05-10 Thread Matus UHLAR - fantomas
  So that was bad way to simulate apachectl stop just because of the above.
  I think with 2.2 it even is not true, because apache2 has own way to
  configure shutdown timeouts, the GracefulShutdownTimeout directive.

On 09.05.11 16:26, Bostjan Skufca wrote:
 Yes, timeout is configurable, but that was the only lie there:)

well, apache2ctl is here only a scripts that calls apache2 -k ...

  While talking about killed server and knowing that the file was
  transferred - It's often impossible to know. The chunked encoding or the
  Content-Length header are needed to know if the whole file was transfered.
 
 Chunked content encoding does not help here. Also, my experiments with
 few popular browsers has shown that they don't even try to support
 Content-Length correctly. I've been watching HTTP headers and correct
 Content-Length was specified, then I started a download and then
 killed the HTTPD child that served the download request before the
 download was completed. AND browsers did not even complain about
 failed download, they just stopped downloading with message Download
 complete or (if I selected to run the executable) complained about
 downloaded file being corrupt, but not incomplete.
 
 It does not work with gzip and Firefox too, just tried it. Download 
 complete.

 So here is the question again - is there something one can do with
 Apache (or Linux/other OS) that will change browser's behaviour in a
 way that it will report incomplete download to the user?

So it appears there in one, but it was reported that clients ignore it :)
-- 
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Your mouse has moved. Windows NT will now restart for changes to take
to take effect. [OK]

-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Re: What are accept.lock files?

2011-05-10 Thread Jeroen Geilman

On 05/10/2011 07:10 PM, Steven Ross wrote:

Trying one more time. Does anyone know?


On May 7, 2011, at 14:16 , Steven Ross wrote:

I'm running the pre-installed Apache 2 on my Mac OS X 10.5.8 machine. 
The log directory (where it writes error and access logs) is at:

/private/var/log/apache2/

The directory is filled with files like accept.lock.x where x is a 
number between 2 and 5 digits. They are all zero bytes long and date 
back many years.


What are they and can I delete all those empty files?


http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile

--
J.


-
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-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Re: What are accept.lock files?

2011-05-10 Thread Steven Ross


On May 10, 2011, at 10:37 , Jeroen Geilman wrote:


On May 7, 2011, at 14:16 , Steven Ross wrote:

I'm running the pre-installed Apache 2 on my Mac OS X 10.5.8  
machine. The log directory (where it writes error and access logs)  
is at:

/private/var/log/apache2/

The directory is filled with files like accept.lock.x where x is a  
number between 2 and 5 digits. They are all zero bytes long and  
date back many years.


What are they and can I delete all those empty files?



http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile



Thanks. Read it and know about as much as before.

The LockFile directive sets the path to the lockfile used when Apache  
is used with an AcceptMutex value of either fcntl or flock.

??
Can someone please translate that into plain English?
I'm not a seasoned sys admin, just a user running Apache on my desktop  
for web development. The way I read that, it describes a  
directive (a config command?) that is used to create those lock  
files. But it doesn't explain what those lock files are and why they  
are needed in the first place.


I searched the net but couldn't find a good explanation. Would  
appreciate any more hints or links.


Thanks,
Steven

-
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-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Re: What are accept.lock files?

2011-05-10 Thread Steven Ross

On May 10, 2011, at 10:54 , Bennett, Tony wrote:


Simplistically, they are files used by Apache to control
exclusive access to some resources.

Don't delete them.


OK, thanks. Even if they are 5 years old and there are many newer  
ones? They are size 0, but still, I find it weird they would fill up  
that folder seemingly indefinitely.


Does it make a difference if I'm the only user ever using Apache on my  
local machine (for testing websites I'm working on)? I actually  
blocked port 80 in my firewall, so no outsider could ever hit my Apache.


Thanks for your replies!
Steven


-
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-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] mix pre-compressed and mod_deflate

2011-05-10 Thread Adam Schrotenboer
I have a reasonably working mod_rewrite solution for serving
pre-compressed files. But if I enable mod_deflate, it seems to override
my mod_rewrite method.

Basic problem is this:
serving jquery.js with mod_deflate takes 1sec to load, serving it
pre-compressed (and mod_deflate disabled) takes 180msec to load.
With mod_rewrite + mod_deflate enabled, I get the same 1sec to load this
file.

So I want to pre-compress some files, and have the rest be compressed on
the fly. How do I make mod_deflate get out of the way for pre-compressed
files?


-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] flush(STDOUT) + mod_deflate - was: mix pre-compressed and mod_deflate

2011-05-10 Thread Adam Schrotenboer
On 05/10/2011 11:14 AM, Adam Schrotenboer wrote:
 I have a reasonably working mod_rewrite solution for serving
 pre-compressed files. But if I enable mod_deflate, it seems to override
 my mod_rewrite method.

 Basic problem is this:
 serving jquery.js with mod_deflate takes 1sec to load, serving it
 pre-compressed (and mod_deflate disabled) takes 180msec to load.
 With mod_rewrite + mod_deflate enabled, I get the same 1sec to load this
 file.

 So I want to pre-compress some files, and have the rest be compressed on
 the fly. How do I make mod_deflate get out of the way for pre-compressed
 files?

After more playing with it, the high latency under mod_deflate is caused
by the change required to make 'flush' work (setting a low SetOutputBuffer).

I'm _trying_ to make the javascript start being loaded while the CGI
finishes putting together the page. It seems I can have one or the other
(working flush, or fast mod_deflate).

-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] flush(STDOUT) + mod_deflate - was: mix pre-compressed and mod_deflate

2011-05-10 Thread Adam Schrotenboer
On 05/10/2011 02:46 PM, Macks, Aaron wrote:
 Can you have the .js get called from a different VHOST (probably will need a 
 FQ url) and configure the static vhost and the cgi vhost each tuned to 
 the specific purpose



An interesting idea, but that seems that it would require 2 VMs (I tried
putting a SetOutputBuffer in a Directory, but it refuses that context,
so i'm guessing it'll reject a virtualhost as well), and that would
never pass review for deployment.

I'm tempted to try setting this one CGI to no-gzip, as it's not that
much content (most of the content is the javascripts and json files).
just ~30kb.
and I can also try pre-compressing the JSON files.

 A
 --
 Aaron Macks
 Sr. Unix Systems Engineer

 Harvard Business Publishing
 300 North Beacon St.|   Watertown, MA 02472
 (617) 783-7461  |   Fax: (617) 783-7467
 www.harvardbusiness.org |   Cell:(978) 317-3614

 On May 10, 2011, at 5:39 PM, Adam Schrotenboer wrote:

 On 05/10/2011 11:14 AM, Adam Schrotenboer wrote:
 I have a reasonably working mod_rewrite solution for serving
 pre-compressed files. But if I enable mod_deflate, it seems to override
 my mod_rewrite method.

 Basic problem is this:
 serving jquery.js with mod_deflate takes 1sec to load, serving it
 pre-compressed (and mod_deflate disabled) takes 180msec to load.
 With mod_rewrite + mod_deflate enabled, I get the same 1sec to load this
 file.

 So I want to pre-compress some files, and have the rest be compressed on
 the fly. How do I make mod_deflate get out of the way for pre-compressed
 files?

 After more playing with it, the high latency under mod_deflate is caused
 by the change required to make 'flush' work (setting a low SetOutputBuffer).

 I'm _trying_ to make the javascript start being loaded while the CGI
 finishes putting together the page. It seems I can have one or the other
 (working flush, or fast mod_deflate).

 -
 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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org


 -
 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-unsubscr...@httpd.apache.org
   from the digest: users-digest-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org



-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org