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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Feedback/Feature Requests > [solved] Cloudlinux PHP LSAPI "say no to suexec"

Reply
 
Thread Tools Display Modes
  #11  
Old 09-20-2012, 08:15 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
set
http://www.litespeedtech.com/docs/we...tapps/#extUser
http://www.litespeedtech.com/docs/we...apps/#extGroup
for lsphp external app, it will be the user/group that all PHP running as.
Reply With Quote
  #12  
Old 09-20-2012, 09:52 AM
QuantumNet QuantumNet is offline
Senior Member
 
Join Date: Nov 2007
Posts: 61
I had tried those before posting, also tried the forcegid option... it seems they work when in normal suexec mode, but they get ignored when in "CageFS without suxec" mode.

Interesting thing is they seem hard coded, the web server runs as
user: apache
group: apache

But when running in "CageFS without suxec" mode. The user and group becomes "nobody"

at it cannot be overidden

I tested this with:

<?php
$user = exec('/bin/id');
echo $user;
?>
Reply With Quote
  #13  
Old 09-20-2012, 10:41 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
You need to set both user/group for external app, only set group wont work.
Reply With Quote
  #14  
Old 09-20-2012, 03:30 PM
QuantumNet QuantumNet is offline
Senior Member
 
Join Date: Nov 2007
Posts: 61
Okay this might shed some light on the problem:

here is the output of test.php
uid=498(apache) gid=500(apache) groups=500(apache)


as you can see the "groups" only shows apache, so the suexec daemon is only picking up the primary group

now lets look at the output of command line:
$ id apache
uid=498(apache) gid=500(apache) groups=500(apache),505(secure)


so here is the problem, suexec daemon needs to pick up all groups it belongs to for secure access group to work correctly
Reply With Quote
  #15  
Old 09-20-2012, 04:25 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
LSAPI 6.0 code has been updated to address this.
you need to rebuild PHP with latest php-lsapi-6.0 code.
Make sure to update /etc/group inside the cage.
Reply With Quote
  #16  
Old 09-20-2012, 11:06 PM
QuantumNet QuantumNet is offline
Senior Member
 
Join Date: Nov 2007
Posts: 61
I installed lsapi 6 when I installed lsws 4.2

here is the output when logged into a user inside cagefs:

[root@sr1 ../php-5.3.x]# su - governme
[governme@sr1 ~]$ php -v
PHP 5.3.9 with Suhosin-Patch (cli) (built: Sep 20 2012 03:35:18)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with the ionCube PHP Loader v4.2.1, Copyright (c) 2002-2012, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH


[governme@sr1 ~]$ id apache
uid=498(apache) gid=500(apache) groups=500(apache),505(secure)


here is the output of test.php:
uid=498(apache) gid=500(apache) groups=500(apache)






see the groups still only has the apache group, it does not have the secondary group
Reply With Quote
  #17  
Old 09-22-2012, 12:40 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Quote:
I installed lsapi 6 when I installed lsws 4.2
lsapi 6 has been updated to address this issue, rebuild your PHP with lsapi 6 again.
Reply With Quote
  #18  
Old 09-24-2012, 07:15 PM
QuantumNet QuantumNet is offline
Senior Member
 
Join Date: Nov 2007
Posts: 61
great works flawlessly... this is a revolution in security... makes suphp and standard suexec look like bandaids


thank you guys so much for this, it is a real game changer for the industry
Reply With Quote
  #19  
Old 11-18-2012, 12:02 AM
bettinz bettinz is offline
Member
 
Join Date: May 2011
Posts: 29
Hello,
Can someone post a guide about How to correctly enable cagefs without suexec?

If I already have a lot of sites with owner, How can I do that?
I mean: now I've suexec enabled, user john is the owner of john's website folder. If I enable cagefs without suexec, all the files become unwriteable, because litespeed run with user nobody.

How can I use this feature? Is this feature important about security and performance or can I keep suexec enabled?

Thank you
Reply With Quote
  #20  
Old 11-21-2012, 03:16 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Quote:
Can someone post a guide about How to correctly enable cagefs without suexec?
the answer is at #9 reply in this thread.

Quote:
If I enable cagefs without suexec, all the files become unwriteable, because litespeed run with user nobody.
this is just the purpose of "cagefs without suexec" mode, it's just what some host need. please refer #7 reply in this thread for more detail.

Quote:
can I keep suexec enabled?
yes. there are 4 choices when set
lsws admin console->Server->General->Cloud Linux:
Disabled
LVE
CageFS
CageFS without suEXEC

generally in shared hosting environment, you should always enable php suExec.
and with this special combination:
LSWS 4.2 with PHP suEXEC daemon mode
+ CageFS without suEXEC

you can have php running as noboby for a user who enabled cageFS.
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 03:28 PM.



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