You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-2Lines changed: 59 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,7 +251,64 @@ And the page at `http://localhost:8999/` will point to these two URLs.
251
251
<aname="Server_Configuration"></a>
252
252
## 4. Server Configuration
253
253
254
-
### Apache
254
+
### 4.1 `conf/config.json`
255
+
256
+
The variables `$HAPISERVERPATH`, `HAPISERVERHOME`, `$NODEEXE`, and `$PYTHONEXE` can be set in `conf/config.json` or as environment variables. These variables can be used in commands, files, and URLs in the server metadata.
257
+
258
+
The default configuration file is `conf/config.json` and this location changed using a command line argument, e.g.,
259
+
260
+
```
261
+
./hapiserver -c /tmp/config.json
262
+
```
263
+
264
+
To set variables using environment variables, use, e.g.,
265
+
266
+
```
267
+
PYTHONEXE=/opt/python/bin/python ./hapiserver
268
+
```
269
+
270
+
Variables set as environment variable take precendence over those set in `conf/config.json`.
271
+
272
+
**`$HAPISERVERPATH`** and **`$HAPISERVERHOME`**
273
+
274
+
These two variables can be used in metadata to reference a directory. For example,
275
+
276
+
```
277
+
"catalog": "$HAPISERVERHOME/mymetadata/Data.json"
278
+
```
279
+
280
+
By default, `$HAPISERVERPATH` is the installation directory (the directory containing the shell launch script `hapi-server`) and should not be changed as it is referenced in the demonstration metadata files. Modify `$HAPISERVERHOME` in `conf/config.json` to use a custom path.
281
+
282
+
All relative paths in commands in metadata files are relative to the directory where `hapi-server` was executed.
is read and relative paths in `TestData.json` have `/home/username/` prepended.
297
+
298
+
**`$PYTHONEXE`**
299
+
300
+
This is the command used to call Python. By default, it is `python`. If `python` is not in the path, this can be set using a relative or absolute path. Python is used by several of the demonstration catalogs.
This is the command used to call NodeJS. By default, it is the command used to start the server. The start-up script looks for a NodeJS executable in `$HAPISERVERPATH/bin` and then tries `node` and then `nodejs`.
309
+
310
+
311
+
### 4.2 Apache
255
312
256
313
To expose a URL through Apache, (1) enable `mod_proxy` and `mod_proxy_http`, (2) add the following in a `<VirtualHost>` node in a [Apache Virtual Hosts](https://httpd.apache.org/docs/2.4/vhosts/examples.html) file
257
314
@@ -273,7 +330,7 @@ If serving multiple catalogs, use
0 commit comments