Cemtos 7 Linux Install and uninstall Tomcat 7

Source: Internet
Author: User

First, statement:

This article uses the operating system version: Centos 7 Linux system
Version Source: Centos-7-x86_64-dvd-1708.iso
Official website: Http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso
Installation package Selection: Minimum installation package (with JDK installed and vim function)

Ii. preparations for the installation of Tomcat 7

Download the Tomcat installation package from the Apache official website (we recommend using the installation file in the form of a tar package)

Official website:http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.82/bin/apache-tomcat-7.0.82.tar.gz

  2.1 Upload the Tomcat installation file to the Linux system via FTP software

The niche is placed under the/var/ftp/pub folder.

  2.2 Unzip the file and cut to/directory

Unzip file:tar-zxvf apache-tomcat-7.0.82.tar.gz

Move to the root directory:mv apache-tomcat-7.0.82.tar.gz/

Renaming files:mv apache-tomcat-7.0.82.tar.gz./TOMCAT7

 Third, start Tomcat

See if the. sh file under the /tomcat7/bin/ directory is executable

Use the LL command to view file usage rights

If the file is not available, use the command:

  chmod 755./*.sh

Modify all the. sh files in the current directory to make them executable files

Run Tomcat:./startup.sh

Close tomcat: ./shutdowm.sh

Four, firewall configuration

 Open 8080 Ports:

   Firewall-cmd--zone=public--add-port=8080/tcp--permanent

Restarting the firewall

   Firewall-cmd--reload

V. Setting up tomcat boot from boot

4.1 Edit Tomcat.service Profile:vim/lib/systemd/system/tomcat.service   

[Unit]description=tomcatafter=Network.target[service]type=oneshot# Note that the tomcat path write is modified correctly Execstart=/tomcat7/bin/startup. SH execstop=/tomcat7/bin/shutdown. SH execreload=/bin/kill -s HUP $MAINPIDRemainAfterExit=Yes[install]wantedby= Multi-user.target

4.2 Start-up service: systemctl start Tomcat.service

4.3 View service Status:systemctl status Tomcat.service

4.4 Set up boot from:systemctl enable Tomcat.service

Description: No boot from boot:systemctl disable Tomcat.service

Cemtos 7 Linux Install and uninstall Tomcat 7

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.