---+ Setting Environment Variables APPX offers five levels at which environment variables may be set: %TOC% General Environment Variable information can be found at [[APPXEnvironmentVariables][APPX Environment Variables]]. Specific Environment Variables are documented in detail at [[/assets/asp/dynamic_generator.asp?pageid=600][Environment Variables List]]. <a name="OLE_LINK1"> <hr size="2"></hr> </a> ---++ Global OS Environment Variables The "classic" and most general place to set environment variables is at the OS level. In Windows, they are set in the autoexec.bat or System Environment on APPX/Client machine. In UNIX, they are typically set in /etc/profile ---+++ Among the BENEFITS are that they are: <ul type="disc"> <li>Familiar to APPX veterans </li> <li>Convenient if you have a mixture of Telnet and APPX/Client Users </li> <li>Easy to verify what the values are by "set | more" </li> </ul> ---+++ DISADVANTAGES: <ul type="disc"> <li>variables tend to end up scattered around </li> <li>using a mixture of OS and appx.env variables leaves you with variable settings in any of many different places. This can be hard to debug! </li> <li>for non-APPX/Client users, user must log out and log back in again before changes in variable values can take effect </li> <li>for APPX/Client users, the !WinAppxD System Service must be stopped and restarted, or the NT must be rebooted, before changes in variable values can take effect </li> <li>/etc/profile, NT system environment settings, and shared autoexec.bat files. </li> <li>convenient if you have a mix of Telnet and APPX/Client users. </li> <li>easy to verify variable values with "set |more" at a command prompt. </li> </ul> <a name="_Hlk484825407"> </a> <hr size="2"></hr> <a name="_Hlk484825407"> </a> ---++ Per-user OS Environment Variables * <p>UNIX's ~/.profile, or Windows non-shared autoexec.bat</p> * <p>Not applicable for APPX/Client</p> * <p>For variables set on a per-user basis</p> It is only useful in "shared disk" configurations on Windows, and for UNIX Telnet access to APPX. Overrides any OS settings. Also overrides any global appx.env settings. <a name="_Hlk484825963"> </a> <hr size="2"></hr> <a name="_Hlk484825963"> </a> ---++ Startup script or batch files The next technique for setting APPX-related environment variables, is to do so directly in the script or batch file invoked by system users to start APPX, or invoked by the system to start !AppxD. ---+++ BENEFIT: <ul type="disc"> <li>If the site already maintains a script or batch file, to start APPX, this may be convenient </li> <li>Like appx.env, does not require reboots or system logout/logins for changes to take effect, just exiting and re-entering APPX </li> </ul> ---+++ DISADVANTAGES: <ul type="disc"> <li>If you don't already have an APPX startup script or batch file, for some other site-specific purpose, you probably don't want to add one. It's another file to maintain and remember the purpose of. </li> <li>Doesn't offer anything beyond appx.env's functionality, if you're not already doing other things in an APPX startup script that need scripting or batch file programming capabilities </li> <li>If someone ever runs APPX by invoking APPX.EXE directly, your script's variable settings won't be executed </li> <li>Only affects non-APPX/Client users </li> <li>Convenient for sites who customize APPX startup by using a batch file </li> </ul> ---+++ BENEFIT (start-appxd.sh): <ul type="disc"> <li>It's already there </li> </ul> ---+++ DISADVANTAGE (start-appxd.sh): <ul type="disc"> <li>site administrators should be careful to back up this file prior to an APPX upgrade in case a new version includes an updated template start-appxd.sh file </li> </ul> ---+++ !AppxD startup script (UNIX only) <ul type="disc"> <li>only affects APPX/Client users </li> <li>similar to appx.env, allows all variable settings in one file </li> </ul> ---+++ <a name="OLE_LINK2"> <hr size="2"></hr> </a> ---++ Global appx.env Environment Variables The recommended method for setting environment variables is in Global appx.env. <ul type="disc"> <li>$APPXPATH/appx.env </li> <li>convenient if you have a mix of Telnet and APPX/Client users </li> <li>all variables in a single file </li> </ul> ---+++ <a name="_Hlk484826334"> <hr size="2"></hr> </a> ---++ Per-user appx.env Environment Variables Per-user appx.env is not available for APPX/Client users. It is only useful in "shared disk" configurations on Windows, and for UNIX Telnet access to APPX. Overrides any OS settings. Also overrides any global appx.env settings. <ul type="disc"> <li>~/appx.env or C:\appx.env </li> <li>not applicable for APPX/Client </li> <li>for variables set on a per-user basis </li> </ul><p align="center"> </p> ---+++ <a name="_Hlk484826378"></a><a name="_Gotchas"></a> <hr size="2"></hr> ---++ Gotchas Tech support sees various issues related to environment variables come up on a regular basis. Since forewarned is forearmed, here they are. ---+++ APPX_PRT_FI_DIR must have trailing slash Determines where APPX creates report files. Examples in UNIX and Windows: <blockquote style="margin-right: 0px;" dir="ltr"> <pre>$ export APPX_PRT_FI_DIR=/tmp/pat/</pre> <pre>C:\> set APPX_PRT_FI_DIR=\\server\printfiles\pat\</pre> </blockquote> ---+++ Make sure path names are valid For any variable requiring a file or directory pathname, make sure that all directories in the path exist. On UNIX (or when editing appx_print for !UniQue), make sure that the case you use in the variable setting matches the actual case of the filename. A mistake here can cause log files to not appear, or APPX to behave incorrectly. ---+++ Setting a variable in .profile for a APPX/Client user will have no effect While a variable set in a UNIX .profile will affect a user's APPX session if they Telnet in to the APPX machine, it won't affect a APPX/Client login. Since we directly start up APPX from APPX/Client, rather than going through a Command Shell as with Telnet, no shell initialization files are processed. ---+++ Clicking "Apply" after a change, won't update a running copy of !WinAppxD !WinAppxD runs as a system service. As such, the only way to get !WinAppxD (and subsequent APPX/Client sessions started from it) to recognize changes in the system environment is to reboot the server.
This topic: Main
>
WebHome
>
SystemAdministration
>
APPXEnvironmentVariables
>
SettingEnvironmentVariables
Topic revision: r1 - 2012-02-28 - ChrisBrower
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback