LiteSpeed Web Server Users' Manual - Context
Description: LiteSpeed Web Server Users' Manual - Context.

## LiteSpeed Web Server
Users' Manual

### Version 6.3 — Rev. 4

- License Enterprise
- Introduction
- Installation
- Administration
- Security
- Configuration
  - Server General
  - Server Log
  - Server Tuning
  - Server Security
  - Page Cache
  - PageSpeed Config
  - External Apps
  - Fast CGI App
  - Fast CGI Authorizer
  - LSAPI App
  - Servlet Engine
  - Web Server
  - Piped logger
  - Load Balancer
  - Script Handler
  - PHP
  - App Server Settings
  - Listener General
  - Listener SSL
  - Virtual Host Templates
  - Virtual Host Basic
  - Virtual Host General
  - Virtual Host Security
  - Virtual Host SSL
  - Virtual Host PageSpeed Config
  - Rewrite
  - Context
  - Static Context
  - Java Web App Context
  - Servlet Context
  - Fast CGI Context
  - LSAPI Context
  - Proxy Context
  - CGI Context
  - Load Balancer Context
  - Redirect Context
  - App Server Context
  - Rack/Rails Context
  - Add-ons
- Web Console
  - Admin Console General
  - Admin Console Security
  - Admin Listener General
  - Admin Listener SSL

# Context

In LiteSpeed Web Server terminology, a "context" is a virtual location, a common parent URL, that identifies a group of resources. Contexts can be thought of as different directories in your website's directory tree. For example, "/" is the root context mapped to the document root of a website. "/cgi-bin/" is a context farther up on the tree, dedicated to the CGI applications for this site. A context can be explicitly defined in LiteSpeed's WebAdmin console for the following purposes:

- To make a file system outside of the document root accessible.
- To block access to certain resources.
- To setup user-level authentication for certain resources.
- To create mount points for external applications.
- To redirect requests to another location.

## Table of Contents

### Context Type⇑

#### Description

The type of context created determines it's usage.:
Static context can be used to map a URI to a directory either outside document root or within it.
Java Web App context is used to automatically import a predefined Java Application in an AJPv13 compilant Java servlet engine.
Servlet context is used to import a specific servlet under a web application.
Fast CGI context is a mount point of Fast CGI application.
LiteSpeed SAPI context can be used to associate a URI with an LSAPI application.
Proxy context enables this virtual host to serve as a transparant reverse proxy server to an external web server or application server.
CGI context can be used to specify a directory only contains CGI scripts.
Load Balancer context can be used to assign a different cluster for that context.
Redirect context can set up an internal or external redirect URI.
App Server context is used for Rack/Rails, WSGI, or Node.js applications.
Rack/Rails context is specifically used for Rack/Rails applications. It is recommended to configure Rack/Rails applications as an App Server context instead.