Apache fails to start when more than 3 mod_rewrite rules are used

Posted on 2008-11-04
Last Modified: 2009-01-25
Running Apache 2.2.9 on Windows Server 2003 Web Edition with mod_perl.

I have the below rewrite rules in a virtual host configuration - used for token management for browser cache control.  The behavior is the same whether RewriteOptions inherit is on or off.

We just upgraded a server from 2.2.2 to 2.2.9 (and re-installed mod_perl as well).  The exact same rewrite rules worked fine on 2.2.2.

When three of the four rewrite rules (in any order) are used, Apache starts and works fine.  When the fourth one is added (it can be any one), Apache fails to start either as a service or from the command line - and it does not log an error...

In the Windows Event Log, however, there is the following error:

Faulting application httpd.exe, version, faulting module msvcrt.dll, version 7.0.3790.3959, fault address 0x00037e23.

Any ideas?
RewriteRule ^(.+\.js).*$ $1 [T=application/javascript] 

RewriteRule ^(.+\.xml).*$ $1 [T=text/xml] 

RewriteRule ^(.+\.xsl).*$ $1 [T=text/xml] 

RewriteRule ^(.+\.css).*$ $1 [T=text/css]

Open in new window

Question by:ServiceLogix
    LVL 27

    Expert Comment

    Interesting. The version 2.2.10 has beed released recently. May be that fixes that error? Did you install the binary version provided by You may also try a binary compiled with Visual C++ 2008:
    LVL 2

    Author Comment

    Yes, did the Apache-provided MSI with OpenSSL.

    Also already installed 2.2.10 - same behavior.

    It may be a perl build incompatibility with mod_perl.  Installed 5.8.8 build 824 on the server... a similarly configured server is working on the same codebase, but with build 820.
    LVL 2

    Author Comment

    Well, I uninstalled perl build 824, installed 820, reinstalled mod_perl (which fails under 820), then installed 824 on top of 820.

    Now I can have 4 rewrite rules instead of 3.

    Add a 5th, same behavior.

    This is stupid.
    LVL 27

    Expert Comment

    And if you remove mod_perl from the configuration (just for testing)?
    LVL 2

    Author Comment

    Weirdest thing...

    Tried some stuff out today.

    Here are the exact steps:

    1) I uncommented 5th Rewrite rule (for xls files).
    2) Confirmed Apache fails to start.
    3) Comment out 5th Rewrite rule.
    4) Confirmed Apache starts ok.
    5) Uncomment 5th Rewrite rule
    6) Removed +Parent from PerlOptions.
    7) Apache fails to start
    8) Switched positions of PerlOptions and PerlSwitches
    9) Apache starts ok
    10) Added +Parent back to PerlOptions.
    11) Apache starts ok
    12) Moved Perl directives above Rewrite directives
    13) Apache fails to start.
    14) Undid that - Apache starts ok
    15) Undid all changes (file back to original state) and uncommented 5th rewrite rule
    16) Apache starts ok.

    So, basically, the .conf file was in the state it was in originally where it failed, and now it starts fine.  

    Then I commented out the 5th Rewrite rule and restarted fine.

    I logged out of the terminal session, came back in, uncommented line.  Apache fails to start.  

    Just on a lark, I started again.  Starts fine.

    I am not sure what this is - but it's pretty freaky behavior.

    I have read that mod_perl was built against a newer version of VC++ using a newer version of msvcrt.dll - and that there are problems with the Apache Monitor failing on older versions.  However, I have the appropriate version of that DLL.

    It scares me that Apache/mod_perl is inconsistently unstable like this.
    LVL 2

    Accepted Solution

    Finally, found a configuration that works... after 4 separate Apache installs.

    Apache 2.2.11 with SSL... ActiveState Perl 5.10 and Mod_perl 2 (built for 5.10).

    We had to upgrade our production server, and I was not looking forward to encountering the same problems.  Other than some modules which were binary incompatible with 5.10, everything appears to be reasonable.

    Though I got a few msvcrt.dll errors when initially started, it's been stable for two days without further errors.

    Removing mod_perl was not an option since everything's already coded for it.

    From what I've read, apparently, the Apache folks, ActiveState folks and mod_perl folks were compiling against different versions of msvcrt.dll...

    You'd think that more people would have encoutered this problem.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting ( to http…
    In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now