In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Install TomCat service and related optimization
In the previous blog of , we talked about the Httpd service and Nginx service in the website service. This blog will bring you another TomCat service of the website service.
Overview of TomCat
Tomcat is a core project of the Jakarta project of the Apache Software Foundation (Apache Software Foundation), which is jointly developed by Apache, Sun and other companies and individuals.
Tomcat server is a free and open source Web application server, which is a lightweight application server. It is widely used in small and medium-sized systems and not many concurrent access users. It is the first choice for developing and debugging JSP programs.
Tomcat composition
Web container: Web server
Servlet container: named catalina, used to process Servlet code
JSP container: translating JSP dynamic web pages into Servlet code
Tomca deployment steps (simple)
1. Download and install jdk
two。 Install and start Tomcat
3. Configure virtual host
Tomca deployment steps (details) 1. Install JDK [root @ localhost tomcat] # ls 12D18CFCD6599AFF0445766ACC4CA231C5025773.torrent apache-tomcat-9.0.16.tar.gzapache-jmeter-5.1 jdk-8u201-linux-x64.rpmapache-jmeter-5.1.zip tomcat optimized stress test. JMX # install jdk environment package [root@localhost tomcat] # rpm-ivh jdk-8u201-linux-x64.rpm [root@ Localhost tomcat] # cd / usr/java/jdk1.8.0_201-amd64/2 、 Modify the global configuration file [root@localhost jdk1.8.0_201-amd64] # vim / etc/profile # # Global configuration file export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64 export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar export PATH=$JAVA_HOME/bin:$ path [root @ localhost jdk1.8.0_201-amd64] # source / etc/profile # # execute the configuration file When restarting) [root@localhost jdk1.8.0_201-amd64] # cd / mnt/tomcat/3, Install Tomcat ontology [root@localhost tomcat] # tar zxvf apache-tomcat-9.0.16.tar.gz-C / usr/local/ [root@localhost tomcat] # cd / usr/local/ [root@localhost local] # mv apache-tomcat-9.0.16/ tomcat#### to facilitate startup Establish start / stop soft link [root@localhost local] # ln-s / usr/local/tomcat/bin/startup.sh / usr/local/bin/ [root@localhost local] # ln-s / usr/local/tomcat/bin/shutdown.sh / usr/local/bin/4, enable service [root@localhost local] # startup.sh [root@localhost local] # systemctl stop firewalld.service [root@localhost local] # setenforce 05, verify
Create a Tomcat virtual host
Tomcat server, which allows users to configure multiple Web sites on the same computer, in which case, you need to configure a different hostname, that is, a virtual host, for each Web site. In real life, in order to improve the utilization of hardware resources, many websites realize the sharing of servers by configuring virtual hosts.
# install DNS [root @ localhost ~] # yum install bind-y [root@localhost ~] # vim / etc/named.conf### snooping port 53 change to any### allow localhost to change to any [root@localhost ~] # vim / etc/named.rfc1912.zones zone "accp.com" IN {type master; file "named.accp"; allow-update {none;};} Zone "kgc.com" IN {type master; file "named.kgc"; allow-update {none;};} [root@localhost ~] # cp-p / var/named/named.localhost / var/named/named.accp www IN A 192.168.142.128 [root@localhost ~] # vim / var/named/named.accp [root@localhost ~] # cp-p / var/named/named.accp / var/named/named.kgc [root@localhost ~] # systemctl start named#### create kgc and accp project site [root@localhost ~] # mkdir / usr/local/tomcat/ Webapps/kgc [root@localhost ~] # mkdir / usr/local/tomcat/webapps/accp [root@localhost ~] # echo "KGC test" > / usr/local/tomcat/webapps/kgc/index.jsp [root@localhost ~] # echo "ACCP test" > / usr/local/tomcat/webapps/accp/index.jsp#### modify the main configuration file [root@localhost local] # vim / usr/local/tomcat/conf/server.xml [root@localhost local] # shutdown.sh [root@localhost local] # startup.sh overall optimizes Tomcat [root @ localhost local] # vim / usr/local/tomcat/conf/server.xml # # response compressed file format
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.