Linux Tomcat8.5 Installation and environment configuration graphics and text tutorial __linux

Source: Internet
Author: User
Tags iptables tomcat server




"Linux Tomcat8.5.24 Installation and environment configuration graphics and text tutorial"




About Tomcat:
Tomcat server is a free open source Web application Server, is a lightweight application server, in the small and medium-sized systems and concurrent access users are not many occasions are widely used, is the first choice to develop and debug JSP programs.

Tomcat is actually an extension of the Apache server, but it runs independently of the runtime, so when you run Tomcat, it actually runs as a standalone process with Apache.


If the Java runtime environment is not installed, refer to here:

"Linux Jdk1.8 installation and environment variable configuration Tutorial"



Download Tomcat:
Tomcat-7.0.82_for_linux csdn Download
Tomcat-8.5.24_for_linux csdn Download
Tomcat-9.0.2_for_linux Latest Version tomcat Web server download


After the tomcat download is complete, unpack and upload the file at the end of ". Gz" directly to Linux, as shown below:




Upload to Linux, need to decompress, input command "TAR-ZXVF apache-tomcat-8.5.24.tar.gz" for decompression, here will no longer introduce decompression command, the following figure:




We also need to copy tomcat to the specified folder in order to facilitate the management of the post program.

Enter the command "CP Apache-tomcat-8.5.24/usr/local/tomcat-r", as shown in the following figure:




Save system memory space, need to remove Tomcat useless packets, enter "Rm-rf *", the following figure:




It is now OK to say that starting Tomcat does not have normal access, we need to open "8080" port;
Here's the thing to note if you're as Centos7 as my system:
The input command "Firewall-cmd--zone=public--add-port=8080/tcp--permanent" adds 8080 ports to the firewall;

Enter the command "Firewall-cmd--reload" reload the firewall so that the open 8080-port eloquence takes effect;




Note: If your system is CENTOS6 and the following version, then find the iptables configuration file;
And at the end of the file, add "-A input-m State--state new-m tcp-p TCP--dport 8080-j ACCEPT";
Then type "service iptables restart" to reboot the firewall.
After opening port 8080 in the firewall, you can enter the "IP: Port number" in the browser, as shown in the following figure:



Registering Tomcat as a system service;
Enter command "Cp-p/usr/local/tomcat/bin/catalina.sh/etc/init.d/tomcat"
Edit startup file, enter command "Vi/etc/init.d/tomcat"

The following figure:




Special statement: The copy is "catalina.sh", I remember the last time a little brother asked me to help him, did me two days, finally I asked him here copy is that, he said to me is "startup.sh", and I explained that online add are CP "startup.sh", I was Fire cap three feet, then almost put the computer to his smashed.
(So be sure to note that many of the web is copied and pasted, fraught, I have a picture here has the truth.) )
In the second line, add the following:
# chkconfig:112 63 37
# Description:tomcat Server init script
# Source Function Library
. /etc/init.d/functions


java_home=/usr/local/jdk/
Catalina_home=/usr/local/tomcat

The following figure:




Note: Be sure to pay attention to the path of the JDK, this is a mistake, make it very troublesome (personal experience ...) )

Register the Tomcat service and enter it sequentially

Authorized:

chmod 755/etc/init.d/tomcat

Add to service:

Chkconfig--add Tomcat

Power-on start: Chkconfig Tomcat on

The following figure:




Start the Tomcat service, enter the command "service Tomcat Stop/service Tomcat start", and a OK hint stating that the Tomcat service stopped/started successfully, as shown in the following figure:




About Linux under the Tomcat8.0 installation and configuration graphics and text tutorial is written here.
Finally again, be sure to pay attention to the path, there is CP when the note file name and case.
I have stressed enough in this blog post, if you still want to match the wrong, then I have no way.
Must pay attention to the detail problem, the detail decides success or failure ...

If the period also encountered any problems, welcome message ...








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.