You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cloudlinuxos/cloudlinux_os_components/README.md
+37-47Lines changed: 37 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7740,13 +7740,13 @@ This mode is enabled by default and creates a separate lsphp process for each vi
7740
7740
7741
7741
### General information and requirements
7742
7742
7743
-
The nginx-lsapi-module is an extension for the [NGINX](https://www.nginx.com/) web server, designed to seamlessly integrate the lightweight, high-performance [LiteSpeed](https://www.litespeedtech.com/open-source/litespeed-sapi) PHP processing capability directly within the NGINX architecture. This module enables NGINX to efficiently handle PHP requests using the LiteSpeed SAPI, offering an alternative to traditional PHP-FPM or mod_php approaches. It aims to leverage the speed and flexibility of LiteSpeed's PHP processing in environments where the NGINX is the preferred web server.
7743
+
The NGINX LSAPI Module is an extension for the [NGINX](https://www.nginx.com/) web server, designed to seamlessly integrate the lightweight, high-performance [LiteSpeed](https://www.litespeedtech.com/open-source/litespeed-sapi) PHP processing capability directly within the NGINX architecture. This module enables NGINX to efficiently handle PHP requests using the LiteSpeed SAPI, offering an alternative to traditional PHP-FPM or mod_php approaches. It aims to leverage the speed and flexibility of LiteSpeed's PHP processing in environments where the NGINX is the preferred web server.
7744
7744
7745
7745
**How does it work?**
7746
7746
7747
-
1. NGINX passes handling for PHP request to nginx-mod-lsapi;
7748
-
2. nginx-mod-lsapi uses liblsapi to transfer request to the lsphp parent process;
7749
-
3. lsphp forks the child process, which executes the request and returns data to nginx-mod-lsapi;
7747
+
1. NGINX passes handling for PHP request to NGINX LSAPI Module;
7748
+
2. NGINX LSAPI Module uses liblsapi to transfer request to the lsphp parent process;
7749
+
3. lsphp forks the child process, which executes the request and returns data to NGINX LSAPI Module;
7750
7750
7751
7751
* If there are no requests for lsapi_pgrp_max_idle seconds, lsphp parent process will be terminated;
7752
7752
* If there are no lsphp child processes available when a new request comes, the new lsphp child process will be created;
@@ -7755,9 +7755,13 @@ The nginx-lsapi-module is an extension for the [NGINX](https://www.nginx.com/) w
7755
7755
7756
7756
**What is lsphp?**
7757
7757
7758
-
lsphp - PHP + LSAPI. What is PHP LSAPI? [LiteSpeed Server Application Programming Interface](https://www.litespeedtech.com/open-source/litespeed-sapi/php) (LSAPI) is designed specifically for seamless, optimized communication between the LiteSpeed Web Server and third-party web applications. With nginx-mod-lsapi, this protocol is now available for NGINX.
7758
+
lsphp - PHP + LSAPI. What is PHP LSAPI? [LiteSpeed Server Application Programming Interface](https://www.litespeedtech.com/open-source/litespeed-sapi/php)
7759
+
(LSAPI) is designed specifically for seamless, optimized communication between the LiteSpeed Web Server and third-party web applications.
7760
+
With NGINX LSAPI Module, this protocol is now available for NGINX.
7759
7761
7760
-
Using nginx-mod-lsapi, we have seen the higher performance than NGINX with fastcgi+php-fpm, easier installation than php-fpm and easier integration with any control panel. nginx-mod-lsapi means faster and more stable dynamic web pages.
7762
+
Using NGINX LSAPI Module, we have seen higher performance than NGINX with fastcgi+php-fpm,
7763
+
easier installation than php-fpm and easier integration with any control panel.
7764
+
NGINX LSAPI Module means faster and more stable dynamic web pages.
7761
7765
7762
7766
**Optional requirements**
7763
7767
@@ -7768,24 +7772,24 @@ Using nginx-mod-lsapi, we have seen the higher performance than NGINX with fastc
7768
7772
7769
7773
### Installation
7770
7774
7771
-
nginx-mod-lsapi can be installed through YUM package manager, however, the installation process varies depending on the control panel.
7775
+
NGINX LSAPI Module can be installed through YUM package manager. However, the installation process varies depending on the control panel.
In order to get nginx-mod-lsapi to work properly, you'll need to configure NGINX. To do this, we use a separate _lsapi.conf_ file.
7857
+
:::tip Note
7858
+
If using Apache2Nginx, no configuration is required for NGINX LSAPI Module. The module is automatically configured to process PHP requests.
7859
+
:::
7860
+
7861
+
In order to get NGINX LSAPI Module to work properly, you'll need to configure NGINX. To do this, we use a separate _lsapi.conf_ file.
7871
7862
7872
7863
First of all, you need to make sure that the appropriate LSAPI module configuration exists and contains the correct content.
7873
7864
<div class="notranslate">
@@ -7899,15 +7890,15 @@ lsapi_enabled on;
7899
7890
The lsapi_enabled parameter is supported in global, server, and local configurations. Therefore, it can be enabled/disabled globally, only for the server, and also only for a specific location.
7900
7891
7901
7892
7902
-
The LSPHP handler can be enabled using the lsapi_handler directive. The lsapi_handler directive tells NGINX that the files with .php extension should be handled by nginx-mod-lsapi with the selected handler.
7893
+
The LSPHP handler can be enabled using the lsapi_handler directive. The lsapi_handler directive tells NGINX that the files with .php extension should be handled by NGINX LSAPI Module with the selected handler.
7903
7894
<div class="notranslate">
7904
7895
7905
7896
```
7906
7897
lsapi_handler application/x-httpd-lsphp;
7907
7898
```
7908
7899
</div>
7909
7900
7910
-
If no handler is explicitly set for a request, the specified content type will be used as the handler name, therefore, please disable php.conf or any other PHP handler for using nginx-mod-lsapi. In this example application/x-httpd-lsphp is a default handler by which nginx-mod-lsapi processes requests with the lsphp binary from _/usr/local/bin/_ directory.
7901
+
If no handler is explicitly set for a request, the specified content type will be used as the handler name, therefore, please disable php.conf or any other PHP handler for using NGINX LSAPI Module. In this example application/x-httpd-lsphp is a default handler by which NGINX LSAPI Module processes requests with the lsphp binary from _/usr/local/bin/_ directory.
7911
7902
7912
7903
The final lsapi.conf configuration might look like this:
7913
7904
<div class="notranslate">
@@ -7932,15 +7923,15 @@ server {
7932
7923
```
7933
7924
</div>
7934
7925
7935
-
In order for nginx-mod-lsapi to work lsapi.conf should be loaded to NGINX through [Include](https://nginx.org/en/docs/ngx_core_module.html#include) directive.
7926
+
In order for NGINX LSAPI Module to work lsapi.conf should be loaded to NGINX through [Include](https://nginx.org/en/docs/ngx_core_module.html#include) directive.
7936
7927
7937
7928
For a more detailed description of the module directives please visit the [Configuration reference](./#configuration-references-2).
7938
-
For the installation guide for nginx-mod-lsapi please visit [Installation](./#installation-3).
7929
+
For the installation guide for NGINX LSAPI Module please visit [Installation](./#installation-3).
nginx-mod-lsapi errors will be located in error_log and sulsphp_log.
8715
+
NGINX LSAPI Module errors will be located in error_log and sulsphp_log.
8725
8716
Note that errors can appear in both logs at the same time, and you might need to refer to both of them to solve the issue.
8726
8717
8727
8718
See the following table for more details:
@@ -8747,7 +8738,7 @@ See the following table for more details:
8747
8738
8748
8739
CRIU is <span class="notranslate"> _Checkpoint/Restore In Userspace_ </span> , (pronounced <span class="notranslate"> kree-oo </span> ), is a software tool for the Linux operating system. Using this tool, you can freeze a running application (or part of it) and checkpoint it as a collection of files on disk. You can then use the files to restore the application and run it exactly as it was at the time of freeze (more information on the link [https://criu.org/Main_Page](https://criu.org/Main_Page) ).
8749
8740
8750
-
nginx-mod-lsapi now supports the following parameters:
8741
+
NGINX LSAPI Module now supports the following parameters:
8751
8742
8752
8743
| | | | |
8753
8744
|-|--|--|-|
@@ -8771,7 +8762,7 @@ lsapi_criu_debug off;
8771
8762
```
8772
8763
</div>
8773
8764
8774
-
When NGINX module nginx-mod-lsapi detects CRIU enabled (lsapi_criu On), it prepares a directory for images (on the first request of virtualhost) to store ( <span class="notranslate"> lsapi_criu_img_path /var/ngx_lsapi/criu/[dir_name] </span> ), and starts the lsphp process. Lsphp increases a counter ( <span class="notranslate"> lsapi_criu_use_shm off|Signals </span> ) via shared memory or signals, and when counter reaches the limit ( <span class="notranslate"> lsapi_backend_initial_start 15 </span> ), lsphp sends the freezing request to CRIU.
8765
+
When NGINX module NGINX LSAPI Module detects CRIU enabled (lsapi_criu On), it prepares a directory for images (on the first request of virtualhost) to store ( <span class="notranslate"> lsapi_criu_img_path /var/ngx_lsapi/criu/[dir_name] </span> ), and starts the lsphp process. Lsphp increases a counter ( <span class="notranslate"> lsapi_criu_use_shm off|Signals </span> ) via shared memory or signals, and when counter reaches the limit ( <span class="notranslate"> lsapi_backend_initial_start 15 </span> ), lsphp sends the freezing request to CRIU.
8775
8766
The CRIU service makes images of requested processes. Lsphp will not be frozen if counter does not reach the limit. The next time when lsphp will be stopped, it will be unfrozen from the images.
8776
8767
8777
8768
The images of the processes will be saved even if NGINX is restarted. However, all images will be deleted after a server restart by default. This can be modified by setting the new path <span class="notranslate"> lsapi_criu_imgs_path </span> .
@@ -8837,7 +8828,7 @@ systemctl daemon-reload
8837
8828
8838
8829
#### CRIU Installation
8839
8830
8840
-
CRIU is installed as a dependency to the nginx-mod-lsapi package. To activate it:
8831
+
CRIU is installed as a dependency to the NGINX LSAPI Module package. To activate it:
8841
8832
8842
8833
1. Enable service and start it:
8843
8834
@@ -8890,7 +8881,7 @@ Note that this option works only if <span class="notranslate">lsapi_terminate_ba
8890
8881
8891
8882
3. Global reset flag for cleaning all earlier saved images by CRIU.
8892
8883
8893
-
Current nginx-mod-lsapi allows cleaning all images only with one flag file.
8884
+
The current NGINX LSAPI Module allows cleaning all images only with one flag file.
8894
8885
8895
8886
Create <span class="notranslate"> /usr/share/criu/mod_lsapi/lsphp.criu.reset </span> file. Also don't forget to set permissions as follows: <span class="notranslate"> [nobody:nobody] </span> (or <span class="notranslate"> [nginx:nginx] </span> for non cPanel) and access mode [700] to the <span class="notranslate"> /usr/share/criu/mod_lsapi </span> directory.
8896
8887
@@ -8927,7 +8918,7 @@ This mode is enabled by default and creates a separate lsphp process for each vi
8927
8918
8928
8919
<span class="notranslate">`mod_lsapi_reset_me[server_name]`</span> flag will not work for a user when lsapi_per_user option is <span class="notranslate">`on`</span>.
8929
8920
8930
-
5. There is an (default <span class="notranslate">`off`</span>) option in nginx-mod-lsapi that creates only one lsphp process for a user, regardless of the number of his virtual hosts. We don't recommend to use this option with CRIU, but if you use it, make sure that your virtual hosts (under the same user) have the same environment configurations. If they are not the same, this may cause undesirable lsphp process operations.
8921
+
5. There is an (default <span class="notranslate">`off`</span>) option in NGINX LSAPI Module that creates only one lsphp process for a user, regardless of the number of his virtual hosts. We don't recommend to use this option with CRIU, but if you use it, make sure that your virtual hosts (under the same user) have the same environment configurations. If they are not the same, this may cause undesirable lsphp process operations.
8931
8922
8932
8923
8933
8924
@@ -10255,4 +10246,3 @@ This module is integrated into Apache for DirectAdmin control panel by default.
10255
10246
This module is integrated into httpd Apache rpm provided by Cloudlinux OS by default.
10256
10247
10257
10248
If you are using an alternative Apache - [httpd24](https://www.cloudlinux.com/cloudlinux-os-blog/entry/httpd24-updated-for-cloudlinux-6), nothing has to be done as this module is also integrated into httpd24-httpd Apache rpm provided by Cloudlinux by default.
0 commit comments