suExec doesn't work for me

#1
I'm having troubles with setting up the Litespeed and php to run in suExec mode. I want to have php processes run as particular users instead of nobody.

I'm running custom build php with lsapi:
/usr/local/lsws/fcgi-bin/php -i |head
phpinfo()
PHP Version => 5.3.28

System => Linux 3.12.17-grs-ipv6-64 #1 SMP Sun Apr 20 05:36:42 CEST 2014 x86_64
Build Date => Apr 17 2014 12:10:27
Configure Command => './configure' '--with-libdir=lib' '--with-litespeed' '--with-mysqli' '--with-config-file-path=/usr/local/lsws/confphp/' '--with-libxml-dir=/usr' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--with-gd' '--with-mcrypt' '--enable-magic-quotes' '--enable-discard-path' '--enable-sockets' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-zlib' '--with-zlib-dir=/usr' '--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--with-xpm-dir=/usr' '--with-jpeg-dir=/usr/lib/' '--with-png-dir=/usr' '--with-curl=/usr' '--with-mysql' '--enable-mbstring'
Server API => LiteSpeed V6.6
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lsws/confphp/
Loaded Configuration File => /usr/local/lsws/confphp/php.ini
I've tried following settings which were mentioned in tutorials/wiki:
- Configuration -> Server -> PHP suEXEC set to YES
- php configuration in External Tab ->
Autostart: yes
Instances: 1
Run on startup: suExec deamon

- VHOST configuration:
ExtApp Set UID Mode: DocRoot UID
ExtApp Chroot Mode: Virtual Host Root

PHP is spawned as root, childs as nobody:
root 28418 0.0 0.0 123072 7860 ? SN 04:55 0:00 \_ php
nobody 28435 8.7 0.0 135696 13560 ? SN 04:55 0:11 | \_ php
nobody 28465 1.5 0.0 135984 13680 ? SN 04:55 0:02 | \_ php
nobody 28471 0.5 0.0 145684 22180 ? SN 04:55 0:00 | \_ php
nobody 28477 0.0 0.0 128908 7508 ? SN 04:55 0:00 | \_ php
nobody 28483 0.2 0.0 131236 8508 ? SN 04:55 0:00 | \_ php
nobody 28784 0.2 0.0 130816 8224 ? SN 04:56 0:00 | \_ php
nobody 28787 0.2 0.0 140376 20108 ? SN 04:56 0:00 | \_ php
nobody 28791 0.3 0.0 138320 17816 ? SN 04:56 0:00 | \_ php
nobody 28796 0.7 0.0 135740 13324 ? SN 04:56 0:00 | \_ php
Could you please tell me what is wrong with my configuration?
 

NiteWave

Administrator
#2
- Configuration -> Server -> PHP suEXEC set to YES
this is for virtual hosts loaded from apache's httpd.conf
if Configuration -> Server -> Load Apache Configuration set to No, all the settings under "Using Apache Configuration File" is ignored.

>ExtApp Chroot Mode: Virtual Host Root
how about set to "Same as Server" (default value)

and any definition under virtual host's "Script Handler" ?
 
#3
I didn't have any definition under Script Handler. I've added one and also added a new entry under external app where I've set up
suExec Group and suExec User and now php processes are run by the user I've set so I guess it works :)

There is however one little problem, I've over 25 vhosts added right now in the panel, do I have to add new external app/script handler for each of it in order to get it work? Is there any method to configure it like:
- suexec automatically enabled for all vhosts
- suexec username/group for each vhost is automatically set to the owner of docroot
 

mistwang

LiteSpeed Staff
#4
Are you using Apache httpd.conf configuration file to configure the vhost, or using LSWS native configuration through our WebAdmin console?

If you use native configuration, you may look into using vhost template.
 
Top