Usually, LSPHP(LSAPI + PHP) is managed by LiteSpeed Web Server. In a clustered environment, though, with a single LiteSpeed Web Server or LiteSpeed Web ADC load balancing LSPHP processes running on multiple backend servers, it may be necessary to start LSPHP processes manually. LSPHP is an executable and can be started manually and bound to IPv4, IPv6, or Unix domain socket addresses with the command line option -b socket_address
Examples:
Have LSPHP bind to port 3000 on all IPv4 and IPv6 addresses:
/path/to/lsphp -b [::]:3000
Have LSPHP bind to port 3000 on all IPv4 addresses:
/path/to/lsphp -b *:3000
Have LSPHP bind to address 192.168.0.2:3000 :
/path/to/lsphp -b 192.168.0.2:3000
Have LSPHP accept requests on Unix domain socket “/tmp/lsphp_manual.sock”:
/path/to/lsphp -b /tmp/lsphp_manual.sock
Environment variables (please check here for a list of supported variables) can be added before the LSPHP executable. The `PHP_LSAPI_CHILDREN=nn` is required when run lsphp as a service to handle concurrent requests, `nn` should be, minimum, the concurrent level required by the frontend. It is running PHP in ProcessGroup mode. Note the following are only example figures, and you should adjust it to meet your need.
PHP_LSAPI_MAX_REQUESTS=5000 PHP_LSAPI_CHILDREN=35 /path/to/lsphp -b IP_address:port
WebAdmin Console > Configuration > Server or Virtual Host > External App
Address ⇒ IP_address: port
(in step above)
Start By Server ⇒ No
To load balance backend PHPs, create a “load balancer” external app, use backend PHPs (lsapi external app) as members and have script handler use the “load balancer” instead of php external app via Admin Console
Name: lsphp5_cluster Workers: LSAPI::remote php #1,LSAPI::remote php #2,...,LSAPI::remote php #n
Suffixes: php Handler Type: Load Balancer Handler Name: [Server Level]: lsphp5_cluster
/usr/local/opt
, then /usr/local/opt/lsws/DEFAULT/html
(default lsws vhost docroot) needs to be rsync'd over and placed on remote server as /lsws/DEFAULT/html
./usr/local/lsws/DEFAULT/html
should be rsync'd over as /usr/local/lsws/DEFAULT/html
.