To install Sysquake Remote, follow these steps:
httpd -l
LoadModule sqr_module libexec/mod_sqr.so
AddModule mod_sqr.c
<IfModule mod_sqr.c> AddType application/x-sysquake-remote .sqr </IfModule>
SQRRegistration webserver-hostname registration-key
or
SQRRegistration webserver-hostname registration-key name
If you have not received the registration key, you can skip this step now. Each .sqr page is displayed with a message which says that Sysquake Remote is not registered and the host name of the server. Please specify this host name, exactly as it is displayed, when you order your registration key.
SQRLibraryPath /usr/local/LME/lib
apachectl restart
This section describes the configuration directives which can be added to the files httpd.conf (main configuration file, usually in /usr/local/apache/conf for Solaris and Linux, and /private/etc/httpd for Mac OS X) and .htaccess (in directories).
Here is a possibility for such options. Note that only the SQRRegistration line is required, and that default options are secure by default; you should read carefully the documentation below before changing the options on a server on the Internet or in an insecure environment.
SQRRegistration www.company.com 6e8a.281f.a924.200306.a SQRStartup useifexists stdlib, sqr; SQRLibraryPath /usr/local/LME/lib SQRLocalLibraries on SQROutputLimit 10000 SQRTimeout 1000 SQREnableStderr on SQREnableAns on
Syntax: SQRCleanImagesCmd command
Context: server config
Override: n/a
This directive changes the command run periodically to clear the image files. The default value is a command which keeps at least the last 30 images:
cd /tmp/mod_sqr_im/; rm -f `ls -t|tail +30` >&/dev/null
Syntax: SQRDefaultFigureSize width height
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive changes the default figure size. The default default is 300 pixels wide by 200 pixels high.
Syntax: SQRDisableFunction list of commands to be disabled
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive disables all the functions which are listed. Several such directives can be used. This may be useful for security reasons, for instance to disable direct access to the shell with the unix command.
Syntax: SQREnable none|fileio|shell|fileio shell
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive enables potentially unsecure functions. The default value is none. Functions which can be enabled are:
| Name | Enabled feature |
|---|---|
| fileio | unrestricted file access with fopen |
| fileio=c | file access with fopen, same restrictions for reading and writing |
| fileio=cc | file access with fopen, different restrictions for reading and writing |
| shell | shell access with unix |
File access restrictions are specified with one of the following characters:
| Code | Access |
|---|---|
| x | no access |
| l | local access, in the root directory of Apache |
| s | subdirectory access, in the root directory of Apache or one of its descendants |
| a | access to all files |
For instance, the following directive enables read access with fopen(filename,'r') to any file in the root directory of Apache or one of its descendants, and no write access at all with fopen(filename,'w'):
SQREnable fileio=sx
Syntax: SQREnableAns off|on
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive enables the assignment of expression results to variable ans. The default is off.
Syntax: SQREnableHelp off|on
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive enables help function. The default is off.
Syntax: SQREnableStderr off|on
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive enables the sending of standard error output to the client. Standard error contains error messages, which may reveal the functionning of LME code. The default is on.
Syntax: SQRFigureFont monospace|sans-serif|serif
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive selects the default font used in figures. The default is sans-serif.
Syntax: SQRImageFileType GIF|PNG|JPEG|JPG
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive selects the default file type used for images. The default is GIF (uncompressed for patent reasons); it is supported natively by virtually all graphical browsers, back to the beginnings of the Web. It supports only 216 different colors (each component of red, green, and blue can take 6 different values). PNG supports 24-bit colors and is supported by most recent browsers; it compresses images without loss of quality. JPEG and JPG (synonymous) are lossy, i.e. compression ratio is large (typically 5-20), but the decompressed image has a lower quality than the original one. This is especially visible with images with lines and text, which makes it less suitable for all Sysquake Remote graphical commands but image. JPEG images do not support transparency. The trade-off between the quality and the compression ratio is fixed with directive SQRImageQuality.
Syntax: SQRImagePath path
Context: server config
Override: n/a
This directive sets the path where image files are stored on the server. The default is /tmp/mod_sqr_im. If the bottom-most directory does not exist, it is created (if the user Apache runs under has enough privileges; otherwise, you should create it by hand with mkdir /tmp/mod_sqr_im and change its ownership to Apache's user).
Syntax: SQRImageQuality quality
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive sets the quality factor used for JPEG output, a number between 0 (worst quality, large compression ratio) and 100 (best quality, smallest compression ratio). Even with a quality of 100, the JPEG image has some artifacts which are visible in images with sharp contrast (lines and text).
Syntax: SQRInputLimit n
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive sets the maximum amount of data accepted from the client with the POST method, in kibibytes (1 kibibyte is 1024 bytes). The default is 32.
Syntax: SQRLibraryPath paths
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive sets the path where library files are stored on the server. Several directories may be separated by colons or semicolons. The default is none.
Syntax: SQRLoadExtension path
Context: server config
Override: Options
This directive loads an extension which adds new functions to LME. Extensions are compatible with Sysquake's on the same platform, but must be loaded explicitly for security reasons. The default is none.
Syntax: SQRLocalLibraries on|off
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive enables the search of libraries in the same directory as the file being processed. The default is off.
Syntax: SQRMemory n
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive specifies how much memory must be allocated to LME, in kibibytes. The default is 8192 (8 mebibytes).
Syntax: SQROutputLimit none|n
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive specifies the maximum amount of data sent back to the client as the contents of the request, in kibibytes (1 kibibyte is 1024 bytes). The default is 128.
Syntax: SQRRandomSeed on|off
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive specifies whether the seeds for the random generators rand and randn are set to a random initial value (based on the system clock). The default is on.
Syntax: SQRegistration hostname key [username]
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive specifies the registration information for Sysquake Remote. It must match the host name of the server. If no such directive is found, Sysquake Remote displays a message at the top of each page which states that Sysquake Remote is not registered and it cannot be used for a long period, and which host name it has.
Syntax: SQRStartup commands
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive specifies the commands which are executed before each page. The default is none. You can import default libraries such as stdlib and sqr:
SQRStartup useifexists stdlib, stat;
Note that useifexists fails silently, without an error, if libraries are not found. You may prefer use.
Syntax: SQRSubdirEnforcement on|off
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive specifies whether limits set by SQREnable, SQROutputLimit and SQRTimeout are enforced in subdirectories. If it is on, only stricter limits can be specified by subdirectories. The default is on.
Syntax: SQRTimeout none|n
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive specifies a time limit (in milliseconds) for the execution of each page. The default is 5000 (5 s).
Syntax: SQRTransparentBackground on|off
Context: server config, virtual host, directory, .htaccess
Override: Options
This directive enables a transparent background for figures. Only the part outside the frame is transparent. The default is on.