< Day Day Up > |
Recipe 11.2 Starting Tomcat11.2.1 ProblemYou want to get Tomcat running. 11.2.2 SolutionSet the JAVA_HOME and CATALINA_HOME environment variables, change directories to Tomcat's bin directory, and type startup in Windows or run startup.sh in Unix. 11.2.3 DiscussionBefore starting Tomcat from the command line, you must set these two environment variables:
You can set these environment variables from the command prompt (in Windows that's the DOS prompt; in Unix it's the shell) as in this example: set JAVA_HOME=C:\jdk1.4 How you do this varies by operating system; for example, in the Unix tcsh shell, use setenv instead. After setting these environment variables, run Tomcat by changing directories to Tomcat's bin directory and typing startup in Windows, or running startup.sh in Unix. Note that in Windows, a new DOS window appears that displays initialization messages. To shut down Tomcat, type shutdown in Windows, or run shutdown.sh in Unix at the command line. Now that you've gotten Tomcat running, open a browser, and navigate to http://localhost:8080, which should open Tomcat's Welcome page, as shown in Figure 11-1. The localhost part of this URL is what you use for web servers installed on your local machine (corresponding to an IP address of 127.0.0.1), and 8080 is the port number (web servers usually use port 80, but Tomcat uses 8080 to avoid conflicts with other servers). Figure 11-1. The Tomcat 5.0.19 startup page
11.2.4 See AlsoRecipe 11.1 on installing Tomcat; Chapter 1 in Tomcat: the Definitive Guide (O'Reilly); Chapter 4 in JavaServer Pages (O'Reilly); Chapter 9 in Eclipse (O'Reilly). |
< Day Day Up > |