Install Tomcat in Linux

Source: Internet
Author: User
For details about how to install Tomcat in Linux-Linux Enterprise Application-Linux server application, see below. Author: Wang xiangbaituo

1. Download Tomcat

Download the binary version of Tomcat at the address below

Http://mirrors.ccs.neu.edu/Apache/dist/jakarta/tomcat-4/binaries/

Download an object

Tomcat-4.1.18.tar.gz

2. Installation

Extract

Gunzip tomcat-4.1.18.tar.gz
Tar-zxvf tomcat-4.1.18.tar

Get all Tomcat files and copy them to the location you want to install, as shown in figure

/Opt/tomcat-4.1.18/

For convenience, you can change the directory name tomcat-4.1.18 to tomcat.

3. Set

Set route entries

Add the following two lines to the/etc/profile file:

Export JAVA_HOME =/opt/jdk1.4
Export TOMCAT_HOME =/opt/tomcat

Here we assume that the Java JDK is installed in the/opt/jdk1.4 directory.
 
Activate ROOT

ROOT is disabled by default. To activate ROOT, open the file

Tomcat/conf/server. xml

Then



To remove the comment. .

Activate Invoker Servlet

Remove the comments of the following fields in tomcat/conf/web. xml.


Invoker
/Servlet /*

 
Set Port
The default Tomcat Port number is 8080. because Tomcat is an independent Standalone Web Server, it can work independently without Apache, so you can not install Apache, so you can set Tomcat to Port 80. in this way, you can omit: 8080 in the URL. open the tomcat/conf/server File. xml, find the following fields:


Port = "8080 "...
.../>

Then change 8080 to 80.
 
Create temp subdirectory
Create a temp subdirectory under the/opt/tomcat/directory
Mkdir temp

4. start Tomcat

After the installation, restart the computer to make the settings of JAVA_HOME and TOMCAT_HOME take effect.

/Opt/tomcat/bin

Run the following command:

./Startup. sh

Normally, the following information is displayed:

Using CATALINA_BASE:/opt/tomcat
Using CATALINA_HOME:/opt/tomcat
Using CATALINA_TEMDIR:/opt/tomcat/temp
Using JAVA_HOME:/opt/jdk1.4

Then open the following webpage in a browser:

Http: // localhost/

Or

Http: // localhost: 8080/(if Port number is not changed to 80)

If you see the Tomcat web page (index. jsp), it proves that Tomcat is successfully installed and started.

To disable Tomcat, run the following command under/opt/tomcat/bin.

./Shutdown. sh

5. register your Project)

Suppose you have your own JSP project, which should be installed in the following directory:

/Opt/tomcat/webapps/myproject

You must add a line in tomcat/conf/server. xml.



The corresponding address in the browser is:

Http: // localhost/myproject

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.