windows 10 + vwware+centos 6.5 virtual machine system install Tomcat

  • 2020-05-17 07:23:50
  • OfStack

Linux configures the Tomcat environment Settings

System environment :windows 10 + vwware,centos 6.5 virtual machine system

Install jdk

If you don't have jdk, install jdk first.

How do I know if it's installed


[root@localhost /]# java -version
java version "1.7.0_45"
OpenJDK Runtime Environment (rhel-2.4.3.3.el6-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

The installation steps for JDK are not detailed here.

Install configuration tomcat

Download and install

Download address:

http://tomcat.apache.org/download-80.cgi

What I downloaded is:

apache-tomcat-7.0.73.tar.gz

Copy to the current user's root directory, unzip, and rename to tomcat


[xxx@localhost ~]$ mv apache-tomcat-7.0.73 tomcat
[xxx@localhost ~]$ tar -zxvf apache-tomcat-7.0.73.tar.gz 
mv apache-tomcat-7.0.73 tomcat

Go to tomcat/bin and launch tomcat, then access the test via a browser:


[xxx@localhost bin]$ ./startup.sh 
Using CATALINA_BASE:  /home/xxx/tomcat
Using CATALINA_HOME:  /home/xxx/tomcat
Using CATALINA_TMPDIR: /home/xxx/tomcat/temp
Using JRE_HOME:    /usr
Using CLASSPATH:    /home/xxx/tomcat/bin/bootstrap.jar:/home/xxx/tomcat/bin/tomcat-juli.jar
Tomcat started.

Open the browser under windows and type:

http://10.0.0.220:8080/

You can open the tomcat home page to indicate that the launch was successful. 10.0.0.220 is the Intranet ip of my virtual machine.

Start and close

Start the


[xxx@localhost bin]$ ./startup.sh 
Using CATALINA_BASE:  /home/xxx/tomcat
Using CATALINA_HOME:  /home/xxx/tomcat
Using CATALINA_TMPDIR: /home/xxx/tomcat/temp
Using JRE_HOME:    /usr
Using CLASSPATH:    /home/xxx/tomcat/bin/bootstrap.jar:/home/xxx/tomcat/bin/tomcat-juli.jar
Tomcat started

Shut down


[xxx@localhost bin]$ ./shutdown.sh 
Using CATALINA_BASE:  /home/xxx/tomcat
Using CATALINA_HOME:  /home/xxx/tomcat
Using CATALINA_TMPDIR: /home/xxx/tomcat/temp
Using JRE_HOME:    /usr
Using CLASSPATH:    /home/xxx/tomcat/bin/bootstrap.jar:/home/xxx/tomcat/bin/tomcat-juli.jar

Deploy the web app application

My development environment is under windows, myeclipse. In the centos environment where the program is to be deployed, first export the war package of the project under myeclipse. The steps are as follows:

Project name right-click -export- save war type file

Copy the exported Test.war file to centos's tomcat/webapps directory. Then restart tomcat. Then open your browser and type:

http://10.0.0.220:8080/Test/01/hello.jsp

The page displays hello world.

01 directory is a subdirectory under webroot of my MyEclipse project. There is an hello.jsp file below, which is the output hello world:


<body>
  <%
    String str = "hello world";
    out.println(str);
   %>
 </body>

Thank you for reading, I hope to help you, thank you for your support of this site!


Related articles: