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

Posted on 2008-11-04
Medium Priority
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
  • 4
  • 2
LVL 27

Expert Comment

ID: 22882155
Interesting. The version 2.2.10 has beed released recently. May be that fixes that error? Did you install the binary version provided by httpd.apache.org? You may also try a binary compiled with Visual C++ 2008: http://apachelounge.dj02.net/?page=22

Author Comment

ID: 22882218
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.

Author Comment

ID: 22882364
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.
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

LVL 27

Expert Comment

ID: 22882437
And if you remove mod_perl from the configuration (just for testing)?

Author Comment

ID: 22916968
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.

Accepted Solution

ServiceLogix earned 0 total points
ID: 23427553
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.

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

840 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