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

Go Back   LiteSpeed Support Forums > External Applications > Apache Migration/Compatibility > [closed] Litespeed 4.0.18 + PHP FastCGI + Suexec issues

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2011, 01:51 AM
valentin valentin is offline
New Member
 
Join Date: Jan 2011
Posts: 3
Default [closed] Litespeed 4.0.18 + PHP FastCGI + Suexec issues

Hi to all forum members.

Let's start with the requirements first:

>> a. OS Version (Linux/FreeBSD/Solaris, distribution, kernel, 32bit/64bit)

CentOS 5.5 - 32bit

>> b. Hardware configurations: CPU speed, RAM size, etc

Unrelated

>> c. LiteSpeed version (also standard or enterprise)

LiteSpeed/4.0.18 Enterprise
- Using Apache Configuration File -> YES
- PHP suEXEC -> YES
- PHP script handler set to -> FastCGI with custom build PHP

>> Licensing

Trial Key

>> PHP information (PHPinfo page is preferred), run in suEXEC mode or not?

Applies to all of the following:

PHP 4.4.9 - fcgi
PHP 5.0.5 - fcgi
PHP 5.1.6 - fcgi
PHP 5.2.17 - fcgi
PHP 5.3.5 - fcgi

Suexec --> Yes but it is not working

>> e. Hosting control panel if used, including version number

cPanel

>> Detailed Description of the problem

We have been evaluating litespeedhttpd product with a _trail_ license and we found an issue we have been struggling on for 2 days now. We will greatly
appreciate your thoughts on it.

When the PHP extensions are set to be processed by the LSAPI App each
PHP process is executed with the owner of the docroot folder which is
exactly what we expect. This clones the "suexec" like behavior in apache.

However when we switch PHP extensions to be processed by the FastCGI
handler all PHP processes are executed with the user under which
litespeed is running on (nobody in our case).

We did a lot of research and all articles we read says that
fastcgi processed php scripts CAN be executed in "suexec" like mode. We tried all possible configurations. None of these helped.

When we strace/ltrace the litespeed processes it seems that when we are using fastcgi the fastcgi configured php is never executed via lscgid (the
daemon which handles the suexec like behavior in this product we
suppose). However when we switch to lsapi phps we can see that the
requests are passed to lscgid first and handled by the phps itself after
the lscgid setuid to the owner of the docroot folder.

We turned on the debug mode of the litespeed web server. Below you can
find the output from the processing a sample PHP script via lsapi php:

