Virtual server setup breaks Rewrite Rules

Bug #820936 reported by Thomas Schweikle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Opinion
Low
Marc Cluet

Bug Description

Default setup for Apache2 is with:
<Virtualhost *:80>
   ...
</Virtualhost>

there are web applications within "/etc/apache2/conf.d" any rewrite-rules given there are ignored, because they are outside the scope for the virtual server running on port 80.

Two solutions:
1. Move all Location definitions for the default virtual server to some directory to be included within
<Virtualhost *:80>
   include Location definitions
</Virtualhost>

or

2. remove <Virtualhost *:80> </Virtualhost> entirely for the default server.

It is more than only annoying having various rewrite rules never touched, just because they not located at the right place!

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: apache2 2.2.14-5ubuntu8.4
ProcVersionSignature: Ubuntu 2.6.32-33.71-server 2.6.32.41+drm33.18
Uname: Linux 2.6.32-33-server x86_64
Architecture: amd64
Date: Thu Aug 4 15:38:42 2011
InstallationMedia: Ubuntu-Server 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.2)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: apache2

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Thomas Schweikle (tps) wrote :

Or

3. Change "<Virtualhost *:80>" to "<Virtualhost _default_:80>".

Revision history for this message
Dave Walker (davewalker) wrote :

Thanks for the bug report.

Solution 3 sounds most favourable. Marking confirmed with and low, requires more investigation to confirm it is regression free.

Thanks.

tags: added: server-o-rs
Changed in apache2 (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Marc Cluet (lynxman)
Changed in apache2 (Ubuntu):
assignee: nobody → Marc Cluet (lynxman)
Revision history for this message
Marc Cluet (lynxman) wrote :
Changed in apache2 (Ubuntu):
status: Confirmed → In Progress
Marc Cluet (lynxman)
Changed in apache2 (Ubuntu):
status: In Progress → Fix Released
James Page (james-page)
Changed in apache2 (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
James Page (james-page) wrote :

Switching "<Virtualhost *:80>" to "<Virtualhost _default_:80>" does not make the default site configuration pickup global rewrite rule definitions - see http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#vhosts.

Going with option 2 (removing virtual host definition altogether) really breaks the concept of sites-available and sites-enabled so I don't think we should take that route.

Option 1 might be feasible - however I don't think that including all of the conf.d directory within the VirtualHost definition is correct so it would need a separate 'global rewrites' directory.

We would also need to bear in mind that mod_rewrite is not enabled by default so maybe rewrite configuration should be treated as a customization rather than part of the base installation. Whatever we do we should do it in-conjunction with Debian as changing default behaviour/configuration could break alot of stuff.

Marking as 'Opinion' as merits further discussion.

Changed in apache2 (Ubuntu):
status: In Progress → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.