More notes. 🙂

Running the latest beta version as of Oct 1st: 1.4.11

Saving a few bytes

LiteSpeed will include an extra header that says what it is, and what version it is.

In Server Configuration->General Settings, Server Signature can be set to Hide Full Header, and it will not waste data self identifying as “LiteSpeed”.

Similarly, PHP can be tweaked to also not self identify.

sudo nano /usr/local/lsws/lsphp7/lib/php.ini

# Find and make the following change
expose_php = Off

In total this shaves off 40-some bytes per request, important if you’re trying to keep responses less than the size of a TCP packet (worst case, 1280 bytes on IPv6).

Log File Behaviour

NOTE: There is a bug that causes access.log files not to roll-over (error.log’s are fine). I’ve since reported it.

Log files typically go here:

/usr/local/lsws/logs/lsrestart.log       # any time you don't gracefully restart
/usr/local/lsws/logs/stderr.log          # std error

# Admin Control Panel

# Per Virtual Host
/usr/local/lsws/Example/logs/error.log   # disabled by default (goes to main error.log)

PHP Errors get written to error.log as NOTICE level events.

Also, any time you reboot, the main error log rolls over!

In the control panel, Tools->Server Log Viewer can be used to view the contents of the primary error.log file.

Access Log Format

LiteSpeed supports Apache-style log strings.

This Apache-style Access Log string will correctly log what CloudFlare proxy the traffic was piped through (or – if direct).

%h [%{PROXY_REMOTE_ADDR}e] %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

The default string looks like this (also known as NCSA extended/combined):

%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"


Compress Logs

You’ll want to enable this in several places.

Server Configuration->Log->Access Log

WebAdmin Settings->General->Access Log

Your Virtual Hosts. Your VHost Template.

Create a Template

Duplicate a template, such as the one in “/usr/local/lsws/conf/templates/ccl.conf“. Give write permission.

cd /usr/local/lsws/conf/templates
sudo cp ccl.conf myhost.conf
sudo chmod +x myhost.conf
sudo chown lsadm:lsadm myhost.conf

Click the Add button on the VHost Templates page, and make it point to your new template.

Template Name:    MyHost
Template File:    /usr/local/lsws/conf/templates/myhost.conf
Mapped Listeners: Default