ePages Apache Configuration | → 6.17.35 | Created: 6.17.24; Updated: 6.17.25 |
Table of Contents |
ePages has its own Apache instance. Other Apache server can run simultaneously if they do not use the same ports as ePages (typically 80 and 443).
The ePages Apache instance was created as described in /usr/share/doc/apache2/README.multiple-instances (from Debian package apache2).
Resulting files of the ePages Apache instance are stored in the (DEB/RPM) package epages-webconf:
Configuration files are stored in /etc/apache2-epages/:
All configuration files use environment variables from /etc/apache2-epages/envvars.
Under normal circumstances it is sufficient to customize /etc/apache2-epages/envvars, other Apache configuration files should not be changed.
Only unchanged Apache configuration files are updated by ePages patches. Changed Apache configuration files are not overwritten by ePages patches. Then, files coming from patch are stored in CONF_FILE.rpmnew.
Environment variables from /etc/apache2-epages/envvars are used in Apache configuration files, start/stop script /etc/init.d/apache2-epages and control script /usr/sbin/apache2ctl-epages.
See /etc/apache2-epages/envvars for customizable variables and its description, find for example:
APACHE_PORT=80 APACHE_MODS_DIR="/usr/lib64/httpd/modules" APACHE_LOG_DIR=/var/log/apache2-epages
Apache must be restarted if /etc/apache2-epages/envvars has changed. Reload is not sufficient.
All variables defined by /etc/apache2-epages/envvars can be used in configuration files. Depending on the context the usage format varies.
In standard context environment variables are used as follows (from httpd_main.conf):
Listen ${APACHE_PORT} LoadModule deflate_module ${APACHE_MODS_DIR}/mod_deflate.so ErrorLog ${APACHE_LOG_DIR}/error_log
In RewriteRule context environment variables are used as follows (from httpd_mod_rewrite_restapi.conf):
RewriteRule ^(/rs/shops/.*)$ http://%{ENV:EPAGESJ_HOST}:%{ENV:EPAGESJ_PORT}$1 [P]
Environment variables in /etc/apache2-epages/envvars are made known to /etc/init.d/apache2-epages and /usr/sbin/apache2ctl-epages by sourcing:
APACHE_ENVVARS=/etc/apache2-epages/envvars [[ -f $APACHE_ENVVARS ]] && . $APACHE_ENVVARS
/etc/apache2-epages/envvars sources itself /etc/default/epages6 so that all variables defined in /etc/default/epages6 are known to /etc/apache2-epages/envvars, following are used by default:
At the end of /etc/apache2-epages/envvars file /etc/apache2-epages/envvars.local is sourced (if exist). envvars.local can be used for redefinition of default variables in envvars specific to host.
Defines are switches in configuration files, e.g. (from httpd-vhosts_default.conf):
<IfDefine JSON_LOG> Include extra/httpd_logssl_json.conf </IfDefine> <IfDefine !JSON_LOG> Include extra/httpd_logssl.conf </IfDefine>
Defines are set (-D) or unset (-U) as web server options, ePages Apache processes look like:
# ps -ef --forest | grep http[d] UID PID PPID CMD root 58622 1 /usr/sbin/httpd -DBASE_ALLOW -DREDHAT -f /etc/apache2-epages/httpd.conf -d /etc/apache2-epages -DSSL -DJSON_LOG -k start apache 58630 58622 \_ /usr/sbin/httpd -DBASE_ALLOW -DREDHAT -f /etc/apache2-epages/httpd.conf -d /etc/apache2-epages -DSSL -DJSON_LOG -k start apache 58631 58622 \_ /usr/sbin/httpd -DBASE_ALLOW -DREDHAT -f /etc/apache2-epages/httpd.conf -d /etc/apache2-epages -DSSL -DJSON_LOG -k start apache 58632 58622 \_ /usr/sbin/httpd -DBASE_ALLOW -DREDHAT -f /etc/apache2-epages/httpd.conf -d /etc/apache2-epages -DSSL -DJSON_LOG -k start
You can set defines:
After installing base package epages-release (and before installing ePages itself) you might change some variables in /etc/sysconfig/epages6 which influence /etc/default/epages6 resp. /etc/apache2-epages/envvars:
The package epages-webconf does not contain /etc/apache2-epages/envvars but /etc/apache2-epages/envvars.sample. When installing the package, envvars.sample is copied to envvars and then changed accordingly.