[Mono-aspnet-list] Jexus Web Server 5.4.4 For Linux/Unix ASP.NET

geffzhang geffzhang at hotmail.com
Tue Oct 8 06:02:41 UTC 2013

Jexus is a web server for Linux/UNIX operating systems, which serves ASP.NET
web sites and applications. It is free (free as beer) and has an IIS alike
architecture with high performance and stability, as well as the following
features,•First class ASP.NET support.•Complete Fast-CGI support (for PHP
and other technologies).•Output caching support.•Reverse proxy support.•URL
rewrite support.•Media streaming support for Flash based media files (FLV
and F4V)•IIS Smooth Streaming support.•HTTPS support.•Built-in attack
prevention mechanism.•Simple installation and management.InstallationThe
following steps assume that you use latest Ubuntu Linux distro.1. Install
Mono runtime.sudo apt-get install mono-completeAs Jexus requires Mono
runtime, in this step we install latest stable Mono runtime (2.10.) via
apt-get. Mono 3.2. is recommended. 2. Downloadn and unpack Jexuswget
http://www.linuxdot.net/down/jexus-5.4.4.tar.gztar -zxvf
jexus-5.4.4.tar.gzJexus binary package is downloaded from its official site,
and extracted to a folder named “jexus-5.3.1″ after this step.3. Create
default web site1.sudo vi /var/www/default/index.html2.Press i on keyboard
to enter edit mode.3.Type “Hello World from Jexus” and press Esc on keyboard
to exit edit mode.4.Type :wq and press Enter on keyboard to exit
vi./var/www/default is the default web site path for Jexus. In this step we
create a test page using gedit. You might use any other Linux text editor to
create this test page.4. Install and launch Jexuscd jexus-5.4.4sudo
./installcd /usr/jexussudo ./jws startHere we put Jexus binary to /usr/jexus
folder, grant the jws shell script file execution permission, and then use
it to register Jexus modules in Mono GAC and launch the HTTP service. If you
want to install Jexus to another location, please change the commands
accordingly.Now if we open Firefox and navigate to http://localhost, the
test page we created is displayed correctly,Screenshot
http://flic.kr/p/ghCfmG Jexus test page in FirefoxUpgrade1. Download and
unpack Jexuswget http://www.linuxdot.net/down/jexus-5.4.4.tar.gztar -zxvf
jexus-5.4.4.tar.gzJexus binary package is downloaded from its official site,
and extracted to a folder named “jexus-5.3.1″ after this step.2. Stop old
Jexus server,cd /usr/jexussudo ./jws stopNote that for Jexus 5.2 and older,
the second command should be sudo ./jws.stop.3. Copy new files to Jexus
foldercd ~/jexus-5.4.4sudo ./upgradeNow let’s go back to the extracted
folder and upgrade necessary files to /usr/jexus.4. Fix startup
commands1.sudo vi /etc/rc.local2.Press i on keyboard to enter edit
mode.3.Replace previous start command “/usr/jexus/jws.start” with
“/usr/jexus/jws start”. (Needed only old Jexus is 5.2 and below).4.Remove
“/usr/jexus/state.start” if it presents.5.Press Esc on keyboard to exit edit
mode.6.Type :wq and press Enter on keyboard to exit vi.5. Start Jexus HTTP
servicecd /usr/jexus sudo ./jws startConfiguration SystemJexus currently
uses configuration format similar to Apache/Nginx.Server ConfigurationThe
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 exampleSiteLogDir=logSiteConfigDir=siteconfNote that any change to
server configuration only takes effect when Jexus is restarted.The
description of each settings is listed as
below,SettingMandatory?DescriptionSiteConfigDir 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 first two settings are mandatory.The log directory must give Jexus
process permissions to write, as Jexus server log and web site access logs
are all generated and stored there.In default installation,
/usr/jexus/siteconf is used as configuration directory, while /usr/jexus/log
is used as log directory.Web Site ConfigurationJexus 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,SettingMandatory?Descriptionaddr no The web site IP address. Default
is addr= (no IP v6 support yet) port yes 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. See (*1)for more details. 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.*, is used, access from the IP addreses are
denied. Mask is also supported, such as denyfrom=
allowfrom no IP address restriction. For example, when
allowfrom=111.222.111.*, 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/, 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. See (*2) for more
details. *1 The Jexus built-in default document name list is as
To enable HTTPS, please follow the steps in this blog post.Management
Script and CommandsStarting Jexus 5.3 the commands are merged into one Shell
script, /usr/jexus/jws.This script provides the following functionality,|
Command | Description | | jws start | Start Jexus server. | | jws start
site_name | Start a single web site. Note that site_name must match one of
the configuration files under configuration directory. | | jws restart |
Restart Jexus server. | | jws restart site_name | Restart a single web site.
| | jws stop | Stop Jexus server. | | jws stop site_name | Stop a single web
site. | | jws regsvr | Register Jexus assembly in GAC. Note that this is
only required to be executed once during installation. jws status Report
Jexus runtime status. | | jws -v | Display Jexus version number. |The script
should be set to executable during installation. The commands can only be
executed by root.Questions on Jexus can be posted to

View this message in context: http://mono.1490590.n4.nabble.com/Jexus-Web-Server-5-4-4-For-Linux-Unix-ASP-NET-tp4661058.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20131007/c558cd66/attachment.html>

More information about the Mono-aspnet-list mailing list