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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > [Solved] Litespeed not running suEXEC/LSAPI

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2012, 04:39 AM
thelunny thelunny is offline
Member
 
Join Date: Feb 2012
Posts: 13
Default [Solved] Litespeed not running suEXEC/LSAPI

Hi guys, I've installed the standard version of the Litespeed Web Server.

Facing some problems with getting php files to run under suEXEC/LSAPI. Is suEXEC and LSAPI the same thing?

I can't seem to get my php files to run under the owner of the file. My Litespeed runs as nobody/nobody. My php script runs under user1/user1.

I created a php file to print out system('whoami') but I'm getting nobody instead of user1. It seems that the script is still running under the web server.

Would appreciate if someone could guide me on how this can be done and what is a proper way to verify php is running in suEXEC/LSAPI?

--

On a side note, does the default Litespeed comes with PHP 4 only? How do I switch to PHP 5? When I do a phpinfo(), it shows version 4.4.9.


Thanks for the help in advance.
Reply With Quote
  #2  
Old 02-08-2012, 05:40 AM
thelunny thelunny is offline
Member
 
Join Date: Feb 2012
Posts: 13
The is the output when I run the script below. PHP is running as nobody and not the script owner.

UID PID PPID C STIME TTY TIME CMD
nobody 3522 3494 0 21:37 ? 00:00:00

-----
lsphp5:/usr/local/lsws/DEFAULT/html/id.php
$pid=getmypid();
echo "getmypid()=" . $pid ."<br>";
echo "<hr><pre>";
system("ps -fp " . $pid);
echo "</pre><hr>";
---------
Reply With Quote
  #3  
Old 02-08-2012, 11:28 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
suEXEC and LSAPI are NOT the same thing. LSAPI +PHP can be used run with suEXEC set to No, Yes, etc.

suEXEC in "Using Apache Configuration File" is for vhost in httpd.conf (Apache). you need something like below in vhost config for PHP suEXEC => Yes to work.
Quote:
SuexecUserGroup user1 group1
For native LSWS vhost, you can set suEXEC user in lsphp5 either at server level or vhost level.

Regarding stock php in LSWS, it is php4 for small footprint which is good enough to get one started. You can compile a newer php version in Compile PHP page (Admin CP => Actions => Compile PHP). More details are at

http://www.litespeedtech.com/support/wiki/doku.php#php ==> PHP 4/5 with LSAPI
Reply With Quote
  #4  
Old 02-08-2012, 05:22 PM
thelunny thelunny is offline
Member
 
Join Date: Feb 2012
Posts: 13
Thanks for the reply.

So how do I run my php scripts under the owner and not the web server? Should it be LSAPI or suEXEC in this case?

I've already set the suEXEC user & group under Ext Application. I've also set the CGI set UID mode to DocRoot UID. But it still doesn't work. Is there anything I left out?

What must the permission of the document root and all files beneath it be?

Appreciate a walk through on how I can enable this from the base installation of Litespeed.

Thanks!
Reply With Quote
  #5  
Old 02-09-2012, 05:27 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
LSAPI + PHP is recommended for its performance and security regardless of suEXEC.

For LSWS native vhost, in Admin CP => Virtual Host
Basic tab: ExtApp Set UID Mode => Docroot UID
External App: create vhost level lsphp5 ext app
Script Handler: suffix php => vhost lsphp5 ext app

chown docroot to userid desired, then restart lsws. PHP (LSPHP) should follow docroot uid.

CGI File UID is for CGI script (slow) not for LSAPI + PHP.
Reply With Quote
  #6  
Old 02-10-2012, 05:30 AM
thelunny thelunny is offline
Member
 
Join Date: Feb 2012
Posts: 13
I managed to got it running. thanks!
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 04:40 PM.



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