Category: Tomcat

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 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 …

How to Configure Server Status, Manager App, and Host Manager in Tomcat 7

After a default installation, the interface looks like this — there are three buttons on the right side of the homepage that you can click to enter the backend:

Below, I’ll use my test environment where Tomcat is installed at ​/usr/local/tomcat/ as an example:
The default login user and password in /usr/local/tomcat/conf/tomcat-users.xml are commented out, so logging in …

How to Start Tomcat on Linux

Tomcat does not start automatically, so you need to start it manually when booting up the server; otherwise, it won’t be accessible.
Use the cd command to locate and enter the Tomcat directory: #cd bin
#ls After running ls, you’ll see many scripts and files inside. Execute the following command: #sh startup.sh

If it returns …