Installing Tomcat under Linux

Source: Internet
Author: User
Tags tomcat server

Tomcat:

Tomcat is a core project of the Apache Software Foundation (Apache Software Foundation) Jakarta Project, developed by Apache, Sun, and other companies and individuals. With Sun's involvement and support, the latest servlet and JSP specifications are always reflected in Tomcat, and Tomcat 5 supports the latest servlet 2.4 and JSP 2.0 specifications. Because of the advanced Tomcat technology, stable performance, and free, so deeply loved by Java enthusiasts and have been recognized by some software developers, become the most popular Web application server.

Tomcat server is a free open source Web application server, belongs to the lightweight application server, in small and medium-sized systems and concurrent access users are not widely used, is the first choice to develop and debug JSP programs. For a beginner, it can be thought that when the Apache server is configured on a single machine, it can respond to requests for access to the HTML (one application under the standard Universal Markup Language) page. In fact, Tomcat is an extension of the Apache server, but it runs independently at runtime, so when you run Tomcat, it actually runs separately as a separate process from Apache.

The trick is that when configured correctly, Apache serves HTML pages, while Tomcat actually runs JSP pages and Servlets. In addition, like a Web server such as IIS, Tomcat has the ability to handle HTML pages, and it is also a servlet and JSP container, and the standalone servlet container is the default mode for Tomcat. However, Tomcat is less capable of handling static HTML than the Apache server. Currently, the latest version of Tomcat is 9.0.


The software version used here

Apache-tomcat-8.0.45.tar.gz

Jdk-8u144-linux-x64.tar.gz

Software is directly on the Tomcat's official website download on the line, no more talking about following me along with how to install Tomcat

[[Email protected] ~] #useradd-U 601 Tomcat

[[Email protected] ~] #tar XF jdk-8u144-linux-x64.tar.gz

[[Email protected] ~] #mv jdk1.8.0_144//usr/local/

[[Email protected] ~] #ln-S/usr/local/jdk1.8.0_144//usr/local/jdk

[[Email protected] ~] #tar XF apache-tomcat-8.0.45.tar.gz

[Email protected] ~]# MV apache-tomcat-8.0.45/usr/local/

[Email protected] ~]# ln-s/usr/local/apache-tomcat-8.0.45//usr/local/tomcat

[Root[email protected] local]# vim/etc/profile

Export JAVA_HOME=/USR/LOCAL/JDK

Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH

Export classpath=. $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/lib: $JAVA _home/lib/tools.jar

Export Tomcat_home=/usr/local/tomcat

[Email protected] local]# Source/etc/profile

[[Email protected] local]# CD

[Email protected] ~]# java-version

Java Version "1.8.0_144"

Java (TM) SE Runtime Environment (build 1.8.0_144-b01)

Java HotSpot (TM) 64-bit Server VM (build 25.144-b01, Mixed mode)


[Email protected] ~]#

[Email protected] ~]# chown-r TOMCAT:TOMCAT/USR/LOCAL/JDK

[Email protected] ~]# chown-r tomcat:tomcat/usr/local/tomcat/

[Email protected] ~]#

[Email protected] ~]# Su-tomcat

[Email protected] ~]$ cd/usr/local/tomcat/


/usr/local/tomcat/bin/startup.sh

-bash:/usr/local/tomcat/bin/startup.sh:permission denied

Workaround

[Email protected] ~]# chmod u+x/usr/local/tomcat/bin/*.sh


Touch:cannot Touch '/usr/local/tomcat/logs/catalina.out ': No such file or directory

/usr/local/tomcat/bin/catalina.sh:line 433:/usr/local/tomcat/logs/catalina.out:no such file or directory

Workaround

[Email protected] ~]# Mkdir/usr/local/tomcat/logs

Touch:cannot Touch '/usr/local/tomcat/logs/catalina.out ': Permission denied

/usr/local/tomcat/bin/catalina.sh:line 433:/usr/local/tomcat/logs/catalina.out:permission denied

Workaround

chmod a+rwx-r/usr/local/tomcat/logs/

Start Tomcat

[Email protected] ~]$/usr/local/tomcat/bin/startup.sh

Using catalina_base:/usr/local/tomcat

Using Catalina_home:/usr/local/tomcat

Using Catalina_tmpdir:/usr/local/tomcat/temp

Using Jre_home:/USR/LOCAL/JDK

Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

Tomcat started.

See if port 8080 is listening.

[Email protected] ~]# SS-TNL

State recv-q send-q Local address:port Peer address:port

LISTEN 0 *:60256 *:*

LISTEN 0 1:: ffff:127.0.0.1:8005:::*

LISTEN 0::: 8009:::*

LISTEN 0::: 111:::*

LISTEN 0 *:111 *:*

LISTEN 0::: 8080:::*

LISTEN 0::: 53301:::*

LISTEN 0::: $:::*

LISTEN 0 *:22 *:*

LISTEN 0 127.0.0.1:631 *:*

LISTEN 0:: 1:631:::*

LISTEN 0:: 1:25:::*

LISTEN 0 127.0.0.1:25 *:*

Then verify that the server IP +8080 is successfully entered in the browser


650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/9E/2B/wKioL1mNKvrTspH7AAFQpDAsRok803.jpg-wh_500x0-wm_ 3-wmp_4-s_3153276540.jpg "title=" installation complete. jpg "alt=" wkiol1mnkvrtsph7aafqpdasrok803.jpg-wh_50 "/>





Installing Tomcat under 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.