| 19 | (Added in 5.4.0, [http://mapserver.org/development/rfc/ms-rfc-56.html#ms-map-pattern-environment-variable RFC-56]) |
| 20 | |
| 21 | The optional MS_MAP_PATTERN environment variable can be used to specify a Regular Expression that |
| 22 | must be matched by all mapfile paths passed to the mapserv CGI. |
| 23 | |
| 24 | If MS_MAP_PATTERN is not set then any .map file can be loaded. |
| 25 | |
| 26 | Example, use Apache's SetEnv directive to restrict mapfiles to |
| 27 | the /opt/mapserver/ directory and subdirectories: |
| 28 | |
| 29 | {{{ |
| 30 | SetEnv MS_MAP_PATTERN "^/opt/mapserver/" |
| 31 | }}} |
| 32 | |
21 | | (Added in 5.4.0) |
| 35 | (Added in 5.4.0, [http://mapserver.org/development/rfc/ms-rfc-56.html#ms-map-no-path-environment-variable RFC-56]) |
| 36 | |
| 37 | The optional MS_MAP_NO_PATH environment variable can be set to any value |
| 38 | to forbid the use of explicit paths in the map=... URL parameter. |
| 39 | Setting MS_MAP_NO_PATH to **any value** forces the use of the |
| 40 | map=<env_variable_name> mechanism in mapserv CGI URLs. |
| 41 | |
| 42 | If this variable is not set then nothing changes and the mapserv CGI still |
| 43 | accepts explicit file paths via the map=... URL parameter. |
| 44 | |
| 45 | Example, set set MS_MAP_NOPATH and some mapfile paths in Apache's httpd.conf: |
| 46 | |
| 47 | {{{ |
| 48 | SetEnv MS_MAP_NO_PATH "foo" |
| 49 | SetEnv MY_MAPFILE "/opt/mapserver/map1/mymapfile.map" |
| 50 | }}} |
| 51 | |
| 52 | ... and then calls the mapserv CGI must use environment variables for the |
| 53 | map=... parameter: |
| 54 | {{{ |
| 55 | http://localhost/cgi-bin/mapserv?map=MY_MAPFILE&mode=... |
| 56 | }}} |
| 64 | See [http://mapserver.org/development/rfc/ms-rfc-28.html#setting-ms-errorfile RFC-28] |
| 65 | |
| 66 | The variable MS_ERRORFILE specifies the location of the logging/debug output, with possible values being either a file path on disk, or one of the following special values: |
| 67 | |
| 68 | * “stderr” to send output to standard error. Under Apache stderr is the Apache error_log file. Under IIS stderr goes to stdout so its use is discouraged. With IIS it is recommended to direct output to a file on disk instead. |
| 69 | * “stdout” to send output to standard output, combined with the rest of MapServer’s output |
| 70 | * “windowsdebug” to send output to the Windows OutputDebugString API, allowing the use of external programs like SysInternals debugview to display the debug output. |
| 71 | |
| 72 | It is possible to specify MS_ERRORFILE either as an environment variable or via a CONFIG directive inside a mapfile: |
| 73 | |
| 74 | {{{ |
| 75 | CONFIG "MS_ERRORFILE" "/tmp/mapserver.log" |
| 76 | }}} |
| 77 | |
| 78 | or |
| 79 | |
| 80 | {{{ |
| 81 | CONFIG "MS_ERRORFILE" "stderr" |
| 82 | }}} |
| 83 | |
| 84 | If both the MS_ERRORFILE environment variable is set and a CONFIG MS_ERRORFILE is also set, then the CONFIG directive takes precedence. |
| 85 | |
| 86 | If MS_ERRORFILE is not set then error/debug logging is disabled. During parsing of a mapfile, error/debug logging may become available only after the MS_ERRORFILE directive has been parsed. |
| 87 | |
31 | | (Added in 5.0.0) |
| 90 | (Added in 5.0.0, see [http://mapserver.org/development/rfc/ms-rfc-28.html#debug-levels RFC-28]) |
| 91 | |
| 92 | A default DEBUG level value can be set using the (optional) MS_DEBUGLEVEL environment variable in combination with the MS_ERRORFILE variable. |
| 93 | |
| 94 | When set, this value is used as the default debug level value for all map and layer objects as they are loaded by the mapfile parser. This option also sets the debug level for any msDebug() call located outside of the context of a map or layer object, for instance for debug statements relating to initialization before a map is loaded. If a DEBUG value is also specified in the mapfile in some map or layer objects then the local value (in the mapfile) takes precedence over the value of the environment variable. |
| 95 | |
| 96 | This option is mostly useful when tuning applications by enabling timing/debug output before the map is loaded, to capture the full process initialization and map loading time, for instance. |