SuiteC uses Apache as its reverse proxy. SuiteC contains a script that will generate an Apache config file based on the project's configuration. Steps:
-
Edit the JSON config file per current environment. If you're setting up your development environment then edit
config/local.json
. -
Add the following snippet to the JSON config. Customize the Apache paths and replace
/Users/jane_doe/Projects/suitec
with the path to base SuiteC directory.{ "apache": { "documentRoot": "/Users/jane_doe/Projects/suitec/public", "logDirectory": "/usr/local/apache2/logs", "modulesDirectory": "/usr/libexec/apache2" }, ...
-
The SuiteC deployment process requires DOCUMENT_ROOT (environment variable) value that matches
apache.documentRoot
above. -
Next, generate
apache/suitec.conf
, an Apache config snippet with:cd ~/Projects/suitec node apache/apache.js
-
Edit your main Apache config file (
/etc/apache2/httpd.conf
or/etc/apache2/httpd.conf
) and add the following line. Personalize the path to conf file, as above.Include /Users/jane_doe/Projects/suitec/apache/suitec.conf
-
If you are running SuiteC behind SSL, the Apache config file will need to include
RequestHeader set X-Forwarded-Proto "https"
to ensure that Node.js correctly picks up the request protocol.
SuiteC uses node-config to manage a hierarchical organization of configuration files. It lets you define a set of default parameters, and extend them for different deployment environments (development, qa, staging, production, etc.). Configurations are stored in configuration files within the application, and can be overridden and extended by environment variables, command line parameters, or external sources.
Node-config reads configuration files in the ./config
directory for the running process. This can be overridden by setting the $NODE_CONFIG_DIR
environment variable to the directory containing your configuration files.
$NODE_CONFIG_DIR
can be a full path from the root directory, or a relative path from the process if the value begins with ./
or ../
.
Files in the config directory are loaded in the following order:
default.EXT
default-{instance}.EXT
{deployment}.EXT
{deployment}-{instance}.EXT
{hostname}.EXT
{hostname}-{instance}.EXT
{hostname}-{deployment}.EXT
{hostname}-{deployment}-{instance}.EXT
where
EXT
can be.yml
,.yaml
,.coffee
,.cson
,.properties
,.json
,.json5
,.hjson
or.js
. SuiteC uses.json
as the default format.{instance}
is an optional instance name string for multi-instance deployments{hostname}
is the server name, from the$HOST
or$HOSTNAME
environment variable oros.hostname()
{deployment}
is the deployment name, from the$NODE_ENV
environment variable
The settings in config/local.json
are hierarchical (e.g., app.host
). Customize to your needs with:
https
: Typically false in development environments and true in dev, qa and prod.port
: The internal port on which the SuiteC app server should listenhost
: The domain name, not including protocol, used to reach SuiteC (e.g., 'localhost'). Do not confuse this with the domain name of your Canvas instance.
database
: The name of the Postgres database SuiteC should useusername
: The username with which SuiteC should connect to the Postgres databasepassword
: The password with which SuiteC should connect to the Postgres databasehost
: The host at which SuiteC can connect to the Postgres databaseport
: The port at which SuiteC can connect to the Postgres databasedropOnStartup
: Whether SuiteC should drop all existing database data when restarting the app server. CAUTION: This should never be enabled in a production environment.
SuiteC uses node-bunyan for managing application logging. Node-bunyan will log all messages in JSON format.
level
: The logging level at which SuiteC should log messages. SuiteC will log all messages at or above the configured logging level. See node-bunyan for additional information about the available levelsstream
:stdout
if SuiteC should log to the standard output stream. Otherwise, this should be the path to the log file to which SuiteC should log