VPS Hosting and ports : Episode 3
- Atul
- Technology , Web , Free software , The big o community , Vps
- May 23, 2025
Table of Contents
VPS Hosting and ports : Episode 3
- Drawing
Ports
root@atulya:~/frappe_docker# sudo netstat -tulnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:5280 0.0.0.0:* LISTEN 692956/lua
tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN 692956/lua
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 692928/mariadbd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 692846/postgres
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 760740/nginx: maste
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 760740/nginx: maste
tcp 0 0 193.203.163.151:3478 0.0.0.0:* LISTEN 692805/turnserver
tcp 0 0 193.203.163.151:3478 0.0.0.0:* LISTEN 692805/turnserver
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 692826/sshd: /usr/s
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 692825/systemd-reso
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 694319/docker-proxy
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 693229/exim4
tcp 0 0 127.0.0.1:35333 0.0.0.0:* LISTEN 691529/containerd
tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN 692825/systemd-reso
tcp 0 0 0.0.0.0:5269 0.0.0.0:* LISTEN 692956/lua
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 692825/systemd-reso
tcp 0 0 0.0.0.0:5281 0.0.0.0:* LISTEN 692956/lua
tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN 692956/lua
tcp6 0 0 :::5000 :::* LISTEN 692956/lua
tcp6 0 0 ::1:25 :::* LISTEN 693229/exim4
tcp6 0 0 :::22 :::* LISTEN 692826/sshd: /usr/s
tcp6 0 0 :::8080 :::* LISTEN 694325/docker-proxy
tcp6 0 0 ::1:5280 :::* LISTEN 692956/lua
tcp6 0 0 :::5355 :::* LISTEN 692825/systemd-reso
tcp6 0 0 :::5269 :::* LISTEN 692956/lua
tcp6 0 0 :::5281 :::* LISTEN 692956/lua
tcp6 0 0 ::1:5432 :::* LISTEN 692846/postgres
tcp6 0 0 2a02:4780:12:1c7b::3478 :::* LISTEN 692805/turnserver
tcp6 0 0 2a02:4780:12:1c7b::3478 :::* LISTEN 692805/turnserver
tcp6 0 0 :::5222 :::* LISTEN 692956/lua
udp 0 0 0.0.0.0:5355 0.0.0.0:* 692825/systemd-reso
udp 0 0 193.203.163.151:3478 0.0.0.0:* 692805/turnserver
udp 0 0 193.203.163.151:3478 0.0.0.0:* 692805/turnserver
udp 0 0 127.0.0.54:53 0.0.0.0:* 692825/systemd-reso
udp 0 0 127.0.0.53:53 0.0.0.0:* 692825/systemd-reso
udp6 0 0 :::5355 :::* 692825/systemd-reso
udp6 0 0 2a02:4780:12:1c7b::3478 :::* 692805/turnserver
udp6 0 0 2a02:4780:12:1c7b::3478 :::* 692805/turnserver
root@atulya:~/frappe_docker#
The Digital Kingdom: Ports & Protocols Adventure
A Journey Through the Network Realm
Welcome, brave traveler! You stand at the gates of the Digital Kingdom, where mysterious ports and powerful services guard the flow of data. Your mission is to explore this land, uncover its secrets, and understand who controls which gate (port).
πΊοΈ Map of the Digital Kingdom
(A visual guide to the ports and their guardians)
π The Great Gates (0.0.0.0 & ::: β Open to All)
These ports allow entry from anywhere in the realm!
Port | Guardian (Service) | Role in the Kingdom |
---|---|---|
80 | Nginx (Master) | The Web Gatekeeper β Allows HTTP travelers into the land. |
443 | Nginx (Master) | The Royal SSL Gate β Encrypts all messages (HTTPS). |
22 | OpenSSH | The Secure Tunnel β Only trusted knights (admins) may pass. |
3478 | TURN Server | The Ice Mage β Helps with WebRTC (video calls & gaming). |
5000 | Lua (Mystic Script) | A secret service β Possibly a custom app or API. |
5222 | Lua (XMPP?) | The Messengerβs Port β Used for chat (Jabber/XMPP). |
5269 | Lua (XMPP Server?) | The Messengerβs HQ β For server-to-server chat. |
8080 | Docker Proxy | The Dockworker β A containerized service (possibly web). |
π° The Inner Keep (127.0.0.1 & ::1 β Local Only)
These ports are locked inside the castle wallsβonly local services may enter.
Port | Guardian (Service) | Role in the Kingdom |
---|---|---|
3306 | MariaDB | The Royal Database β Stores all kingdom secrets. |
5432 | PostgreSQL | The Second Database β Another vault of knowledge. |
5280 | Lua (Admin?) | A hidden control panel β Possibly Prosody (XMPP admin). |
5281 | Lua (BOSH?) | A web messenger gateway β For browser-based chat. |
25 | Exim4 | The Postmaster β Handles emails in the kingdom. |
53 | systemd-resolved | The Name Resolver β Converts names to IPs (DNS). |
35333 | containerd | The Docker Overseer β Manages containers. |
π The UDP Shadows (Stateless & Fast)
These are quick, connectionless messengersβgreat for real-time tasks.
Port | Guardian (Service) | Role in the Kingdom |
---|---|---|
3478 (UDP) | TURN Server | Helps with fast media streams (video/voice). |
53 (UDP) | systemd-resolved | DNS Queries β Quickly finds where domains live. |
5355 (UDP) | systemd-resolved | Multicast DNS β For local network discovery. |
π¨ Diagram: The Digital Kingdomβs Network Fortress
π Internet Travelers
β
βΌ
π Port 80 (HTTP) π Port 443 (HTTPS)
β β
βΌ βΌ
π° Nginx (Master) π SSL Encryption
β
ββββΆ ποΈ Docker (8080) β Container Secrets
ββββΆ π¬ XMPP (5222, 5269) β Messengers
ββββΆ π§ TURN (3478) β Video Calls
ββββΆ οΏ½ SSH (22) β Admin Access
β
βΌ
π― Local Castle (127.0.0.1)
βββπ¦ MariaDB (3306) β Royal Records
βββπ PostgreSQL (5432) β More Records
βββπ¨ Exim4 (25) β Messaging Pigeons (SMTP)
βββπ DNS (53) β Address Book
π The Mystery of Lua (Ports 5000, 5222, 5269, 5280, 5281)
A mysterious Lua-powered service controls multiple ports. Clues suggest:
- 5222 & 5269: Likely XMPP (Jabber chat) β Messengers delivering encrypted scrolls.
- 5280 & 5281: Could be Prosody (XMPP admin & BOSH) for web chat.
- 5000: Unknownβpossibly a custom API or internal tool.
Quest: Run sudo lsof -i :5000
to uncover more secrets!
βοΈ Battle Plan for Migration (Nginx vs. Apache)
Since Nginx (Master) already rules ports 80 & 443, you must:
- Redirect Apacheβs forces to a new port (e.g., 8081).
- Configure Nginx to proxy requests to Apache.
- Retire Apache once all services swear loyalty to Nginx.
π Conclusion: Youβve Mapped the Kingdom!
Now you know:
- Nginx guards the main gates (80/443).
- MariaDB & PostgreSQL protect the royal archives.
- XMPP (Lua) runs the messenger network.
- Docker hides services in magical containers.
Your next quest: Decide if Nginx shall rule alone or keep Apache as a vassal!
π Adventure awaits! π