The location of server files
Standard Directories
Preliminaries
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.
Server software
- 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.js
executable. 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./rwserve - 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 systemctl
command. Theroot
user 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./bin /node
Website resources
- 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 configureddocument-root
subdirectory, so the static files for the DNS nameexample.com
would be placed in/srv
./example.com/ document-root - 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/srv
./example.com/ encoding-cache - Dynamic cache: Cached copies of compiled BLUEPHRASE documents and linkmaps, that are created by the server, are kept in the
dynamic-cache
, so those files would be written to/srv
./example.com/ dynamic-cache - Custom errors: The HTML files used as templates for custom error messages are placed in the location specified in the
custom-errors
section of the configuration file, which by convention would be/srv
./example.com/ custom-errors - Plugin modules: JavaScript plugins written by third-parties are normally placed in the
/srv
directory, 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/plugins /srv
. Remember, whichever path chosen for plugins must match the location specified in the/example.com/ plugins router
section of the configuration file.
The permission levels for these files are described in the note File Permissions.