The following sections outline the configuration updates that are required in order to serve imagery through the OnEarth apache module. Configuration changes may be made directly in the /etc/httpd/conf/conf.d
file or in a /etc/httpd/conf.d/<config.d>
file. The latter requires that Apache be configured to read configuration files in the conf.d
directory.
The OnEarth utility installs Apache modules into the apache <lib dir>/httpd/modules/
directory. Apache must be configured to include these modules. To do so, the following lines must be added to the Apache configuration file.
LoadModule onearth_module modules/mod_onearth.so
LoadModule oetwms_module modules/mod_oetwms.so
For OnEarth WMS/WFS support using Mapserver, the onearth-mapserver package must be installed and the following lines must be added to the Apache configuration file.
LoadModule oems_module modules/mod_oems.so
LoadModule oemstime_module modules/mod_oemstime.so
It is also recommended to increase the internal recursion limit for WMS support as these modules may cause a lot of internal redirects.
LimitInternalRecursion 20
A '' element must be included in the Apache configuration for each OnEarth imagery service endpoint. A sample configuration element is shown below. Note the following items of interest:
- OptionsIndexes - The FollowSymLinks option allows for an endpoint to be configured using symlinks for simpler configuration management. The ExecCGI option is required to execute the WMTS and TWMS CGI script.
- WMSCache - This custom element points to the WMTS or TWMS cache configuration file that is generated by the OnEarth layer configuration tool.
- Rewrite - The suggested configuration rewrites '.jpg' to '.jpeg' to optimize URL matching internal to the OnEarth module.
Sample WMTS endpoint
<Directory "/usr/share/onearth/demo/wmts/epsg4326">
Options Indexes FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
AllowOverride None
Order allow,deny
Allow from all
WMSCache /usr/share/onearth/demo/data/EPSG4326/cache_wmts.config
Header set Access-Control-Allow-Origin *
</Directory>
Sample Tiled-WMS endpoint
<Directory "/usr/share/onearth/demo/epsg4326">
Options Indexes FollowSymLinks ExecCGI
AddHandler cgi-script .cgi
AllowOverride None
Order allow,deny
Allow from all
wmsCache /usr/share/onearth/demo/data/EPSG4326/cache.config
TWMSDirConfig .lib/getTileService.xml
Header set Access-Control-Allow-Origin *
</Directory>
Sample WMS endpoint
ScriptAlias /wms/epsg4326 /usr/share/onearth/demo/wms/epsg4326
<Directory "/usr/share/onearth/demo/wms/epsg4326">
Options Indexes FollowSymLinks ExecCGI
AddHandler cgi-script .cgi
AllowOverride None
Order allow,deny
Allow from all
MapfileDir /usr/share/onearth/demo/mapserver/
DefaultMapfile epsg4326.map
TWMSServiceURL http://localhost/twms/epsg{SRS}/twms.cgi
Header set Access-Control-Allow-Origin *
</Directory>
A new endpoint must be create for each projection. For instance, if Web Mercator projected imagery is also desired as a WMTS endpoint:
<Directory "/usr/share/onearth/demo/wmts-webmerc">
Options Indexes FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
AllowOverride None
Order allow,deny
Allow from all
WMSCache /usr/share/onearth/demo/data/EPSG3857/cache_wmts.config
Header set Access-Control-Allow-Origin *
</Directory>
KML - Note that the KML service requires the existence of a Tiled-WMS endpoint.
To configure an endpoint on the file system: