Solution to the inaccessibility of Tencent Cloud Server Tomcat port

Solution to the inaccessibility of Tencent Cloud Server Tomcat port

I recently configured a server using Tencent Cloud. When using it, I found that the tomcat port was inaccessible, so I looked for some information on the Internet. There are two situations in total. I summarize them below. I hope it will be helpful to everyone and also leave a note for myself.

First case:

As the title says: https://console.cloud.tencent.com/cvm/securitygroup You need to go to this address to set up a security group.

To be honest, I don't know whether I should say "mmp" or not. The instructions for use are too confusing.

Of course, changing the security group and firewall still doesn't work. So I checked Tomcat's records and found:

/home/apache-tomcat-8.5.37/bin/catalina.sh: line 482: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/bin/java: No such file or directory

This is obviously a problem with the environment variable configuration. The reason is that the previous installation diagram I used was simple and practical yum installation, and the environment variables were three lines of code copied from the Internet, and I didn't check carefully to see if they were correct. Okay, let’s take a dive once.

Of course, this problem can also be seen by checking the running status of tomcat

ps -ef|grep tomcat

The picture above is problematic.

This is normal, which is affected by the Java environment variable configuration.

The actual installed JDK information does not match the environment variable configuration. So I modified the java version information in the environment variable, and finally it was done

Modifying environment variables is described in my previous blog

Tencent Cloud deploys one of the Java Web projects, application server

Second case:

Enter the command netstat -tunlp and you can see that port 8080 is not open at all. How can I access it?

So how to enable it? Because Centos7 and above use firewalld instead of iptables, that is to say, firewalld should open port 8080.

1. Check the firewall status.

firewall-cmd --state #Check the firewall status.

The result is running or not running

If not turned on

systemctl start firewalld

2. In the running state, add the ports that need to be opened to the firewall

firewall-cmd --permanent --zone=public --add-port=8080/tcp #Permanently add this port. Remove --permanent to indicate temporary.

The corresponding shutdown command is

firewall-cmd --zone=public --remove-port=8080/tcp --permanent

3. Load the configuration to make the changes effective.

firewall-cmd --reload

Use the command to check the open ports, and 8080/tcp appears, which is opened correctly.

firewall-cmd --permanent --zone=public --list-ports

Don't forget to restart the firewall.

systemctl start firewalld.service

Check again that port 8080 is open

The most annoying thing is Tencent Cloud's server, after all these and the security group are set up. You have to wait for a while, and then access to Tomcat will be successful.

Any access errors that occurred during this time were not related to the operation. The delay is severe.

This is the end of this article about the solution to the problem that the tomcat port of Tencent Cloud Server is inaccessible. For more relevant content about the problem that the tomcat port of Tencent Cloud is inaccessible, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Tutorial on installing and configuring Tomcat on Alibaba Cloud Server and adding external network access ports
  • Tomcat multi-port domain name access and configuration to enable gzip compression method
  • Detailed explanation of setting the default server and accessing without port name in Tomcat 7.0
  • How to implement multi-port and multi-domain access to a tomcat
  • Jsp and PHP share port 80 to integrate Apache and Tomcat (no need to add port number when accessing)

<<:  Web front-end performance optimization

>>:  Vue.js style layout Flutter business development common skills

Recommend

Tips on disabling IE8 and IE9's compatibility view mode using HTML

Starting from IE 8, IE added a compatibility mode,...

Manjaro installation CUDA implementation tutorial analysis

At the end of last year, I replaced the opensuse ...

Node and Python two-way communication implementation code

Table of contents Process Communication Bidirecti...

Detailed tutorial on using Docker to build Gitlab based on CentOS8 system

Table of contents 1. Install Docker 2. Install Gi...

Example code for CSS pseudo-classes to modify input selection style

Note: This table is quoted from the W3School tuto...

Measured image HTTP request

Please open the test page in a mainstream browser...

3 ways to correctly modify the maximum number of connections in MySQL

We all know that after the MySQL database is inst...

Basic Implementation of AOP Programming in JavaScript

Introduction to AOP The main function of AOP (Asp...

10 content-related principles to improve website performance

<br />English address: http://developer.yaho...

Summary of common tool functions necessary for front-end development

1. Time formatting and other methods It is recomm...

How to embed other web pages in a web page using iframe

How to use iframe: Copy code The code is as follo...

CentOS6.8 uses cmake to install MySQL5.7.18

Referring to the online information, I used cmake...

HTTP return code list (Chinese and English explanation)

http return code list (below is an overview) for ...