UbuntuServer12.04 install Tomcat7.0.40

Source: Internet
Author: User
UbuntuServer12.04 because of source version problems, the automatic installation package on the source is not used. Old Rules: Tomcat7.0.40Core: uninstall :~ 1. Still

Install Tomcat 7.0.40 on Ubuntu Server 12.04

Because of source version issues, so no use of Source Automatic Installation Package, old rules, Tomcat 7.0.40 Core: http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.40/bin/apache-tomcat-7.0.40.tar.gz

Enter the root directory of the currently logged-on user :~

1. decompress the package

Tar-xzf apache-tomcat-7.0.40.tar.gz

Obtain the apache-tomcat-7.0.40 folder.

2. Change the name. Otherwise, it hurts:

Mv apache-tomcat-7.0.40 tomcat

3. Add/usr/local/

Sudo mv tomcat/usr/local/

4. Enter/usr/local/tomcat

Cd/usr/local/tomcat

5. Change users (Security First)

Sudo chown-R root.

Sudo chgrp-R root.

6. Add Environment Variables

Sudo su-

Vi/etc/profile

Add at the bottom:
CATALINA_HOME =/usr/local/tomcat

Export CATALINA_HOME

Save and exit

Refresh variable

Source/etc/profile

7. Enter $ CATALINA_HOME/bin

Cd $ CATALINA_HOME/bin

8. Modify catalina. sh.

Vi catalina. sh, find

# OS specific support. $ var _ must _ be set to either true or false.

Define CATALINA_HOME and JAVA_HOME again in this line:

CATALINA_HOME =/usr/local/tomcat

JAVA_HOME =/usr/local/java/jdk1.7.0 _ 21

Save and exit

9. log out of the root account and try to start tomcat.

Logout

Sudo./bin/startup. sh

If the following is displayed without any exception, the startup is successful:

Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/local/java/jdk1.7.0 _ 21
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/tomcat-juli.jar

10. Stop tomcat: sudo./bin/shutdown. sh

11. Install the tomcat service:

Sudo cp bin/catalina. sh/etc/init. d/tomcat

View services:

Sudo service tomcat status

Lists A Bunch Of operation options, indicating that the service is properly installed.

12. start tomcat

Sudo update-rc.d-f tomcat ults

13. Start a service.

Sudo service tomcat start

14. If there is no problem, restart and try again ..

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.