Installing the Tomcat server and deploying the Web App under Linux

Source: Internet
Author: User

First, upload the Tomcat server

  

  

Second, install Tomcat Server 2.1, unzip the Tomcat server compressed package

  

  

2.2. Configure Environment variables

The tomcat server runtime requires JDK support, so you must configure the environment variables used by the JDK

  

Edit the profile file under/etc, plus the following:

  

  

2.3. Modify the boot port of the Tomcat server

  

Modify the port used when the Tomcat server is started, for example, change to 9999

  

After you finish modifying the Server.xml file, save and exit.

Third, the Tomcat server starts and shuts down 3.1, starts the Tomcat server

Enter the bin directory of the Tomcat server, and then execute the "./startup.sh" command to start the Tomcat server as shown in:

  

Check the log information of the Tomcat server to see if the Tomcat server has started properly, enter the logs directory under the Tomcat server, and open the Catalina.out file for viewing, as shown in:

  

Access the Tomcat server as shown in:

  

Can be accessed normally, indicating that the Tomcat server has started successfully.

If Tomcat does not boot, it is most likely that the port used at startup is occupied by other applications, so you can troubleshoot it by looking at the application that 9999 port is taking up, for example.

  

3.2. Close the Tomcat server

Enter the bin directory of the Tomcat server, and then execute the "./shutdown.sh" command to start the Tomcat server as shown in:

  

Check the log information of the Tomcat server to see if the Tomcat server has shut down properly, go to the logs directory under the Tomcat server, open the Catalina.out file for viewing, as shown in:

  

Iv. deploying Javaweb to the Tomcat server

Deploying Javaweb to a Tomcat server is to package an open Javaweb application into a war package and publish it to the WebApps directory of the Tomcat server

  

4.1. Packaging Javaweb Application

  

  

  

The project was packaged successfully, as shown in:

  

4.2. Publish the war package to the WebApps directory of the Tomcat server

After packaging the Javaweb app into a war package, place the war package under the WebApps directory of the Tomcat server, because the Javaweb application you are deploying uses a JNDI data source. So the first thing to do is to put the driver jar package of the database into the Lib directory of the Tomcat server.

1. Upload the drive jar package of the Oracle database to the LIB directory of the Tomcat server

As shown in the following:

  

2. Upload the packaged war package to the WebApps directory of the Tomcat server

As shown in the following:

Upload the war package to the WebApps directory

  

Upload successful

  

Tomcat server automatically unzip the war package

  

Check to see if the Tomcat server automatically created the Catalina/localhost directory under the Conf directory, and look for a oams.xml file that is automatically created by the Tomcat server in the localhost directory.

  

Five, Linux install the Tomcat server to use the command 5.1,Linux View port is occupied by which process
Lsof-i: Port number

For example:

  

5.2. View the Linux server version
Lsb_release-a

For example:

  

5.3. View current iptables (firewall) Rules

Use "iptables–l–n" To view current iptables rules

For example:

  

5.4. Add the specified port to the firewall

Iptables-i input-p Protocol--dport port number-j ACCEPT

For example:

1 161 -J Accept28080 -j Accept

Installing the Tomcat server and deploying the Web App under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.