How do I set up LSWS to work with servlet engine to run JSP/cfm etc?

LiteSpeed Web Server supports servlet engines/JSP through AJPv13 protocol. Apache Tomcat is a popular Java Servlet Container to serve JavaServer Pages(.jsp). ColdFusion(.cfm) is a programming language based on Tomcat Servlet Engine. How to setup LSWS to work with servlet engine to servie jsp/cfm? You will need to create a servlet engine external app on LSWS configuration, then configure “.jsp”/“.cfm” script handler with that.

1. Install an AJPv13 compatible Servlet engine.

You can use any servlet engine as long as it is AJPv13 compatible. (Both Tomcat and Jetty support AJPv13 protocol.) The AJPv13 compatible connector of the servlet engine must be enabled. Please refer to the servlet engine's documentation. Use the servlet engine's built-in HTTP server to test the servlet engine.

2. Make the web application files available to web server.

If the servlet engine runs on a different machine, make a local copy of the web application files. Only the specific web application's directory is needed, not the whole “web-apps” directory. You also need to make sure that the WEB-INF/web.xml file along with all static files and JSP files that the web application will need are on the same machine as well. The Java class files under the WEB-INF directory can be removed. Skip this step if the servlet engine runs on the same machine.

3. If the web application is packed in a .war file, expand it.

4. Define the servlet engine in the WebAdmin console.

Under the External App tab at server level or virtual host level, add a servlet engine. Make sure the Address setting matches the AJP setting in the servlet engine.

5. Create a Java Web App context under the Context tab at the virtual host level.

The context URI should match the URI used by the servlet engine. Set the Location to the directory of the web application. Select the servlet engine external application just created.

6. Set a script handler for jsp/cfm files.

Add a script handler in the virtual host-level Script Handler tab. Assign this script handler to the suffix “jsp”/“cfm”. Set the script handler Type to “Servlet Engine” and set the Handler Name to the name of the servlet engine just created.

  • Admin
  • Last modified: 2018/11/01 13:56
  • by Jackson Zhang