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
{{ message }}
This repository was archived by the owner on Jul 2, 2024. It is now read-only.
The output of the logs should show the Apache modules being loaded and auto-generated password for the Apache user and group, (if not try again after a few seconds).
250
242
251
-
#### Runtime Environment Variables
243
+
#### Environment Variables
252
244
253
-
There are several environmental variables defined at runtime these allow the operator to customise the running container which may become necessary when running several on the same docker host, when clustering docker hosts or to simply set the timezone.
The ```SERVICE_UNIT_INSTANCE```, ```SERVICE_UNIT_LOCAL_ID```and ```SERVICE_UNIT_INSTANCE``` environmental variables are used to set a response header named ```X-Service-Uid```that lets you identify the container that is serving the content. This is useful when you have many containers running on a single host using different ports (i.e with different ```SERVICE_UNIT_LOCAL_ID``` values) or if you are running a cluster and need to identify which host the content is served from (i.e with different ```SERVICE_UNIT_INSTANCE```values). The three values should map to the last 3 dotted values of the container name; in our case that is "app-1.1.1"
247
+
The ```APACHE_SERVER_NAME```and ```APACHE_SERVER_ALIAS``` environmental variables are used to set the VirtualHost ```ServerName```and ```ServerAlias``` values respectively. In the following example the running container would respond to the host names ```app-1.local```or ```app-1```:
258
248
259
249
```
260
250
...
261
-
--env "SERVICE_UNIT_APP_GROUP=app-1" \
262
-
--env "SERVICE_UNIT_LOCAL_ID=1" \
263
-
--env "SERVICE_UNIT_INSTANCE=1" \
251
+
--env "APACHE_SERVER_ALIAS=app-1" \
252
+
--env "APACHE_SERVER_NAME=app-1.local" \
264
253
...
265
254
```
266
255
267
-
##### APACHE_SERVER_NAME & APACHE_SERVER_ALIAS
256
+
##### APACHE_CONTENT_ROOT
268
257
269
-
The ```APACHE_SERVER_NAME``` and ```APACHE_SERVER_ALIAS``` environmental variables are used to set the VirtualHost ```ServerName``` and ```ServerAlias``` values respectively. In the following example the running container would respond to the host names ```app-1.local```or ```app-1```:
258
+
The home directory of the service user and parent directory of the Apache DocumentRoot is /var/www/app by default but can be changed if necessary using the ```APACHE_CONTENT_ROOT```environment variable.
270
259
271
260
```
272
261
...
273
-
--env "APACHE_SERVER_ALIAS=app-1" \
274
-
--env "APACHE_SERVER_NAME=app-1.local" \
262
+
--env "APACHE_CONTENT_ROOT=/var/www/app-1" \
275
263
...
276
264
```
277
265
@@ -288,7 +276,7 @@ The Apache CustomLog can be defined using ```APACHE_CUSTOM_LOG_LOCATION``` to se
The Apache ErrorLog can be defined using ```APACHE_ERROR_LOG_LOCATION``` to set a file | pipe location and ```APACHE_ERROR_LOG_LEVEL``` to specify the required LogLevel value.
294
282
@@ -363,23 +351,23 @@ The Apache process is run by the User and Group defined by ```APACHE_RUN_USER```
363
351
...
364
352
```
365
353
366
-
##### APACHE_CONTENT_ROOT
354
+
##### APACHE_PUBLIC_DIRECTORY
367
355
368
-
The home directory of the service user and parent directory of the Apache DocumentRoot is /var/www/app by default but can be changed if necessary using the ```APACHE_CONTENT_ROOT``` environment variable.
356
+
The public directory is relative to the ```APACHE_CONTENT_ROOT```and together they form the Apache DocumentRoot path. The default value is `public_html` and should not be changed unless changes are made to the source of the app to include an alternative public directory such as `web` or `public`.
369
357
370
358
```
371
359
...
372
-
--env "APACHE_CONTENT_ROOT=/var/www/app-1" \
360
+
--env "APACHE_PUBLIC_DIRECTORY=web" \
373
361
...
374
362
```
375
363
376
-
##### APACHE_PUBLIC_DIRECTORY
364
+
##### APACHE_SYSTEM_USER
377
365
378
-
The public directory is relative to the ```APACHE_CONTENT_ROOT```and together they form the Apache DocumentRoot path. The default value is `public_html` and should not be changed unless changes are made to the source of the app to include an alternative public directory such as `web` or `public`.
366
+
Use the ```APACHE_SYSTEM_USER```environment variable to define a custom service username.
379
367
380
368
```
381
369
...
382
-
--env "APACHE_PUBLIC_DIRECTORY=web" \
370
+
--env "APACHE_SYSTEM_USER=app-1" \
383
371
...
384
372
```
385
373
@@ -395,13 +383,13 @@ To set the timezone for the UK and account for British Summer Time you would use
395
383
...
396
384
```
397
385
398
-
##### APACHE_SYSTEM_USER
386
+
##### SERVICE_UID
399
387
400
-
Use the ```APACHE_SYSTEM_USER```environment variable to define a custom service username.
388
+
The ```SERVICE_UID```environmental variable is used to set a response header named ```X-Service-Uid``` that lets you identify the container that is serving the content. This is useful when you have many containers running on a single host using different ports or if you are running a cluster and need to identify which host the content is served from. The default value is set to the Service Unit's App Group Name, Local ID and Instance ID.
0 commit comments