JMRI web access

Basic Use

JMRI has built-in support for viewing your layout from a web browser.

Advanced Configuration

JMRI's built-in support can be reconfigured to some extent.

Advanced Uses

The JMRI web components can be used in your own web server.

JMRI: Mini Web Server

The JMRI mini web server is meant to be a quick and easy way for model railroaders, not Masters of the Web, to get a web connection to JMRI up and running.

Configuration

Several properties files configure the JMRI mini web server and its default features. There is also a MiniServer Preferences area where many of these values can be modified.
jmri/web/miniserver/Services.properties
This file provides a mapping from URLs to the servlets that handle them. It's most useful for controlling access to the FileServlet (which serves the contents of local files), and mapping the URL that corresponds to JMRI panels via the FrameServlet.
jmri/web/miniserver/Html.properties
Provides the "boiler plate" text for HTTP replies and certain HTML responses.
jmri/web/miniserver/servlet/fileservlet/FileServletPaths.properties
Maps URLs presented to the FileServlet to locations in the file system. This servlet is somewhat JMRI-specific, in that it knows about the location of the current JMRI preferences directory; see the comment at the front of the file.
jmri/web/miniserver/servlet/fileservlet/FileServletTypes.properties
Specifies the MIME type to be returned for a file based on the file suffix.

Security

By default, JMRI only allows limited access to your computer. Only files that are located within the JMRI distribution directory or the JMRI preferences directory will be provided in response to requests. This is not air-tight security, however, and you should be careful to not put important content in those directories or link them to other parts of your computer.