How to change the tomcat port number in Linux

How to change the tomcat port number in Linux

I have several tomcats here. If I use them at the same time, I need to change the port numbers to different ones:

1. First, cd into the conf folder in the tomcat directory and open the server.xml configuration file with vi

[root@localhost soft]# ls
download redis solrhome tomcat-sina-8081 tomcat-souhu-8082
jdk redis-3.0.0.gem tomcat tomcat-solr zookeeper-3.4.6
[root@localhost soft]# cd tomcat-solr/
[root@localhost tomcat-solr]# cd conf/
[root@localhost conf]# ls
Catalina catalina.properties logging.properties tomcat-users.xml
catalina.policy context.xml server.xml web.xml
[root@localhost conf]# vim server.xml

2. Change 1

8005 changed to 8885

<Server port="8885" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />

3. Change 2

8080 changed to 8888

<Connector port="8888" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

4. Change 3

8009 changed to 8889

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8889" protocol="AJP/1.3" redirectPort="8443" />

5. wq save and exit

Finally, try starting it in the bin directory of tomcat: ./startup.sh: OK

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Various problems and solutions in the process of deploying Tomcat to release projects on Linux
  • Linux (center OS7) installs JDK, tomcat, mysql to build a java web project running environment
  • Detailed graphic tutorial on installing and uninstalling Tomcat8 on Linux
  • Steps to monitor Tomcat status and start it automatically using shell scripts under Linux
  • Install tomcat and deploy the website under Linux (recommended)
  • Linux (CentOS7) installs Tomcat and sets Tomcat as a startup item (taking tomcat8 as an example)
  • Install three or more tomcats under Linux system (detailed steps)
  • How to start and stop Tomcat service by writing shell script in Linux environment

<<:  Detailed explanation of mysql integrity constraints example

>>:  Native JS to implement paging click control

Recommend

Three common methods for HTML pages to automatically jump after 3 seconds

In practice, we often encounter a problem: how to...

A brief discussion on spaces and blank lines in HTML code

All consecutive spaces or blank lines (newlines) ...

Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)

Download and install JDK Step 1: First download t...

Summary of common MySQL table design errors

Table of contents Mistake 1: Too many columns of ...

How to create a my.ini file in the MySQL 5.7.19 installation directory

In the previous article, I introduced the detaile...

Detailed explanation of the function and usage of DOCTYPE declaration

1. Browser rendering mode and doctype Some web pa...

How to handle the tcp_mark_head_lost error reported by the Linux system

Problem Description Recently, a host reported the...

The One-Hand Rule of WEB2.0

<br />My previous article about CSS was not ...

How to prompt and open hyperlink a

<br />The countless information on the Inter...

MySQL learning database operation DML detailed explanation for beginners

Table of contents 1. Insert statement 1.1 Insert ...

Nginx high concurrency optimization practice

1. Necessity of Tuning​ I have always been reluct...

Detailed summary of web form submission methods

Let's first look at several ways to submit a ...

MySQL 8.0.17 installation graphic tutorial

This article shares with you the MySQL 8.0.17 ins...

Summary of learning HTML tags and basic elements

1. Elements and tags in HTML <br />An eleme...