LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Apache Migration/Compatibility (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=24)
-   -   nested ErrorDocuments not working (http://www.litespeedtech.com/support/forum/showthread.php?t=1051)

aww 05-15-2007 11:15 AM

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.

mistwang 05-15-2007 12:17 PM

It works fine in lab environment, maybe it is caused by something else.

aww 05-15-2007 08:51 PM

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

aww 05-15-2007 09:09 PM

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

mistwang 05-15-2007 09:50 PM

Quote:

Originally Posted by aww (Post 5050)
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.

mistwang 05-15-2007 09:53 PM

Quote:

Originally Posted by aww (Post 5051)
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.

aww 05-15-2007 09:58 PM

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.

aww 05-16-2007 12:36 AM

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


aww 05-16-2007 03:26 AM

LiteSpeed supports the QSA option on rewrites, correct?

mistwang 05-16-2007 08:13 AM

Quote:

Originally Posted by aww (Post 5057)
LiteSpeed supports the QSA option on rewrites, correct?

yes, it is implemented.


All times are GMT -7. The time now is 01:06 AM.