I'm trying to set up a MySQL database to use it externally. I have a Ubuntu server with Plesk and Docker.
The main problem is that when logged in the server the port seems to be used/open, but externally it doesn't.
When I try to log in locally there's no problem, as it shows the port 6991 as open.
root@server:/# nmap -p 6990-6992 localhost
Starting Nmap 7.80 ( https://nmap.org ) at 2023-10-13 09:37 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000034s latency).
rDNS record for 127.0.0.1: localhost.localdomain
PORT STATE SERVICE
6990/tcp open unknown
6991/tcp open unknown
6992/tcp closed unknown
Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
When I execute the same nmap
from an external machine:
user2@server2:/# nmap -p 6990-6992 [public ip]
Starting Nmap 7.80 ( https://nmap.org ) at 2023-10-13 09:45 UTC
Nmap scan report for [URL] ([public ip])
Host is up (0.000085s latency).
Other addresses for [URL] (not scanned):
PORT STATE SERVICE
6990/tcp closed unknown
6991/tcp closed unknown
6992/tcp closed unknown
Nmap done: 1 IP address (1 host up) scanned in 0.14 seconds
The firewall ports 6991 and 6990 of the server vendor are open too.
I've tried to check the ports to start a simple python http
server and this works.
root@server:/# docker stop mysql
mysql
root@server:/# python3 -m http.server 6991
Serving HTTP on 0.0.0.0 port 6991 (http://0.0.0.0:6991/) ...
user2@server2:/# nmap -p 6991 [public ip]
Starting Nmap 7.94 ( https://nmap.org ) at 2023-10-13 11:52 UTC
Nmap scan report for [URL] ([public ip])
Host is up (0.020s latency).
PORT STATE SERVICE
6991/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.36 seconds
Maybe some Plesk magic is blocking the port?
I've also tried to set MYSQL_TCP_PORT
directly to 6991 but Docker doesn't expose this port. I can't redirect with Plesk interface.