You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Geoff Coffey <gc...@wmotion.com> on 2002/03/10 04:42:41 UTC

Rewrite Rules and Virtual Hosts

I'm new...

I'm setting up a Rewrite Rule on our (new) apache server and all is working
well. But, per the FAQ, I had to turn on the Rewrite Engine and set the
inherit option for _every_ virtual host.

In my case, I _always_ want the rewriting to apply to _every_ virtual host.
I'm wondering if there is any way I can enable it globally and save the
trouble of fiddling with all the VirtualHost entries (which otherwise are
automatically generated and maintained by a GUI tool).

I don't _think_ the security issue mentioned in the FAQ applies to us
because we control all our virtual hosts. Nobody untrusted has any access at
all. I may be missing the point though.

Thanks,

Geoff


---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Rewrite Rules and Virtual Hosts

Posted by Artiom Morozov <ar...@phreaker.net>.
Geoff,

	Set
RewriteOptions inherit
in the virtual host config, but anyhow, that won't give you much - you 
still need to modify per-host config ;-)

îÁ 2002.03.10 05:42 Geoff Coffey ÎÁÐÉÓÁÌ:
> I'm new...
> 
> I'm setting up a Rewrite Rule on our (new) apache server and all is
> working
> well. But, per the FAQ, I had to turn on the Rewrite Engine and set
> the
> inherit option for _every_ virtual host.
> 
> In my case, I _always_ want the rewriting to apply to _every_ virtual
> host.
> I'm wondering if there is any way I can enable it globally and save
> the
> trouble of fiddling with all the VirtualHost entries (which otherwise
> are
> automatically generated and maintained by a GUI tool).
> 
> I don't _think_ the security issue mentioned in the FAQ applies to us
> because we control all our virtual hosts. Nobody untrusted has any
> access at
> all. I may be missing the point though.
> 
> Thanks,
> 
> Geoff
> 

---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Rewrite Rules and Virtual Hosts

Posted by Geoff Coffey <gc...@wmotion.com>.
> It may seem like I'm nitpicking here (sorry :) ) but the crux of the problem
> is that this is Mac OS X Server, maintained not by me but by folks coming
> from WebStar/ASIP on Mac OS 9. Maintaining httpd.conf files is not a good
> option for them. Apple provides GUI tools to do "typical" things with Apache
> (like virtual hosts and SSL) but there is no support in the gui for rewrite
> rules (probably a good thing!). The VirtualHost entries are in an include
> file generated by the GUI tool automatically, and I'm afraid my changes will
> be blown away the next time the tool regenerates it's include file (which
> states in it that it should not be modified by hand). I'm working with the
> macosx-admin list as well to see if there's a way to customize these entries
> and still let these guys use the gui...

I received a suggestion on the macosx-admin list that I thought I'd run by
you here as well since I don't see any indication that it is "OK". The
httpd.conf file is never modified directly by the GUI tools in Mac OS X
Server. Instead, it simply regenerates a file 'httpd_macosxserver.conf'
which is included by the httpd.conf file. This way, admins _can_ modify
httpd.conf as much as they want.

The suggestion was to simply add <VirtualHost> entries to httpd.conf for
each virtual host. There would then be two <VirtualHost> entries for every
virtual host, instead of just one. Is this legal?

Thanks,

Geoff


---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Rewrite Rules and Virtual Hosts

Posted by Geoff Coffey <gc...@wmotion.com>.
On 3/10/02 10:03 AM, "Bill -Sx- Jones" <sn...@mac.com> wrote:

>> I'm new...
>> 
>> I'm setting up a Rewrite Rule on our (new) apache server and all is working
>> well. But, per the FAQ, I had to turn on the Rewrite Engine and set the
>> inherit option for _every_ virtual host.
>> 
>> In my case, I _always_ want the rewriting to apply to _every_ virtual host.
>> I'm wondering if there is any way I can enable it globally and save the
>> trouble of fiddling with all the VirtualHost entries (which otherwise are
>> automatically generated and maintained by a GUI tool).
>> 
>> I don't _think_ the security issue mentioned in the FAQ applies to us
>> because we control all our virtual hosts. Nobody untrusted has any access at
>> all. I may be missing the point though.
> 
> 
> If the rules are the SAME for each VH - then place the rules in the global
> section OUTSIDE of the VH area.

I did this, but according to the docs I still need to do:

  RewriteEngine on
  RewriteOptions inherit

For every virtual host. Specifically, the faq says (Section H, Question 7):

> Why are RewriteRules in my VirtualHost parts ignored?
> 
> Because you have to enable the engine for every virtual host explicitly due to
> security concerns. Just add a "RewriteEngine on" to your virtual host
> configurationparts.

I'm wondering if there is a way around this.

It may seem like I'm nitpicking here (sorry :) ) but the crux of the problem
is that this is Mac OS X Server, maintained not by me but by folks coming
from WebStar/ASIP on Mac OS 9. Maintaining httpd.conf files is not a good
option for them. Apple provides GUI tools to do "typical" things with Apache
(like virtual hosts and SSL) but there is no support in the gui for rewrite
rules (probably a good thing!). The VirtualHost entries are in an include
file generated by the GUI tool automatically, and I'm afraid my changes will
be blown away the next time the tool regenerates it's include file (which
states in it that it should not be modified by hand). I'm working with the
macosx-admin list as well to see if there's a way to customize these entries
and still let these guys use the gui...

Thanks for your help!

Geoff 


---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Rewrite Rules and Virtual Hosts

Posted by Bill -Sx- Jones <sn...@mac.com>.
On 3/9/02 10:42 PM, "Geoff Coffey" <gc...@wmotion.com> wrote:

> I'm new...
> 
> I'm setting up a Rewrite Rule on our (new) apache server and all is working
> well. But, per the FAQ, I had to turn on the Rewrite Engine and set the
> inherit option for _every_ virtual host.
> 
> In my case, I _always_ want the rewriting to apply to _every_ virtual host.
> I'm wondering if there is any way I can enable it globally and save the
> trouble of fiddling with all the VirtualHost entries (which otherwise are
> automatically generated and maintained by a GUI tool).
> 
> I don't _think_ the security issue mentioned in the FAQ applies to us
> because we control all our virtual hosts. Nobody untrusted has any access at
> all. I may be missing the point though.


If the rules are the SAME for each VH - then place the rules in the global
section OUTSIDE of the VH area.


-Sx-  :]



---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org