PHP suEXEC not working

#1
Hi,

I'm using LSWS native 5.4.7 and I'm not able to configure PHP suEXEC (I'm not using Using Apache Configuration File)

Here's what I have done:

Virtual Host Document Root: $VH_ROOT/html/wordpress/

Configuration => Virtual Host
Basic tab: External App Set UID Mode => Docroot UID
suEXEC User: webuser
suEXEC Group: webuser


External App:
Add new with unique name: lsphp74-himax
Address: uds://tmp/lshttpd/lsphp74-himax.sock
Run As User: webuser
Run As Group: webuser

Script handler:
Suffixes: php / LiteSpeed SAPI / [VHost Level]: lsphp74-himax
Suffixes: php5 / LiteSpeed SAPI / [VHost Level]: lsphp74-himax

sudo chown -R webuser:webuser /usr/local/lsws/HIMAX/html/wordpress
Restart

[root@himaxweb webuser]# ps aux | grep lsphp
root 11446 0.0 0.0 12108 1072 pts/0 R+ 14:06 0:00 grep --color=auto lsphp

[root@himaxweb webuser]# ll /tmp/lshttpd/
total 8
-rw-r--r-- 1 root nobody 6 Apr 23 14:04 lshttpd.pid
drwxr-x--x. 18 nobody nobody 4096 Apr 23 12:14 swap

As seen:
1) /tmp/lshttpd/lsphp74-himax.sock was not created even though webuser has full access to the path (I can create files with the webuser). Also, I tried to change Address to be: Address: uds://home/webuser/lsphp74-himax.sock
2) I enabled DEBUGS and there's no errors, nothing.


Now if I revert
sudo chown -R nobody:nobody /usr/local/lsws/HIMAX/html/wordpress
Restart

Try again to access the website:
2020-04-23 14:10:04.517633 DEBUG [11494] [VHost:_AdminVHost] Enable AIO for Access Logging!
2020-04-23 14:10:04.517664 NOTICE [11494] [Child: 11494] Setup swapping space...
2020-04-23 14:10:04.517690 DEBUG [11494] try to give up super user privilege!
2020-04-23 14:10:04.517700 NOTICE [11494] Successfully change current user to nobody < =====

[root@himaxweb webuser]# ll /tmp/lshttpd/
total 8
srwxr-xr-x 1 nobody nobody 0 Apr 23 14:10 admin_php5.sock
-rw-r--r-- 1 root nobody 6 Apr 23 14:10 lshttpd.pid
srwxr-xr-x 1 nobody nobody 0 Apr 23 14:10 lsphp74-himax.sock <========
drwxr-x--x. 18 nobody nobody 4096 Apr 23 12:14 swap

[root@himaxweb webuser]# ps aux | grep lsphp
nobody 11516 0.0 1.6 357264 31840 ? S 14:10 0:00 lsphp
nobody 11518 7.4 6.1 492768 115292 ? Ss 14:10 0:02 lsphp
nobody 11522 1.6 4.5 469768 85768 ? Ss 14:10 0:00 lsphp
nobody 11526 4.0 5.2 413664 97884 ? Ss 14:10 0:01 lsphp
root 11538 0.0 0.0 12108 980 pts/0 R+ 14:11 0:00 grep --color=auto lsphp

As seen above:
1) .sock is properly created
2) lsphp runs as nobody

Could you please let me know what I'm missing so PHP suEXEC work fine?

Thank you,
Best Regards
 

NiteWave

Administrator
#3
the issue has been resolved.

just made minimal change:
Code:
/usr/local/lsws/HIMAX/html/wordpress>ls -ald
drwxr-x---. 6 nobody nobody 4096 Apr 23 16:43 .
/usr/local/lsws/HIMAX/html/wordpress>chown webuser . ; date
Fri Apr 24 20:02:26 CST 2020
/usr/local/lsws/HIMAX/html/wordpress>ls -ald
drwxr-x---. 6 webuser nobody 4096 Apr 23 16:43 .
then lsphp running as webuser:nobdoy

the original settings looks no problem. not sure above minor change has made it working as expected.

please note:
since litespeed process running as nobody, the document root should allow nobody to access.
if document root with following owner/group/permission:
Code:
/usr/local/lsws/HIMAX/html/wordpress>ls -ald
drwxr-x---. 6 webuser webuser 4096 Apr 23 16:43 .
nobody user can't enter this directory and serve any static/dynamic pages.
 
Top