14.1.2 Creating an environment variable
We recommend that you use WebSphere environment variables, rather than hard-coded paths when deploying an application. In the following steps, we assume you have declared a PLANTSBYWEBSPHERE_ROOT variable. You will use it when specifying, for example, the JVM log's location.
Be certain you declare this variable at the right scope. For example, if you define this variable at the appserver scope, it will only be known at that level. As long as you work with the WAS Base or Express editions, this is fine. But if you later decide to use the ND edition and you create a cluster of appservers, the PLANTSBYWEBSPHERE_ROOT variable will need to be defined at the cluster or cell level.
Use the steps in 4.1.10, Using variables to create a PLANTSBYWEBSPHERE_ROOT variable with a value of C:\apps\PlantsByWebSphere.
There are several ways to organize WebSphere applications. Some companies prefer to create a directory for each application, as we do in our example, such as C:\apps\<appname>, and keep all resources and directories required by the application in subdirectories under this directory. This strategy works well when deploying only one application per appserver, again as we do in our example, because the appserver's log files could then all be changed to point to c:\apps\<appname>\logs.
Other companies prefer to organize resources by resource type, and so create directories such as c:\apps\logs\<appname.log>, c:\apps\properties\<appname.properties>, and so on.
And some companies prefer to stick with the vendor defaults as far as possible. For WebSphere, that means that the applications are installed in the <profile_home>/installedApps directory and the logs files are written to the <profile_home>/logs/<servername> directory.
Which option you choose is a matter of personal preferences and corporate guidelines.
Make sure you create the target directory you specify for the PLANTSBYWEBSPHERE_ROOT variable before proceeding. If the directory is not created, the appserver will not start.