Sun ONE Application Server 7 Getting Started Guide |
Chapter 3
Setting Up Your EnvironmentAfter installation of the application server, one of the first steps is to configure your environment to include the application server’s bin/ directory.
This section contains the following topics:
About the PATH Environment VariableThis section addresses how to add the following directory to your PATH environment variable:
install_dir/bin
This is the only environment setting needed to run the asadmin command, the application server’s administrative command-line utility, and to access the asant utility to work with the sample applications.
If you are using the application server installation that was installed as part of a Solaris 9 installation, then you must include the directory /usr/appserver/bin in your PATH in order to access the asant utility. Additionally, if your PATH does not include /usr/sbin, inclusion of /usr/appserver/bin in your PATH ensures that you have access to the asadmin command-line interface.
If you are familiar with the process of setting environment variables, do so now in your own environment.
After setting your PATH variable, ensure that the asadmin command can be found, then proceed to "Starting and Stopping the Application Server." If the command is not found, check your PATH setting, refresh your environment settings, and execute asadmin again.
Otherwise, select one of the following paths depending on your platform:
Setting the PATH Variable on UNIXOn UNIX systems, it is recommended that you add the application server's bin directory to your login profile so it is automatically added to your environment's PATH setting during login.
Once you have set the PATH environment and refreshed your environment, execute the asadmin command at the command prompt.
The following result should appear:
asadmin
Use "exit" to exit and "help" for online help
asadmin>_
Type exit to quit the Administration command-line interface. Leave the terminal window open for the next chaptersection of this tutorial, "Starting and Stopping the Application Server".
If the command is not found, check your PATH setting, refresh your environment settings, and execute asadmin again.
Setting the PATH Variable on WindowsOn Windows, it is recommended that you modify the system PATH environment variable via the Windows control panel as described in the following steps:
- Click the Windows Start button, choose Settings, then Control Panel.
- In the Control Panel, double-click System.
- Click on the Advanced tab, then choose Environment Variables...
The Environment Variables dialog box lists the environment variables that apply to your current user account as well as to the system as a whole.
In this exercise, you will modify the PATH environment variable for your current user account.
- Select the existing PATH entry and click Edit or click New to create a new PATH environment variable.
- Add the install_dir/bin value to the beginning of the PATH value.
For example, add C:\Sun\AppServer7\bin; to the front of the variable value.
- Click OK to close the Edit User Variable dialog window.
The PATH variable should reflect the directory path that you just entered.
- Click OK to apply the changes and to close the Environment Variables Window, then click OK to close the System Properties window.
- Check your work by starting a command window and determining if the application server commands are available from the command line:
- Click the Windows Start button, then choose Run.
- In the Open field, enter cmd and click OK.
- When the command window appear, type asadmin at the command prompt.
After execution of the asadmin command, you should see the following result:
C:\>asadmin
Use "exit" to exit and "help" for online help
asadmin>
If you see this result, then you have verified that the application server command line utilities are accessible via your path setting.
- Type exit to quit the Administration command-line interface.
Leave the command window open and proceed to the next chapter, "Starting and Stopping the Application Server". If the command is not found, check your PATH setting, refresh your environment settings, and execute asadmin again.
Troubleshooting Environment SettingsIf the asadmin command is not recognized, go back into the Control Panel as described in Step 2, check your PATH setting, and try to execute the asadmin command again. Once you have fixed the PATH setting, ensure that you start a new command window to test execution of the asadmin command. Only a new command window will pick up the environment variable change. You will encounter the following message when your PATH variable is not set correctly:
C:\>asadmin
'asadmin' is not recognized as an internal or external command, operable program or batch file.
C:\>
Proceed to the next chapter "Starting and Stopping the Application Server."