### LiteSpeed Web Server Users' Manual

##### Version 5.0 Rev. 1

- License Std / Ent
- Introduction
- Installation
- Administration
  - Service Manager
- Security
- Configuration
  - Server General
  - Server Tuning
  - Server Security
  - Request Filter
  - Page Cache
  - External Apps
  - Fast CGI App
  - Fast CGI Authorizer
  - LSAPI App
  - Servlet Engine
  - Web Server
  - Pipped logger
  - Load Balancer
  - Script Handler
  - Rack/Rails Settings
  - Listeners
  - Templates
  - Virtual Host Basic
  - Virtual Host General
  - Virtual Host Security
  - Rewrite
  - Context
  - Static Context
  - Java Web App Context
  - Servlet Context
  - Fast CGI Context
  - LSAPI Context
  - Proxy Context
  - CGI Context
  - Load Balancer Context
  - Redirect Context
  - Rack/Rails Context
  - Web Socket Proxy
  - Add-ons
  - Admin Server
  - Admin Listeners

# Installation/Uninstallation

### Minimum system requirements

- Operating System:
  - Linux(i386): kernel 2.4 and up, glibc-2.2 and up
  - CentOS: 5 and up
  - Ubuntu: 8.04 and up
  - Debian: 4 and up
  - Solaris(x86): Sun0S 5.8 and up
  - FreeBSD(i386): 4.5 and up
  - MacOSX: 10.3 and up
- CPU:
  - Intel: 80486 and up
  - PowerPC: PowerPC G4
- Memory: 32MB and up
- Disk:
  - Installation: 200MB
  - Runtime: 300MB and up, swapping space depends on usage.

### Installation

Installation must be performed in a command line terminal. For testing purposes, LiteSpeed Web Server can be installed into a home directory by a non-privileged user. For production use, it should be installed into a system directory.

In Mac OS X, root user is disabled by default. It can be enabled using a series of actions detailed on the Apple website. You can also use the sudo command to install LSWS into a system directory without enabling the root user, but system folders will still only be manipulable by the root user. This means that every time you want to control LSWS from the command line terminal (like when you want to start or stop LSWS), you will have to use the sudo command.

#### Installation Steps:

1. Decompress the package into a convenient location:
   tar xvfz lsws-xxxx.tar.gz or gunzip -c lsws-xxxx.tar.gz | tar xvf -
2. [Enterprise Edition Only] Install trial license key or serial number:
   - Trial License:

     A trial license is for evaluation purposes and is only good for 15 days after download. A trial license can be requested from download page.

     A trial license key will be sent to you as an attachment in a confirmation email. Please save the attachment as trial.key and copy it to the installation directory.

     When you switch from a trial license to a production license, you can simply run the install script again after following the steps below to update your license.

   - Production license:
     1. Licenses can be leased or purchased at the LiteSpeed store.
     2. A serial number will be sent to you in the confirmation email after you order has been successfully processed. Each serial number allows for one server installation.
     3. Save the serial number as "serial.no"; in the installation directory (where install.sh is located). The LiteSpeed products registration server will use this file to retrieve your license key during the installation process.

3. Go to the installation directory cd lsws-xxxx and run command ./install.sh This will start LiteSpeed's Installer.

   Note that only by running this command as the "root" user can you install the server into a system directory. Other users should install it to somewhere under their home directory.

   Mac OS X users can install the server into a system directory with command sudo ./install.sh

4. Read the End User License Agreement and type "Yes" to confirm your agreement.
5. Specify the directory where you would like to install LiteSpeed Web Server. For the root user, the default is /usr/local/lsws. For non-privileged users, the default is their home directory. Remember, non-privileged users will not be able to install the server into a system directory.
6. [Enterprise Edition Only] Generate license request.

   If the Installer only finds serial number but no valid license key, it will prompt to generate a license request. The installer will talk to LiteSpeed products registration server and obtain a valid license key automatically. Upon getting the license key, it will go to next step. If failed, the installer will exit and leave a license request file.

   If the automatic process failed, you can create a ticket with license department from online store client area.

   Note: Installation will continue only if there is a valid trial license or valid Enterprise license.

7. Follow the instructions on the screen. The Installer will ask you to set the following:
   1. If a previously installed copy exists, the Installer will ask you to choose either upgrade, reinstall, or change directory. Upgrading will keep your current configurations.
   2. Administrator's username and password for the WebAdmin interface.
   3. What control panel, if any, you will use with LSWS.
   4. User and group that the server process will run on behalf of.
   5. TCP port for normal web service.
   6. TCP port for WebAdmin interface.
   7. Whether to set up LiteSpeed PHP.
   8. [Enterprise Edition Only] Root user has the option to enable chroot. The installer will setup the initial chroot environment automatically. Chroot is an advanced feature and your CGI may fail without configuration tuning. We strongly recommend not enabling chroot unless you are familiar with it. You can always enable it later by performing an upgrade installation.

   Finally, the Installer will ask you if you want to install the AWStats add-on module to keep track of your web statistics. Root user can also choose to run LiteSpeed web server automatically at system startup as a service. Then you're done! The installer can start up the server.

