In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Introduction to 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. With the participation and support of Sun, 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 its advanced technology, stable performance and free, Tomcat is deeply loved by Java enthusiasts and recognized by some software developers, and has become a popular Web application server.
Advantages of Tomcat
1. It has both expandability and security of du. If the number of access requests zhi increases sharply per unit time, you can use a relatively low fee dao to increase the front-end capacity.
2. It is easy to expand. Because it is a single servlet container running on this powerful server, there is no need to consider complex issues such as the maintenance of session state in a distributed environment.
3. The back-end server is not accessible to the outside world, and the hackers on the Internet can only access the front-end web server, but not the back-end application server directly, which improves the security. But this does not mean that hackers cannot carry out other forms of attack through web browsers.
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.
First, Tomcat optimization (memory and threads are its performance bottlenecks):
The default configuration of Tomcat is not suitable for the production environment, it will frequently appear fake death phenomenon and need to be rebooted. Only through continuous stress testing and optimization can it run stably and efficiently. Optimization has three main aspects:
1. Optimize the operating system (kernel parameters) respectively.
2. Parameter optimization of Tomcat configuration file
3. Java virtual machine (JVM) tuning
Next, it introduces the comparison of the data before and after tuning with jmeter pressure testing tool.
Jdk needs to be installed on the client first.
This is the uncompressed value tested with the jmeter tool:
Step 1: modify the / usr/local/tomcat/conf/server.xml file
# # response compressed file format
Step 2: restart the service
Step 3: then use the jmeter tool to test the pressure on the client, which is the value of the optimized test.
By comparison, we find that the modified and optimized average value has a very sharp reduction, through continuous pressure test optimization in order to make it run stably and efficiently.
Second, configure virtual hosts:
Step 1: install the DNS service, set up the corresponding IP address and domain name resolution, and verify whether it is correct to resolve it with the client.
Step 2: create kgc and accp project directories and files.
File location: / usr/local/tomcat/webapps/, creates the following two directories and files respectively:
Kgc/index.jsp
Accp/index.jsp
Step 3: modify the configuration file
Vim / usr/local/tomcat/conf/server.xml, add the following code:
Step 4: restart the tomcat service
(1) restart the service
Shutdown.sh / / close startup.sh / / enable
(2) verify on the client
Enter http://www.kgc.com:8080/ and http://www.accp.com:8080/ on the browser
At this point, the virtual host configuration and all are complete.
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.