LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Apache Migration/Compatibility > nested ErrorDocuments not working

Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2007, 11:15 AM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
Default nested ErrorDocuments not working

I just realized that nested ErrorDocuments are not working in my older 3.1.1 copy (I will have to wait until a lighter load overnight to upgrade to the 3.1.1 final release but this might be wrong in both)

ie.

/public_html/missing-example.html can have one errordocument in htaccess

/public_html/images/missing-image.jpg could be a lower level .htaccess in images overriding the one above it

Works perfectly in apache. Not in LiteSpeed. LiteSpeed shows the top ErrorDocument. Actually, possibly the LAST errordocument for that error code it processed.

ie.
/.htaccess
/images/.htaccess
/blog/.htaccess

The errordocument for 404 in /blog/ will be shown if a 404 occurs in /images/ or /

At least in my working server. You might want to test this on 3.1.1 production, otherwise I will also test it on the latest tonight.

Last edited by aww; 05-15-2007 at 11:35 AM..
Reply With Quote
  #2  
Old 05-15-2007, 12:17 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
It works fine in lab environment, maybe it is caused by something else.
Reply With Quote
  #3  
Old 05-15-2007, 08:51 PM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
Well I am experiencing ErrorDocument issues.

1. Upgraded to 3.1.1 final release

2. Created a brand new fresh account under cpanel called "demosite"

3. made a test document index.html

4. http://ipaddress/~demosite/index.html
works as expected

5. http://ipaddress/~demosite/blahblahblah
gives proper litespeed generic 404 page

6. create and upload .htaccess with single line:
ErrorDocument 404 "missing

7. http://ipaddress/~demosite/blahblahblah
server thinks about it for a few seconds and then times out with a blank page - view source shows it's blank


note this step on apache with same httpd.conf & .htaccess produces proper "missing" message

Last edited by aww; 05-15-2007 at 09:07 PM..
Reply With Quote
  #4  
Old 05-15-2007, 09:09 PM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
I've traced the additional nested htaccess errordocument issues to litespeed being overly aggressive on rewrite issues in the topmost .htaccess

however the issue is so complex that I am having difficultly producing a simple example - will have to work on it - note that the issues do not exist when apache is running, it interprets the nested rules perfectly
Reply With Quote
  #5  
Old 05-15-2007, 09:50 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Quote:
Originally Posted by aww View Post
Well I am experiencing ErrorDocument issues.
7. http://ipaddress/~demosite/blahblahblah
server thinks about it for a few seconds and then times out with a blank page - view source shows it's blank


note this step on apache with same httpd.conf & .htaccess produces proper "missing" message
Can you turn on the debug logging by set "DEBUG Level" to "HIGH", then reproduce it. Please post the related log entries by greping your IP.
Reply With Quote
  #6  
Old 05-15-2007, 09:53 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Quote:
Originally Posted by aww View Post
I've traced the additional nested htaccess errordocument issues to litespeed being overly aggressive on rewrite issues in the topmost .htaccess

however the issue is so complex that I am having difficultly producing a simple example - will have to work on it - note that the issues do not exist when apache is running, it interprets the nested rules perfectly
You can try turning on rewrite log by adding Apache directive "RewriteLogLevel 9" to the section of this vhost in your Apache httpd.conf. Send me the rewrite log and tell me which rewrite rule has been over processed along with the rewrite rules in your .htaccess files.
Reply With Quote
  #7  
Old 05-15-2007, 09:58 PM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
Okay here's the problem in how apache processes a certain rule differently than litespeed - it might be difficult for you to setup a test environment, though maybe you can do a quick wordpress install

/~demosite has a blog installed in /~demosite/blog/

To keep all the htaccess rules in the top-most directory, this is perfectly acceptable in apache

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog
RewriteCond %{REQUEST_FILENAME} ^/home/demosite/public_html/blog/.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

However litespeed does not like this.
For litespeed, these rules MUST be in .htaccess in /blog/ not /

I have no idea why. But again, works in apache, not in litespeed

This is what was messing up all the 404 error documents (except for the 404 "missing" which still does not work)

Last but not least there is also a very minor issue in how litespeed treats:

/~demosite/images/ as a 404 missing error, when it should be a 403 forbidden error because of -Indexes in a top-most .htaccess (or httpd.conf) This is trivial however compared to the other issue.
Reply With Quote
  #8  
Old 05-16-2007, 12:36 AM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
Per your debug log request for the blank 404 "missing"

Code:
2007-05-16 03:43:18.772 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] New request: 
	Method=[GET], URI=[/~demosite/fdgksdjfgsdfh5554],
	QueryString=[]
	Content Length=0
2007-05-16 03:43:18.772 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] Find context with URI: [/], location: [/usr/local/apache/htdocs/]
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] redirect to: 
	URI=[/fdgksdjfgsdfh5554],
	QueryString=[]
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] Find context with URI: [/], location: [/home/demosite/public_html/]
2007-05-16 03:43:18.773 [DEBUG] [HTAccess] Updating configuration file [/home/demosite/public_html/.htaccess]
2007-05-16 03:43:18.773 [INFO] [HTAccess] Updating configuration from [/home/demosite/public_html/.htaccess]
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] Find .htaccess context with URI: [/], location: [/home/demosite/public_html/]
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] File not found [/home/demosite/public_html/fdgksdjfgsdfh5554] 
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] processContextPath() return 25
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] processNewReq() return 25. 
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] HttpConnection::sendHttpError(),code=404 Not Found
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] HttpConnection::flush()!
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] Written to client: 1373
2007-05-16 03:43:18.773 [DEBUG] [123.123.123.123:63893-0#APVH_server.example.net] HttpConnection::nextRequest()!
2007-05-16 03:43:22.111 [DEBUG] Failed to execute 'mpstat' command: No such file or directory 
2007-05-16 03:43:23.772 [DEBUG] [123.123.123.123:63893-1] Keep-alive timeout, close!
2007-05-16 03:43:23.772 [DEBUG] [123.123.123.123:63893-1] Close socket ...
2007-05-16 03:43:27.117 [DEBUG] Failed to execute 'mpstat' command: No such file or directory 
2007-05-16 03:43:32.120 [DEBUG] Failed to execute 'mpstat' command: No such file or directory

Last edited by aww; 05-16-2007 at 12:50 AM..
Reply With Quote
  #9  
Old 05-16-2007, 03:26 AM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
LiteSpeed supports the QSA option on rewrites, correct?
Reply With Quote
  #10  
Old 05-16-2007, 08:13 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Quote:
Originally Posted by aww View Post
LiteSpeed supports the QSA option on rewrites, correct?
yes, it is implemented.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:26 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.