(⬑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
s2shwrapper script is installed as~/bin/s2shand~/binis in my$PATH(as it has been (no pun intended) since the 1990s). - The directory
~/s2acts as s2's "home base", and thes2shwrapper script defines theS2_HOMEenvironment variable with that value.
My ${S2_HOME} contains:
s2sh.bin: the compileds2shbinary which thes2shwrapper script proxies.require.d/: holds my require.s2 scripts. Thes2shwrapper script sets theS2_REQUIRE_PATHenvironment variable to include this directory, andrequire.s2uses 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. Thes2shwrapper script setsS2_MODULE_PATHto include this directory and a script-implemented wrapper fors2.loadModule()uses that path to look for DLLs.