(⬑Table of Contents)
There's No Place Like S2_HOME
This section describes one common convention and suggestion for where to install s2-related files. These are not rules enforced by the framework, just suggestions borne of long-time experience.
In my many wanderings with s2, the following installation structure has evolved to serve me well:
- The
s2sh
wrapper script is installed as~/bin/s2sh
and~/bin
is in my$PATH
(as it has been (no pun intended) since the 1990s). - The directory
~/s2
acts as s2's "home base", and thes2sh
wrapper script defines theS2_HOME
environment variable with that value.
My ${S2_HOME}
contains:
s2sh.bin
: the compileds2sh
binary which thes2sh
wrapper script proxies.require.d/
: holds my require.s2 scripts. Thes2sh
wrapper script sets theS2_REQUIRE_PATH
environment variable to include this directory, andrequire.s2
uses that environment variable to configure itself.cgi/
: is where s2cgi lives. Several of my websites use this for various JSON APIs.mod/
: where compiled loadable modules (DLLs) go. Thes2sh
wrapper script setsS2_MODULE_PATH
to include this directory and a script-implemented wrapper fors2.loadModule()
uses that path to look for DLLs.