2011-01-18 02:02:36.560 [DEBUG] [HTAccess] Updating configuration file
[/home/support/public_html/.htaccess]
2011-01-18 02:02:36.561 [DEBUG]
[xxx.xxx.xxx.xxx:44669-0#APVH_support.com] [REWRITE] Rewrite engine is
not enabled for context '/'
2011-01-18 02:02:36.561 [DEBUG]

Note the suphp5 mentioned on this line here:

[xxx.xxx.xxx.xxx:44669-0#APVH_support.com] Find handler
[APVH_support_Suphp5:] for [.php5]

All lines below are also showing that the process is handled in a suexec
like mode what we want and works fine with the lsapi

2011-01-18 02:02:36.561 [DEBUG]
[xxx.xxx.xxx.xxx:44669-0#APVH_support.com] processContextPath() return 0
2011-01-18 02:02:36.561 [DEBUG]
[xxx.xxx.xxx.xxx:44669-0#APVH_support.com] run lsapi processor.
2011-01-18 02:02:36.561 [DEBUG]
[uds://tmp/lshttpd/APVH_support.com_Suphp5.sock] create new connection
succeed!
2011-01-18 02:02:36.561 [DEBUG]
[uds://tmp/lshttpd/APVH_support.com_Suphp5.sock] request
[xxx.xxx.xxx.xxx:44669-0#APVH_support.com:lsapi] is assigned with
connection!
2011-01-18 02:02:36.561 [DEBUG]
[xxx.xxx.xxx.xxx:44669-0#APVH_support.com:lsapi] [ExtConn] reconnect()

All lines below shows suphp sockets (handled by lscgid we suppose)

2011-01-18 02:02:36.561 [INFO] Start listen socket
[/tmp/lshttpd/APVH_support.com_Suphp5.sock].
2011-01-18 02:02:36.561 [INFO] [APVH_support_Suphp5:] pid list size: 1
2011-01-18 02:02:36.561 [INFO] [APVH_support_Suphp5:] add child process
pid: 5075
2011-01-18 02:02:36.561 [DEBUG]
[xxx.xxx.xxx.xxx:44669-0#APVH_support.com:lsapi] [ExtConn] connecting to
[uds://tmp/lshttpd/APVH_support.com_Suphp5.sock]...

However when we switch the php extensions to be processed via fastcgi
here is what it happens:

2011-01-18 02:15:26.204 [DEBUG] [HTAccess] Updating configuration file
[/home/support/public_html/.htaccess]
2011-01-18 02:15:26.204 [DEBUG]
[xxx.xxx.xxx.xxx:48382-0#APVH_support.com] [REWRITE] Rewrite engine is
not enabled for context '/'
2011-01-18 02:15:26.204 [DEBUG]
[xxx.xxx.xxx.xxx:48382-0#APVH_support.com] Find handler [1H FCGI PHP52]
for [.php]
2011-01-18 02:15:26.204 [DEBUG]
[xxx.xxx.xxx.xxx:48382-0#APVH_support.com] processContextPath() return 0
2011-01-18 02:15:26.204 [DEBUG]
[xxx.xxx.xxx.xxx:48382-0#APVH_support.com] run fcgi processor.

As you can see above none of the lines are showing "sexec" like behavior
for the php fastcgi processed scripts. Nothing here shows suphp/suexec like behavior which is observed when we running the phps via the lsapi.

We were wondering is this some kind of limitation imposed by the trial
license key we are using, something like a bug in the litespeedhttpd product or just a misconfiguration on our end.

The litespeed web server is configured to parse apache server
configuration file.

Thank you in advance for your help.

vaLentin

Last edited by NiteWave; 01-20-2011 at 05:07 PM.. Reason: Title fixed
Reply With Quote
  #2  
Old 01-18-2011, 03:12 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
For External Application type, you should choose LSAPI App instead of Fast CGI. There is no issue with trial key. You get full functions in the trial period.
Reply With Quote
  #3  
Old 01-18-2011, 03:21 AM
valentin valentin is offline
New Member
 
Join Date: Jan 2011
Posts: 3
Quote:
Originally Posted by webizen View Post
For External Application type, you should choose LSAPI App instead of Fast CGI. There is no issue with trial key. You get full functions in the trial period.
But the PHPs we are trying to use are compiled with fastcgi support. They do not have lsapi support build in.

Can't we just use PHP with fast CGI without heaving to build them with lsapi?

As far as I can understand from your reply it seems that PHPs with fast-cgi can not be used with suexec or I am getting it wrong?

Valentin
Reply With Quote
  #4  
Old 01-18-2011, 09:47 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
Your understanding is correct: LSWS does not support suEXEC with Fast CGI when httpd.conf is used (like in your case). LSAPI is required.
Reply With Quote
  #5  
Old 01-18-2011, 11:23 PM
valentin valentin is offline
New Member
 
Join Date: Jan 2011
Posts: 3
Quote:
Originally Posted by webizen View Post
Your understanding is correct: LSWS does not support suEXEC with Fast CGI when httpd.conf is used (like in your case). LSAPI is required.
Thank you very much for the clarification and assistance in this matter. That makes sense.

It would be good if you mention that somewhere at the documentation pages.

Best wishes,

vaLentin
Reply With Quote
  #6  
Old 01-19-2011, 09:28 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
LSAPI works in a similar way as FCGI, and it is much better than FCGI in every respect. No point to use FCGI PHP with LiteSpeed.
Reply With Quote
  #7  
Old 03-31-2013, 02:33 AM
waski waski is offline
Member
 
Join Date: Jan 2013
Posts: 19
Quote:
Originally Posted by webizen View Post
LSWS does not support suEXEC with Fast CGI when httpd.conf is used (like in your case). LSAPI is required.
Is this still true in 2013?
Before you ask why not use LSAPI - because it wont support suexec over tcp (remote server).
Reply With Quote
Reply

Tags
litespeed fastcgi suexec

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 07:36 PM.



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