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

How to install Nginx in CentOS

Official documentation: https://nginx.org/en/linu...

Learn the common methods and techniques in JS arrays and become a master

Table of contents splice() Method join() Method r...

How to use Nginx to handle cross-domain Vue development environment

1. Demand The local test domain name is the same ...

Detailed explanation of the use of state in React's three major attributes

Table of contents Class Component Functional Comp...

HTML code to add icons to transparent input box

I was recently writing a lawyer recommendation we...

Common problems in implementing the progress bar function of vue Nprogress

NProgress is the progress bar that appears at the...

Several ways to remove the dotted box that appears when clicking a link

Here are a few ways to remove it: Add the link dir...

idea uses docker plug-in to achieve one-click automated deployment

Table of contents environment: 1. Docker enables ...

Detailed steps to install Mysql5.7.19 using yum on Centos7

There is no mysql by default in the yum source of...

Causes and solutions for MySQL deadlock

The database, like the operating system, is a sha...

Windows Server 2019 IIS10.0+PHP(FastCGI)+MySQL Environment Construction Tutorial

Preparation 1. Environmental Description: Operati...

Building a Redis cluster on Docker

Table of contents 1. Pull the image 2. Create a R...

Detailed explanation of MySql 5.7.17 free installation configuration tutorial

1. Download the mysql-5.7.17-winx64.zip installat...

Vue implements login type switching

This article example shares the specific code of ...