This page provides a guide on Jexus configuration files.

Index

Server Configuration File

The configuration file, which contains most of Jexus settings, is located in Jexus installation folder (usually /usr/jexus) and named jws.conf.

Unlike IIS which uses XML to store settings, the Jexus settings are stored in key-value pair, for example
SiteLogDir=log
SiteConfigDir=siteconf

Note that any change to server configuration only takes effect when Jexus is restarted.

The description of each settings is listed as below,
Setting Mandatory? Description
SiteConfigDir yes The directory that holds web site configuration files. Relative paths to jws.exe can be used.
SiteLogDir yes The directory that holds the log files. Relative paths to jws.exe can be used.
Runtime no Application pool ASP.NET runtime version. For example, Runtime=v4.0.30319 or Runtime=v4.0.
httpd.processes no Specifies the number of worker processes associated with the application pool. A value other than 1 indicates a Web garden. The default value is 1.
httpd.user no Application pool identity. For example, httpd.user=www-data. The default value is root.
httpd.MaxTotalMemory no (5.5+) Specifies the maximum total physical memory (of MBytes) that all worker processes can consume before the pool starts to recycle worker processes. It ranges from 256 to 80% of maximum physical memory installed on the machine. The default is 0, where Jexus automatically adjusts the usage. Note that for each worker process the minimum physical memory usage is 128-MBytes.
httpd.MaxCpuTime no (5.5+) Specifies how much CPU resources (of seconds) can be consumed by a single worker process before being recycled by the pool. It ranges from 600 to 14400. The default value is 3600.
LLVM no When a worker process is created, Jexus passes this flag to Mono. The default value is false.
certificatefile no File name of the server certificate file (in X.509 format). The default value is empty.
certificatekeyfile no File name of the server certificate file private key (in PEM format). The default value is empty.

Jexus Manager handles all settings except httpd.maxtotalmemory, certificatefile and certificatekeyfile. The excluded settings need to be set by modifying the configuration file.

Website Configuration File

Jexus supports multiple web sites running on the same server. The web sites use individual bindings to distinguish from each other.

The web site configuration files must be saved in the configuration directory set in jws.conf (aka SiteConfigDir). The configuration file name is used as site name (site name is only used in Jexus commands), which should not contain spaces. Note that all files in configuration directory are treated as web site configuration files. Thus, don’t leave anything else there.

Note that any change to web site configuration only takes effect when the web site is restarted.

In default installation, a default web site is created. Its configuration file is /usr/jexus/siteconf/default. Just like jws.conf, the web site configuration is also stored in key value pair, and the description of each settings is as below,
Setting Mandatory? Description
addr no The web site IP address. Default is addr=0.0.0.0. (no IP v6 support yet)
port no The port number used for this web site. Default is port=80.
hosts no The host header accepted by this web site. Default is hosts=*, which means any host header is accepted. Wildcard is also supported, such as *.mysite.com.
root yes The directory mapping. The default is root=/ /var/www/default, which maps physical directory /var/www/default that contains the web site contents to web site root.
indexes no Default document name list. For example, when indexes=index.aspx,index.htm is used, access to / will be resolved to index.aspx if it exists, and then index.htm if exists, and 404 if none of them exists. When this setting is not set, Jexus uses its built-in name list.
rewrite no URL rewrite rule. For example, rewrite=^/.+?.(asp|php|cgi)$ /404.html means any access to classic ASP/PHP/CGI pages is rewritten to /404.html. To use multiple rules, use multiple lines of rewrite=.
denyfrom no IP address restriction. For example, when denyfrom=111.222.111.*,1.1.1.1 is used, access from the IP addreses are denied. Mask is also supported, such as denyfrom=192.168.1.0/255.255.255.0.
allowfrom no IP address restriction. For example, when allowfrom=111.222.111.*,1.1.1.1 is used, only access from the IP addresses are allowed. All other access is denied.
DenyDirs no Hidden segments. When DenyDirs=bin,App_code is used, access to such URL paths is denied.
checkquery no Query strings restriction. Jexus uses built-in logic to perform query safety check. The default is checkquery=true. Note that by setting this to true, there is some impact on Jexus performance.
nofile no NOFILE is a Jexus specific feature. It is similar to IIS custom error pages for 404. When nofile=/mvc/controller.aspx is used, access to non-existent files is redirected to /mvc/controller.aspx. Note that the original URL is passed via X-Real-Uri server variable.
nolog no Logging flag. The default is nolog=false. When set to true, Jexus stops generating log files for this web site.
keep_alive no HTTP keep-alive flag. The default is keep_alive=true.
reproxy no Reverse proxy rule. When reproxy=/abc/ http://www.xxxx.com:890/abc/ is used, requests on /abc/ (source) will be redirected to http://www.xxxx.com:890/abc/ (destination). The destination can be multiple, so that Jexus randomly picks one from them, which is similar to load balancing. For example, reproxy=/abc/ http://192.168.0.3/abc/,http://192.168.0.4/abc/.
fastcgi.add no FastCGI rule. For TCP connections, typical setting is fastcgi.add=php,php3
usegzip no GZip compression flag. The default is usegzip=true.
usehttps no SSL flag. To enable HTTPS, this setting must be set to true, and port must be set to 443 at the same time. The default is usehttps=false. The certificate configured at server level will be used.

Jexus Manager handles all settings except reproxy, fastcgi.add, and checkquery. Those excluded settings still need to be done by modifying website configuration files.

Application Configuration File

Applications under websites (IIS style applications) can be configured by creating websites, whose root points to the application path. Jexus Manager simplifies such application creation a lot, and also uses its own convention to set application configuration file names.

Virtual Directory Configuration File

Jexus does not support IIS style virtual directories.

Last edited May 23 at 6:57 AM by lextm, version 6