The location of server files
This note provides documentation on the files and directories used by the server.
A standard setup of the server software creates directories in several places. On Linux devices, there are distinct locations for configuration files, source code files, and public documents. These locations adhere to long-established conventions, and should be followed in most circumstances.
- Source code: The server's source code files are placed in
/usr. These are the ECMAScript files that are interpreted by the
/lib /node_modules /rwserve
Node.jsexecutable. The process user should be granted read-only permission to these files.
- Configuration: Configuration files written by the webmaster are placed in
/etc. These contain the settings that are the subject of the other notes in this series. The process user should be granted read-only permission to these files.
- System: The Service Manager unit file (
rwserve.service) is placed in
/usr. This contains the settings needed to start and stop the server process using the
/lib/ systemd/ system
rootuser should be granted read-write permission to this file.
- Node.js: The Node.js executable is accessed through the file
/usr. Documentation on how to install Node.js can be found on the Internet.
- Static resources: The documents, scripts, style sheets, and media files that make up a website are placed in a sub-directory under
/srv. By convention, the name of that sub-directory is the DNS name of the website plus the configured
document-rootsubdirectory, so the static files for the DNS name
example.comwould be placed in
- Encoding cache: Cached copies of compressed files, that are created by the server, are kept in the
encoding-cache, so in concert with the above example those files would be written to
- Dynamic cache: Cached copies of compiled blue-phrase documents and linkmaps, that are created by the server, are kept in the
dynamic-cache, so those files would be written to
- Custom errors: The HTML files used as templates for custom error messages are placed in the location specified in the
custom-errorssection of the configuration file, which by convention would be
/srvdirectory, which is the designated spot for plugins that are shared by multiple virtual hosts. Plugins that software developers write for a single virtual host may be placed under its DNS-named sub-directory: following the above example, those plugins would be placed in
/srv. Remember, whichever path chosen for plugins must match the location specified in the
routersection of the configuration file.
The permission levels for these files are described in the note File Permissions.