Install Tomcat on Linux

Source: Internet
Author: User
Tags apache tomcat

1. Download a tomcat from the http://jakarta.apache.org/tomcat;

[Root @ linuxserver GZ] # wget http://apache.bestwebcover.com/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4.tar.gz &

[Root @ linuxserver GZ] # wget http://apache.bestwebcover.com/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4.tar.gz.md5 &

2. Why do I download a. MD5 file? This is the digital fingerprint of the file. When the official website is running, a fingerprint will pop up, namely jakarta-tomcat-5.4.tar.gz. MD5. You can run the "more" command to check whether the fingerprint is an MD5 string. If this file has been modified (add a Trojan !), The digital fingerprint changes, and the installation on the server is insecure. We can use the md5sum command to verify the fingerprint.

[Root @ linuxserver GZ] # More jakarta-tomcat-5.5.4.tar.gz.md5

B0ab66c5cc8737adeeffb5fbcb7f8395

[Root @ linuxserver GZ] # md5sum jakarta-tomcat-5.5.4.tar.gz

B0ab66c5cc8737adeeffb5fbcb7f8395 jakarta-tomcat-5.5.4.tar.gz

Compare the two MD5 values. If the values are equal, the file package is original. Some File digital fingerprints are in this format:

B0ab66c5cc8737adeeffb5fbcb7f8395 jakarta-tomcat-5.5.4.tar.gz

For example, if the file is named key. MD5, you can use this method to verify the file:

[Root @ linuxserver GZ] # md5sum-C key. MD5

Jakarta-tomcat-5.5.4.tar.gz: OK

If one digit in the fingerprint is incorrect, the following error occurs:

[Root @ linuxserver GZ] # md5sum-C key. MD5

Jakarta-tomcat-5.5.4.tar.gz: Failed

Md5sum: Warning: 1 of 1 computed checksum did not match

3. Extract

[Root @ linuxserver root] # cd/usr/local/

[Root @ linuxserver local] # gun zip </root/GZ/jakarta-tomcat-5.5.4.tar.gz | tar xf-

I have a binary package, so I don't need to compile it. Next I will set two environment variables catalina_home and catalina_base. Edit ~ /. Bashrc file.

[Root @ linuxserver local] # vi ~ /. Bashrc

Set catalina_base =/usr/local/jakarta-tomcat-5.5.4

Export catalina_base

Set catalina_home =/usr/local/jakarta-tomcat-5.5.4

Export catalina_home

Exit shell and log on again to verify that the variable has taken effect.

[Root @ linuxserver local] # echo $ catalina_home

/Usr/local/jakarta-tomcat-5.5.4

[Root @ linuxserver local] # echo $ catalina_base

/Usr/local/jakarta-tomcat-5.5.4

OK.

 

4. Run the Tomcat console;

[Root @ linuxserver local] # cd jakarta-tomcat-5.5.4/bin/

[Root @ linuxserver bin] #./Catalina. Sh run

Using catalina_base:/usr/local/jakarta-tomcat-5.5.4

Using catalina_home:/usr/local/jakarta-tomcat-5.5.4

Using catalina_tmpdir:/usr/local/jakarta-tomcat-5.5.4/temp

Using java_home:/usr/Java/j2sdk1.4.2 _ 06

This release of Apache Tomcat was packaged to run on j2se 5.0

Or later. It can be run on earlier JVMs by downloading and

Installing a compatibility package from the Apache Tomcat

Binary Download Page.

[Root @ linuxserver bin] #

What? Cannot run? Oh, there was a compatibility package missing, and we went down again.

5. download and install the jakarta-tomcat-5.5.4-compat.tar.gz package.

[Root @ linuxserver bin] # Cd ~ /GZ

[Root @ linuxserver GZ] # wget http://apache.bestwebcover.com/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4-compat.tar.gz &

[Root @ linuxserver GZ] # cd/usr/local/

[Root @ linuxserver local] # gun zip </root/GZ/jakarta-tomcat-5.5.4-compat.tar.gz | tar xf-

Run it again.

[Root @ linuxserver local] #./jakarta-tomcat-5.5.4/bin/Catalina. Sh run

Using catalina_base:/usr/local/jakarta-tomcat-5.5.4

Using catalina_home:/usr/local/jakarta-tomcat-5.5.4

Using catalina_tmpdir:/usr/local/jakarta-tomcat-5.5.4/temp

Using java_home:/usr/Java/j2sdk1.4.2 _ 06

Created mbeanserver with ID: 12a54f9: ffef84048d:-8000: linuxserver: 1

2004-10-31 23:04:31 org. Apache. Coyote. http11.http11protocol init

......

2004-10-31 23:05:37 org. Apache. Catalina. Core. applicationcontext log

Information: sessionlistener: sessiondestroyed ('75eb15d4c6f698ab0c95c5c8e4f259fa ')

OK. Open the browser: http: // 192.168.0.88: 8080! The installation is successful.

Of course, the current Tomcat only installs the most basic package, there are some not installed, you can go down to install a full version together.

[Root @ linuxserver local] # Cd ~ /GZ/

[Root @ linuxserver GZ] # wget http://apache.bestwebcover.com/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4-admin.tar.gz &

[Root @ linuxserver GZ] # wget http://apache.bestwebcover.com/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4-deployer.tar.gz &

[Root @ linuxserver GZ] # wget http://apache.bestwebcover.com/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4-embed.tar.gz &

[Root @ linuxserver GZ] # wget http://apache.bestwebcover.com/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4-fulldocs.tar.gz &

[Root @ linuxserver GZ] # cd/usr/local/

[Root @ linuxserver local] # gun zip </root/GZ/jakarta-tomcat-5.5.4-admin.tar.gz | tar xf-

[Root @ linuxserver local] # gun zip </root/GZ/jakarta-tomcat-5.5.4-deployer.tar.gz | tar xf-

[Root @ linuxserver local] # gun zip </root/GZ/jakarta-tomcat-5.5.4-embed.tar.gz | tar xf-

[Root @ linuxserver local] # gun zip </root/GZ/jakarta-tomcat-5.5.4-fulldocs.tar.gz | tar xf-

Well, now you are using the full version of Tomcat!

6. Now, Tomcat is installed on 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.