The first time we ran a JSP application using a Tomcat server, we had configured tomcat with an environment variable catalina_home, which specifies where Tomcat is installed, and for multiple development projects, we typically release multiple tomcat servers. So the final boot is not the server itself, look at the Tomcat startup script, Startup.bat or startup.sh may be found:
Through this code snippet, you can look at the script to find the%catalina_home% environment variable in the directory, if the environment variable is set and correctly found, then the environment variable is started to specify the location of the Tomcat server, and perform all the configuration of the server, including the root directory, etc. In other words, when we have configured the CATALINA_HOME environment variable, no matter how many Tomcat servers we have on our computer, the one that is eventually started, the other servers are not used
Another situation is that, although the environment variables are configured, but the corresponding directory of environment variables do not exist, then the execution of startup script startup, under Linux will be an error, in Windows under the window will appear a flash of the situation, this time need to modify the environment variable configuration can
In the last case, the environment variable is not configured to start directly, this time because the startup program does not find the corresponding environment variable, then set a temporary environment variable into memory, and then start the script under the installation package of the server, and will execute all the server configuration, At this time, multiple servers can be used independently, the previous installation of Tomcat under Linux does not configure the environment variables, use is not any problem
Whether to configure the environment variable is also based on their own circumstances, the use of a single server is recommended to configure the correct configuration, of course, can not be configured, and multiple servers coexist, then do not need to configure, or recommend to put Tomcat in the program installation directory, unified use, it is also more consistent , for the Eclipse Development Javaweb project, the IDE does not need to identify the server environment variables, the new project when we choose the server itself, and then the IDE itself to complete the configuration, this is the same as the previous distinction, the above is a little bit of the details of the Tomcat server to add, Is the same for Linux and Windows
A little supplement to the Tomcat server configuration