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

Go Back   LiteSpeed Support Forums > External Applications > Apache Migration/Compatibility > cPanel+Litespeed+Proxied mod_perl

Reply
 
Thread Tools Display Modes
  #1  
Old 09-09-2008, 04:58 PM
sip sip is offline
Member
 
Join Date: Sep 2008
Posts: 20
Default cPanel+Litespeed+Proxied mod_perl

Hello,

I switched to LSWS and found it excellent. Soon another server is going to be switched. Both are primarily php sites.

I have one cPanel server where few of our own sites are running under proxied mod_perl on port82 using mod_proxy of apache. While trying to migrate our own server to LSWS we had issues with those sites.

Is there a How to for this to get working (i can contact DC and tell them to take a look) so that sooner or later i can migrate this server to LSWS with proxied mod_perl Apache.

cPanel default Apache + proxied mod_perl Apache works fine.
Reply With Quote
  #2  
Old 09-09-2008, 06:32 PM
ffeingol ffeingol is offline
Senior Member
 
Join Date: Jul 2007
Location: /dev/null
Posts: 290
Do the proxied mod_perl pages have a common extension?
Reply With Quote
  #3  
Old 09-09-2008, 06:42 PM
sip sip is offline
Member
 
Join Date: Sep 2008
Posts: 20
Alias /perl passes to (using mod_proxy) mod_perl apache running 1.3x httpd and 1.29/1.3 mod_perl
Extension is cgi and url's have query string also

so script.cgi?t=something;sid=;page=xyz.html
or could just be script.cgi (normally on POST)
Reply With Quote
  #4  
Old 09-10-2008, 08:07 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
LiteSpeed can pass certain request to backend Apache running on a different port.

http://www.litespeedtech.com/docs/we...HandledContent

For example, you have Apache run on port 78, in LiteSpeed, "Apache Port Offset" is set to "2", so LiteSpeed will run on port 80, if set "Apache Handled Content" to ".cgi", LiteSpeed will forward all requests with suffix "cgi" to backend Apache.

It probably is different from your current setup, which the second Apache mod_perl instance probably is not managed by cPanel, but a custom Apache setup. LiteSpeed setup have everything controlled by cPanel sharing the same httpd.conf.

Make sure to set SSL port to 441 to make LiteSpeed use port 443.
Reply With Quote
  #5  
Old 09-10-2008, 05:50 PM
sip sip is offline
Member
 
Join Date: Sep 2008
Posts: 20
Yes it's a custom compile and not cPanel's Apache as it's an overkill to run mod_perl from same instance of apache. So this is not possible i guess as of now?
Reply With Quote
  #6  
Old 09-10-2008, 07:58 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
You can use rewrite rule to tell LSWS to proxy request to the target Apache instance.
What you need to do is to define a "Web Server" external application from LSWS web console, with name of "127.0.0.1:82". Then define a rewrite rule like

RewriteRule (.*)\.cgi$ http://127.0.0.1:82/$1 [P]
Reply With Quote
  #7  
Old 02-04-2009, 11:20 PM
sip sip is offline
Member
 
Join Date: Sep 2008
Posts: 20
Hello,

Where exactly the rewrite rule has to be defined in LSWS?
I would want that all requests with

/perl/

are handled by mod_perl apache running on port 82.
The application runs fine from LSWS but i want it to be running through mod_perl apache transparently.
Reply With Quote
  #8  
Old 02-06-2009, 08:58 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
If you use cPanel, the solution is easy.
http://www.litespeedtech.com/docs/we...HandledContent


If you configure LSWS via web console, you can create a proxy context with URI "/perl/" and use the Apache web server external app as the handler.
Reply With Quote
  #9  
Old 02-08-2009, 09:50 PM
sip sip is offline
Member
 
Join Date: Sep 2008
Posts: 20
Hello,

I would want to:

Run LSWS for all content except the one that i want to pass to 127.0.0.1:82 (mod_perl Apache)

The content that i want to pass to 127.0.0.1:82 has url like:

http://somedomain.tld/perl/somdirect...gi?querystring

Alias /perl/ /home/cpanelusername/public_html/cgi-bin/

So basically anything with

/perl
in the URL has to go to mod_perl apache on port 82.

How do i go about this. I did setup the web server with 127.0.0.1:82 and did include the rewrite rule as suggested in earlier post but don't see access being passed to backend. In the admin area of the mod_perl script i still see:

Running under mod_perl: No
and
SERVER_PORT => 80
SERVER_PROTOCOL => HTTP/1.1
SERVER_SOFTWARE => LiteSpeed

So nothing served from 127.0.0.1:82 mod_perl apache.
Wish LSWS had obeyed ProxyPass and ProxyPassReverse.

I would want to use the 127.0.0.82 transparently.
PS: I have confirmed the Enterprise Version of LSWS with DC so this server would be switching to that.

Regards

Last edited by sip; 02-08-2009 at 09:53 PM..
Reply With Quote
  #10  
Old 02-09-2009, 09:58 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
add rewrite rule

RewriteRule /(perl.*)$ http://127.0.0.1:82/$1 [P]

at vhost configuration level.

If you use LiteSpeed with cPanel by reading httpd.conf, I would suggest use "Apache Handled Content" I suggested earlier, especially for shared hosting. For single large web site, you can use the rewrite rule.
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 05:55 AM.



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