Category: Web

Apache (16)
GlassFish (0)
HAProxy (2)
IIS (20)
Nginx (55)
Other (4)
Tomcat (17)

How to Bind Tomcat to an IP Address

Sometimes when Tomcat needs to serve as a backend server, you may need to bind it to a specific internal network IP address. Here’s how to do it.

Open the server.xml configuration file in the configuration directory and add the IP binding connection statement to the normal configuration:
address="192.168.201.59"
As shown below:

Replace the IP above with your own …

How to Fix Tomcat %2F Escape Issue

Tomcat does not process %2F by default, but sometimes you need to handle spaces. Here’s how to modify it:
Go to the tomee/conf directory:
vi catalina.properties
Add the following line at the bottom:
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true …

How to Rotate Tomcat Logs With Logrotate on Linux

Tomcat may encounter oversized catalina.out logs during use. Below we leverage the system’s built-in logrotate utility (using CentOS as an example) to rotate files, enabling automatic daily log file rotation.

The logrotate program, by default, will rotate files defined under /etc/logrotate.d/. The following …

How to Add Yunsuo WAF Module to Tengine

Note: This article applies to servers where Tengine was previously installed but the Cloud Lock module was not installed.
Environment: CentOS, Cloud Lock, Tengine
yum -y install jemalloc pcre* openssl*Backup before installation: cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx …

How to Hide Tomcat/TomEE Version Number

Sometimes for server security, certain information must not be exposed — including the Tomcat server version number.

Before modification, it appears as follows:

1. Navigate to the Tomcat installation path (this example uses /usr/local/tomcat):
cd /usr/local/tomcat/lib
unzip catal …

How to Fix configure: error: can’t locate a valid JDK location

How to Fix "Can’t Locate a Valid JDK Location" Error When Installing tomcat-native
If you encounter the "Can’t locate a valid JDK location" error when installing tomcat-native, use the following method to resolve it.
The reason is that the program only searches for the JDK in the following default directories:
configure: [/ usr/local/1.6.1]
configure: [/ usr/local/IBM …

Tomcat and TomEE Optimization Guide

Here we take TomEE as an example, assuming the installation directory is /usr/local/tomee.

1. JVM memory setting optimization;

vi /usr/local/tomee/bin/catalina.sh
Add the following information:

JAVA_OPTS='-Xms2024m -Xmx6048m -XX:PermSize=256M -XX:MaxNewSize=256 …