51.10. Editing the Program Path and Environment Variables

When you run a command like ls from the UNIX shell, the PATH environment variable determines the directories that your shell will search to find the actual executable, such as /bin/ls. Webmin also uses the PATH variable to locate commands that it runs when a full path is not specified, such as webalizer or mysql. By default, this list of directories is set to include all of the common locations for programs on your operating system, but may be incorrect if you have installed executables in some nonstandard directory such as /usr/local/samba/bin.

The LD_LIBRARY_PATH environment variable also determines where programs look for shared libraries that they need to load when run. Again, Webmin sets this variable by default to include all of the common library directories on your operating system, but it may miss some if you have compiled and installed programs manually. A symptom of this is programs run by Webmin failing with an error message like libmysqlclient.so.6: open failed. A library like this might be found in /usr/local/mysql/lib, which is not in the default search path.

You can edit these paths and define your own environment variables that will be passed to all programs run by Webmin by following these steps:

1.
Click on the Operating System and Environment icon.

2.
Add any additional program directories to the Program search path field. Each directory must be separated by a : (colon), just as they are in the PATH environment variable. Existing directories should not be removed or changed, however, as they may stop parts of Webmin from working.

3.
Add any extra shared library directories to the Library search path field, again separated by colons.

4.
Sometimes it is useful to have Webmin pass other environment variables to programs that it runs. For example, if you had several custom commands that connected to Oracle, you might want ORACLE_HOME to be set appropriately before they are run. The Additional environment variables table allows you to define some—just enter a name into the first empty field under Variable name and a value into the field next to it under Value. As with most tables in Webmin, this one only displays one empty row at a time, so if you want to add more than one variable, you will need to save and reopen this page.

5.
When you are done setting paths and variables, hit the Save button to activate them.

Any program run by Webmin also has access to several variables set by the web server itself and passed to the CGI programs that make up Webmin. For example, REMOTE_USER contains the name of the logged-in user and REMOTE_HOST contains the client IP address. All HTTP headers are stored in uppercase variables starting with HTTP_. A program can find information about the user's browser in the HTTP_USER_AGENT variable, for example.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.22.163