Tags:
create new tag
view all tags

Setting Environment Variables

APPX offers six levels at which environment variables may be set:

General Environment Variable information can be found at APPX Environment Variables.

Specific Environment Variables are documented in detail at Environment Variables List.

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 autoexec.bat or the System Environment (Computer Properties, Advanced System Settings, Advanced Tab, Environment Variables button. Might require a reboot to take effect). In UNIX, they are typically set in /etc/profile

BENEFITS:

  • Familiar to APPX veterans
  • Convenient if you have a mixture of character and GUI Users
  • Easy to verify what the values are by "set | more"

DISADVANTAGES:

  • variables tend to end up scattered around
  • 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!
  • In character mode, the user must log out and log back in again before changes in variable values can take effect
  • The Login Manager must be restarted and the users must log out and in again before changes in variable values can take effect

Per-user OS Environment Variables

For character mode users on a Linux/Unix system you can set environment variables in their ~/.profile. This will override any OS settings or any appx.env settings.

This does not work for users that connect via the Login Manager.

Startup script files

If you use a script to start APPX for your character mode users, you can set them in the script.

BENEFIT:

  • Convenient
  • Like appx.env, does not require reboots or system logout/logins for changes to take effect, just exiting and re-entering APPX

DISADVANTAGES:

  • Only works for character mode users
  • 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.
  • 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
  • If someone ever runs APPX by invoking the engine directly, your script's variable settings won't be executed

Login Manager

This technique involves changing the settings of the Login Manager. See Login Manager For Unix/Linux or Login Manager For Windows.

BENEFIT:

  • You can set up different ports with different settings

DISADVANTAGE:

  • Does not work for character mode users

Global appx.env Environment Variables

The recommended method for setting environment variables is in the appx.env file ($APPXPATH/appx.env).

BENEFIT:

  • convenient if you have a mix of Telnet and APPX/Client users
  • all variables in a single file

DISADVANTAGE:

  • Affects all users, you cannot set up different variables on a per port or per user basis

Setting Environment Variables on the Command line

You can also set environment variables from the command line. Just prefix the variable with 2 dashes as follows on the command line:

appx --APPX_SQL_LOG=c:\logs\appx.log --APPX_CMD_LOG=0xFFFFFFFF

This will set APPX_SQL_LOG and APPX_CMD_LOG for the duration of this session only.

Common Problems

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:

$ export APPX_PRT_FI_DIR=/tmp/pat/
C:\> set APPX_PRT_FI_DIR=\\server\printfiles\pat\

Make sure path names are valid

For any variable requiring a file or directory pathname, make sure that all directories in the path exist. Make sure that the case you use in the variable setting matches the actual case of the filename for those environments that are case sensitive. 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.

Comments:

Read what other users have said about this page or add your own comments.



Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2016-01-21 - JeanNeron
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 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