CentOS 6.2 How to install Apache and Tomcat

Source: Internet
Author: User
Tags centos tomcat apache tomcat

1, download Apache Tomcat

Download Address: http://tomcat.apache.org/download-70.cgi

FileName: apache-tomcat-7.0.27.tar.gz

Put the downloaded installation package in the server's/tmp directory

2. Start installing Apache Tomcat

[Root@c1091test tmp]# TAR-XZVF apache-tomcat-7.0.27.tar.gz//Decompression

[Root@c1091test tmp]# MV Apache-tomcat-7.0.27/usr/local/tomcat//move uncompressed files to/usr/local/tomcat

[Root@c1091test tmp]# cd/usr/local/tomcat/Enter Tomcat directory

[Root@c1091test tomcat]# LS//view Tomcat directory

Bin Lib Logs release-notes temp work

conf LICENSE NOTICE RUNNING.txt WebApps

Apache Tomcat installation is complete, is actually a decompression process. The following opens Apache Tomcat and the Apache Tomcat writes to the boot run queue:

(1, Apache Tomcat launch command:/usr/local/tomcat/bin/startup.sh

(2, Apache Tomcat stop command:/usr/local/tomcat/bin/shutdown.sh

(3, Apache Tomcat boot start setting: Echo "/usr/local/tomcat/bin/startup.sh" >>/etc/rc.local

3. Configure Tomcat Environment variables

Edit ~/.bash_profile Add Tomcat environment parameters

Tomcat_home=/usr/local/tomcat

Export PATH java_home CLASSPATH tomcat_home

Save exit, then execute source ~/.bash_profile, let environment variable take effect

Now start the Tomcat service:/usr/local/tomcat/bin/startup.sh

Then enter the NETSTART–TNL for listening, and if you can see 8080 and 80,092, it means Tomcat has started normally.

The following is an access test to see if you can access the Web page: http://localhost:8080, you can see the Web page to show that Tomcat has been installed successfully.

Related Article

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.