#### Testing Installation

1. For detailed information on controlling the server processes, please see the Administration Guide. To start the server, simply run [your_install_dir]/bin/lswsctrl start.
2. To access your site, point your browser to http://[address]:8088/, [address] being the IP address or domain name of your web server machine. Use "localhost" if the server is on the machine you are using. "8088" is the default port. If you changed the port during installation, write the port you designated. A congratulations page should load into the browser. If not, try the WebAdmin interface.
3. The default port for the WebAdmin interface is 7080. Plug http://[address]:7080/, into your browser to go to the WebAdmin interface. (If you changed the port for WebAdmin during installation, use that port instead.) Remember that for [address] you can use "localhost" if you're using the machine the server is on. The administration interface welcome page should load. Click the "Log on" link and use the administrator's username and password specified during installation to log on. For detailed information regarding configuration, please refer to our Configuration Guide, or click the "help" link on top of each page.
4. If your server uses firewall, please make sure that localhost is trusted. For instance, Linux with IPTables should include a rule ALLOW INPUT from LO.
5. If your web site and the WebAdmin interface are inaccessible, please take a look at the error log - [your_install_dir]/logs/error.log
   - If there is a TCP port conflict with other server applications, the web server should be reinstalled with an available port.
     The following command can be used to find an available port:
     netstat -an | grep XXXX
     XXXX is a port number. If the port is available, the command will produce no output.
   - If the swapping directory is not writable, you can either grant writing permission for the swapping directory to the user whom the web server is running as, or change the swapping directory manually. The swapping directory is configured in the server's XML configuration file located at [your_install_dir]/conf/httpd_config.xml, default value is /tmp/lshttpd/swap. Search for <swappingDir>.

If you still have problems with installation, please check out our wiki or post your problem on our support forum.

### Upgrading

There are a few scenarios where you would need to update or upgrade the server:

- A new release is available
- Upgrade from Standard Edition to Enterprise Edition
- Upgrade from a trial license to production license
- Upgrade/downgrade to a different production license.

There are a number of ways to upgrade. One way is to just run install.sh again and select "Upgrade" when prompted. Your current configurations will be kept.

Starting with release 2.0, version management can also be done from the WebAdmin interface, under Actions - Version Management. All your installed versions and the available new releases are listed here. You can install a new release or switch between different versions by clicking the appropriate link. Since release 2.0, LSWS also features a built-in update agent that will check for new releases periodically and send email notifications.

Starting with release 4.1, you can upgrade to the latest release, force reinstall, or downgrade to an old version using the command line tool lsup.sh. See detailed usage information in [your_install_dir]/admin/misc/lsup.sh --help

Since release 1.5.6, multiple versions of LiteSpeed Web Server can be installed. You can easily switch from one to another by using the version management utility: [your_install_dir]/admin/misc/mgr_ver.sh.

- To switch to a version already installed, for example 1.5.6, just run [your_install_dir_current_version]/admin/misc/mgr_ver.sh 1.5.6
- To remove previously installed files for a certain version, for example 1.5.6, just run [your_install_dir_current_version]/admin/misc/mgr_ver.sh -d 1.5.6

When upgrading your license (from trial to production license, for example), you can manually copy "serial.no" to the [your_install_dir]/conf/ directory, then restart. Please backup your old serial number and license key before restart.

### License transfer procedure:

Please be aware that each license key is associated with a serial number and the server's hardware signature. A new key is required if a change in hardware signature is detected. So if you upgrade or change your hardware, you need to transfer your current production license in order to continue using the product.

1. To migrate your current license, you can simply run the server binary ./lshttpd -m. It will talk to LiteSpeed' products registration server, unlock your serial number, and generate a temporary license key. This temporary key is good for 3 days. This allows you a smooth transition to the new server.
2. If you wish, you can take this chance to download the latest version of LiteSpeed Web Server to your new hardware. Then copy the serial number file "serial.no" to the installation directory and start up the Installer. You unlocked your serial number in the previous step, so running the Installer will get you a new license key.
3. If you wish to copy your old installation directory over to the new hardware, then you just need to activate your license. Run command ./lshttpd -r to retrieve a new license key.
4. If the process fails, you can create a ticket with the license department in the client area of the online store.

### Uninstallation Steps

1. Simply run [your_install_dir]/admin/misc/uninstall.sh and follow the instructions on the screen.
2. The Uninstaller will ask the following questions:
   - whether to keep the log directory
   - whether to keep the configuration directory
3. Directories that were not created by the Installer will not be touched, even if they are in [your_install_dir]. All the files created by the Installer will be removed.
4. [your_install_dir] will be removed as well, if it is empty.