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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > Apache Rewrite to LiteSpeed Contexts

Reply
 
Thread Tools Display Modes
  #1  
Old 11-04-2006, 08:51 AM
mabonyi mabonyi is offline
Member
 
Join Date: Sep 2006
Posts: 17
Default Apache Rewrite to LiteSpeed Contexts

I am converting an old site which relies heavily on 'pretty URLs' and Apache Rewrite rules. I understand that LiteSpeed can have Static or CGI contexts which use regular expressions. At the VHost level, I already have a lsapi PHP looking at php, html and php3 extensions, but the following Static rule just shows the source file:

Code:
  URI: exp:^/help/sections/([0-9]+)\.html
  Root: $DOC_ROOT/help/showsection.php?section=$1
  Accessible: Yes
I tried using a CGI context as well, but I received this error:

Code:
lscgid: execve(): Permission denied
Obviously it is trying to execute it, but it shouldn't be using lscgid in the first place -- I want it to use lsphp.

Any suggestions?
Reply With Quote
  #2  
Old 11-04-2006, 11:37 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Maybe browser cached the result when you testing different configuration. It should work if URL "/help/showsection.php?section=..." works. Please try clearing your browser cache.
Reply With Quote
  #3  
Old 11-04-2006, 12:57 PM
mabonyi mabonyi is offline
Member
 
Join Date: Sep 2006
Posts: 17
I cleared out the browser cache and tried both Static and CGI contexts. Same result. The php file is executable, overrides are allowed but not for this context, and the VHost has scripts enabled, restrained and symbol links allowed.

As a side note, I don't use the per-directory .htaccess file to create rewrites which achieve this same goal in Apache, because in LiteSpeed, the rewrite becomes a redirect -- the URL changes. But I'm not bothered by that; I would rather use the LiteSpeed method of contexts.

I am using LSWS 2.2.4 Ent.
Reply With Quote
  #4  
Old 11-04-2006, 01:13 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Do not use CGI contexts. Static is fine.
You need to make sure URL "/help/showsection.php?section=..." work properly first.
LiteSpeed's rewrite behave the same as Apache's, will not redirect (change URL in user's brower) unless '[R]' flag is used, PHP_SELF variable may change though, as Apache is not consistent on this.
Reply With Quote
  #5  
Old 11-04-2006, 01:35 PM
mabonyi mabonyi is offline
Member
 
Join Date: Sep 2006
Posts: 17
Ok. Using a Static Context with only these settings:

Code:
URI: exp:^/help/sections/([1-9][0-9]*)\.html$
Root: $DOC_ROOT/help/showsection.php?section=$1
Accessible: Yes
I only ever get the source of showsection.php. When I enter the URL manually, it works and I can see the lsphp instance run in top on the server. Would there be any reason why the VHost script handler doesn't catch the static context?
Reply With Quote
  #6  
Old 11-04-2006, 01:43 PM
mabonyi mabonyi is offline
Member
 
Join Date: Sep 2006
Posts: 17
Here's what the Debug set to HIGH gives:

Code:
2006-11-04 16:40:22.687 [DEBUG] [*:80] New connection from xxx.xxx.xxx.xxx:34571.
2006-11-04 16:40:22.687 [DEBUG] [*:80] 1 connections accepted!
2006-11-04 16:40:22.687 [DEBUG] [xxx.xxx.xxx.xxx:34571-0] HttpIOLink::handleEvents() events=1!
2006-11-04 16:40:22.687 [DEBUG] [xxx.xxx.xxx.xxx:34571-0] HttpConnection::onReadEx(), state: 0!
2006-11-04 16:40:22.687 [DEBUG] [xxx.xxx.xxx.xxx:34571-0] readToHeaderBuf(). 
2006-11-04 16:40:22.687 [DEBUG] [xxx.xxx.xxx.xxx:34571-0] Read from client: 314
2006-11-04 16:40:22.687 [DEBUG] [xxx.xxx.xxx.xxx:34571-0] read 314 bytes to header buffer
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0] processHeader() return 0, header state: 3. 
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0] readToHeaderBuf() return 0. 
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] New request: 
        Method=[GET], URI=[/help/sections/10.html],
        QueryString=[]
        Content Length=0
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] processContextPath() return 0
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] readyCacheData() return 0
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] Written to client: 1603
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] m_pHandler->onWrite() return 0
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] HttpConnection::flush()!
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] HttpConnection::nextRequest()!
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] Non-KeepAlive, CLOSING!
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] processNewReq() return 0. 
2006-11-04 16:40:22.688 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] Shutting down out-bound socket ...
2006-11-04 16:40:23.638 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] HttpIOLink::handleEvents() events=17!
2006-11-04 16:40:23.638 [DEBUG] [xxx.xxx.xxx.xxx:34571-0#www.virtualhost.com] Close socket ...
Reply With Quote
  #7  
Old 11-04-2006, 03:23 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Maybe another non-matching context with higher priority get into the way. Please change the sequence number of this context to a lower number to give it higher priority. Or only define this context under this vhost.
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 11:52 AM.



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