Lighttpd is a web server designed to be secure, fast, standards-compliant, and flexible while being optimized for speed-critical environments.
Its low memory footprint (compared to other web servers), light CPU load and its speed goals make lighttpd suitable for servers that are suffering load problems, or for serving static media separately from dynamic content. Lighttpd is free software/open source, and is distributed under the BSD license. Lighttpd runs on Linux and other Unix-like operating systems and Microsoft Windows (under Cygwin). Also under Windows, it can be controlled using the standalone program Lighty Tray.
Product Component | OS Type | Versioning | Pattern Depth |
---|---|---|---|
Lighttpd | Unix | Active, Package Info | Instance based |
Windows | Active, Configuration file | Instance based |
The pattern supports identification and versioning of Lighttpd webservers on all major platforms - Unix/Linux and Windows
Trigger Node | Attribute | Condition | Argument | OS type |
---|---|---|---|---|
DiscoveredProcess | cmd | matches | regex '(?i)\blighttpd\.exe$' | Windows |
regex '\blighttpd$' | Unix |
The following components/processes are identified using the combination of pattern definitions and simple identity mappings
Name | Command |
---|---|
Lighttpd Web Server | regex '(?i)\blighttpd\.exe$' |
regex '\blighttpd$' |
The pattern in this module will set the following type attribute:
Pattern Name | SI Type |
---|---|
Lighttpd | Lighttpd Web Server |
Version information for this product can be gathered using several methods, depending on the type of OS on which Lighttpd is running. If the version is retrieved it is used to populate "version" and "product_version" attributes of the Software Instance created.
The command execution versioning method on Windows involves executing the web server binary (trigger process) with the argument "-version", provided that we pattern has obtained the full path to the binary. The output is then parsed.
Executed command | Regular expression to extract the version |
---|---|
<path_to_binary>\lighttpd.exe -v | regex '(?i)lighttpd[/-](\d+\.\d+(?:\.\d+)*)' |
If the pattern does not obtain the version by executing the web server binary, the pattern attempts to locate the version in a configuration file in corresponding directory, the version usually is contained in parameter "server.tag"
This configuration files directory is typically located at the the level of the installation path for the web server, although the pattern can handle both absolute path as well as path relative to the installation path.
The path to the main configuration file can be retrieved by extracting the path specified by the '-f' command-line argument.
The following regular expressions are used to check if the path is absolute or relative to the installation directory.
Regular expression | Arguments to search in |
---|---|
regex '(?i)-f\s+"?\w:' | process.args |
If path is absolute, the pattern retrieves the path to configuration files directory exactly from process arguments with the following regular expression:
Regular expression | Arguments to search in |
---|---|
regex ' (?i)-f\s+"?(\w+:\\.+?\\)\S+\.conf"?\s' | process.args |
If path to the configuration files is relative to the path to the web server, the pattern retrieve the full installation path for lighttpd with following regular expression:
Regular expression | Arguments to search in |
---|---|
regex '(?i)(\w+:\\.+\\)lighttpd\.exe' | process.cmd |
Once the installation path is obtained (if available) the configuration files directory location is obtained using the following regular expression:
Regular expression | Arguments to search in |
---|---|
regex '(?i)-f\s+"?(.+?\\)\S+\.conf"?' | process.args |
Once the file location is determined, the pattern executes the following command to parse all the configuration files for 'server.tag' attribute
Command executed for parsing | 'cmd /c DIR | FINDSTR 'server.tag ' <path_to_configuration_dir>*.conf |
---|
The result is parsed using the following regular expression:
Regular expression to obtain version | regex '(?i)lighttpd[/-](\d+\.\d+(?:\.\d+)*)' |
---|
The command execution versioning method on UNIX/Linux involves executing the web server binary (trigger process) with the argument "-version", provided that we pattern has obtained the full path to the binary. The output is then parsed.
Executed command | Regular expression to extract the version |
---|---|
<path_to_binary>\lighttpd.exe -v | regex '(?i)lighttpd[/-](\d+\.\d+(?:\.\d+)*)', raw '\1' |
If versioning command fails to return any version information, the pattern checks the installed packages to extract version information from one of them.
Package Regular expressions used:
NOTE: With regards to Lighttpd, qe can be certain that returning that only one version will be returnes, since we cannot install two lighttpd packages on the same machine.
We have found that all of the approaches provide a version number up to three levels of depth, i.e. x.x.x.
Lighttpd is a single-threaded, single-process, event-based, non-blocking-IO web server. While this is perfect for the performance it doesn't scale very well over CPUs. It has been shown that lighttpd scales mostly linearly on multicore, multi-processor boxes if you set the number of workers (server.max-worker) equal to two times the number of cores if you are CPU bound (for heavy rewrites and heavy proxying).
Lighttpd can therefore be started wither as a single lighttpd process, or optionally as an initial lighttod process which creates a number of children processes, as set in configuration file.
The pattern is triggered on all processes that match the defined trigger condition.
A Software Instance, is created for each 'parent' instance.
If command-line arguments can be retrieved, the Software Instance created will create a key based on the command-line arguments, since separate instances of Lighttpd will have different command-line arguments (specifying different configuration files, ports, etc).
Where command-line arguments are not retrieved, a grouped Software Instance is created.
This pattern has been tested against Lighttpd running on multiple platforms (Unix/Linux and Windows) with different configurations
Webserver Wikipedia was used to gather information on the product and produced a lot of the product description. It was also used as the source for some of our known versions.
The official Lighttpd documentation page was used to identify some versioning techniques and some configuration specifications for installation and setting of Lighttpd Webserver.
Created by: i.galytska@tideway.com 09:26, 26 October 2008 (PST)
Reviewed by: Nikola Vukovljak 11:34, 24 October 2008 (GMT)