Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:other-ext-apps:setup [2018/02/27 19:57]
Jackson Zhang [Types of External Application]
litespeed_wiki:other-ext-apps:setup [2018/09/18 19:48] (current)
Michael Alegre [Choose an SAPI]
Line 3: Line 3:
 LiteSpeed Web Server does not handle dynamic content with its own processes. Instead, it sends the requests out to external applications that have been set up to handle different kinds of dynamic content. This allows LSWS to more efficiently handle multiple requests and connections. LiteSpeed Web Server does not handle dynamic content with its own processes. Instead, it sends the requests out to external applications that have been set up to handle different kinds of dynamic content. This allows LSWS to more efficiently handle multiple requests and connections.
  
 +{{ :​litespeed_wiki:​other-ext-apps:​types_of_external_apps.png?​600 |}}
 ===== Go into the WebAdmin console ===== ===== Go into the WebAdmin console =====
  
Line 10: Line 11:
  
 External Application types are differentiated by the service they provide or the protocol they use to communicate with the server. Choose from External Application types are differentiated by the service they provide or the protocol they use to communicate with the server. Choose from
-  * FastCGI: a FastCGI application with a Responder role.+  * FastCGI: a FastCGI application with a Responder role. (Perl)
   * FastCGI Authorizer: a FastCGI application with an Authorizer role   * FastCGI Authorizer: a FastCGI application with an Authorizer role
-  * Servlet Engine: a servlet engine with an AJPv13 connector, such as Tomcat.+  * Servlet Engine: a servlet engine with an AJPv13 connector, such as Tomcat. ​(Java)
   * Web Server: a web server or application server that supports HTTP protocol.   * Web Server: a web server or application server that supports HTTP protocol.
-  * LiteSpeed SAPI App: an application that communicates with the web server using LSAPI protocol.+  * LiteSpeed SAPI App: an application that communicates with the web server using LSAPI protocol. ​(PHP, Ruby, and Python)
   * Load Balancer: a virtual application that can balance load among worker applications.   * Load Balancer: a virtual application that can balance load among worker applications.
   * Piped Logger: an application that can process access log entries received on its STDIN stream.   * Piped Logger: an application that can process access log entries received on its STDIN stream.
Line 21: Line 22:
  
 Tip(s): Tip(s):
-Most applications will use either LSAPI or FastCGI protocol. ​LSAPI supports PHP, Ruby, and Python. Perl can be used with FastCGI. (PHP, Ruby, and Python can also be set up to run using FastCGI, but they run faster using LSAPI.) Java uses servlet engines.+Most applications will use either LSAPI or FastCGI protocol. PHP, Ruby, and Python can also be set up to run using FastCGI, but they run faster using LSAPI.
 ===== Choose an SAPI ===== ===== Choose an SAPI =====
  
  
-The first thing you will set is the interface by which the server communicates with the external application. LiteSpeed Web Server works with a number of protocols — FastCGI, Servlet Engine, HTTP, etc. — but it runs fastest when external applications are built for LiteSpeed Server API (LSAPI). LSAPI has currently been developed for PHP, Ruby, and Python. Perl applications can be run with FastCGI. ​(PHP, Ruby, and Python can also be built for fCGI, though they are faster when used with LSAPI.) ​Java is run using AJPv13 (and you will have to install a separate servlet engine, such as Apache Tomcat, to run the application).+The first thing you will set is the interface by which the server communicates with the external application. LiteSpeed Web Server works with a number of protocols — FastCGI, Servlet Engine, HTTP, etc. — but it runs fastest when external applications are built for LiteSpeed Server API (LSAPI). LSAPI has currently been developed for PHP, Ruby, and Python. Perl applications can be run with FastCGI. Java is run using AJPv13 (and you will have to install a separate servlet engine, such as Apache Tomcat, to run the application).
  
-===== Two types of external applications and the required configurations ​=====+===== External apps can be started by web server or manually ​=====
  
 External applications can be split into two types: Those that are started by the web server and those that have to be started manually. FastCGI and LSAPI applications running on the same machine as the web server can be started by the web server on demand. These applications are called "local external applications"​. Applications that are not started by the web server are referred to as "​remote external applications",​ even when they are running on the same machine. (A servlet engine has to be started manually whether it runs on the same machine or not.) While the server starting external applications itself is more convenient, putting external applications on remote machines can allow for more scalability. This option is explored in the [[litespeed_wiki:​php:​lsapi-command-line-mode|LSPHP Command Line Mode wiki]]. External applications can be split into two types: Those that are started by the web server and those that have to be started manually. FastCGI and LSAPI applications running on the same machine as the web server can be started by the web server on demand. These applications are called "local external applications"​. Applications that are not started by the web server are referred to as "​remote external applications",​ even when they are running on the same machine. (A servlet engine has to be started manually whether it runs on the same machine or not.) While the server starting external applications itself is more convenient, putting external applications on remote machines can allow for more scalability. This option is explored in the [[litespeed_wiki:​php:​lsapi-command-line-mode|LSPHP Command Line Mode wiki]].
  
-After selecting the SAPI to use, you must specify a name, address, and maximum number of connections for the external application. For local external applications,​ you also need to specify the Command, Back Log, Instances, and Environment settings.+After selecting the SAPI to use, you must specify a name, address, and maximum number of connections for the external application. For local external applications,​ you also need to specify the Command, Back Log, Instances, and Environment settings.
  
 +{{ :​litespeed_wiki:​other-ext-apps:​external-app-lsapi-setting-example-lsphp72.png?​800 |}}
 ===== Script and context handlers ===== ===== Script and context handlers =====
  
Line 38: Line 40:
  
 Script handlers differentiate content based on the file's suffix (and the coressponding MIME type). Setting up an external application as a script handler (in the Script Handler tab at either the server or virtual host level) will cause the server to send certain types of files to that external application. Script handlers differentiate content based on the file's suffix (and the coressponding MIME type). Setting up an external application as a script handler (in the Script Handler tab at either the server or virtual host level) will cause the server to send certain types of files to that external application.
 +
 +{{ :​litespeed_wiki:​other-ext-apps:​external-app-lsapi-php-handlers.png?​800 |}}
  
 Context handlers can only be configured at the virtual host level (Configuration > Virtual Hosts > your virtual host > Context). When configured as a context handler, an external application will be used for content based on its location, not its file type. The web server will send content to the external application as long as the request'​s URL matches the URI specified in the context settings. Context handlers can only be configured at the virtual host level (Configuration > Virtual Hosts > your virtual host > Context). When configured as a context handler, an external application will be used for content based on its location, not its file type. The web server will send content to the external application as long as the request'​s URL matches the URI specified in the context settings.
  • Admin
  • Last modified: 2018/02/27 19:57
  • by Jackson Zhang