🗂 IP / Port Map
| Service | IP | Port | Notes |
|---|---|---|---|
| Websites (Apache only) | 51.210.247.102 | 80,443 | Main IP; public HTTP + HTTPS |
| ISPConfig admin panel | 51.210.247.102 | 443 | Admin HTTPS on same IP as Apache → must use reverse proxy |
| stunnel (OpenVPN) | 5.135.106.93 | 443 | Secondary IP; separate port, no conflicts |
1️⃣ How this works conceptually
Main IP: 51.210.247.102
Both Apache websites and ISPConfig admin panel HTTPS share the same IP and port 443.
This requires reverse proxying: a single service listens on 443 (nginx recommended) and routes traffic based on:
Host:header in HTTP (for websites vs panel)TLS SNI if needed
Apache itself can remain listening on 127.0.0.1:8080 (websites) and 127.0.0.1:8081 (ISPConfig), so no port conflicts.
Secondary IP: 5.135.106.93
stunnel listens only on this IP:443.
Forwards traffic internally to OpenVPN (127.0.0.1:1195).
Completely isolated — no conflicts with Main IP.
2️⃣ Practical architecture diagram
3️⃣ Steps to implement
a) Websites
Apache listens only on 127.0.0.1:8080 (internal)
Nginx reverse proxy handles 443 and 80 for main IP
b) ISPConfig admin
Install ISPConfig panel on 127.0.0.1:8081
Nginx reverse proxy maps
panel.example.comto 127.0.0.1:8081Use SSL certificate (Let’s Encrypt or self-signed) in Nginx
c) stunnel
Configure stunnel on secondary IP:443 to forward TCP → OpenVPN (127.0.0.1:1195)
d) Firewall
Main IP: allow 80,443
Secondary IP: allow 443 only for stunnel/OpenVPN
4️⃣ Advantages
No port conflicts
Clear separation of services
ISPConfig is fully HTTPS on main IP
Websites continue to run normally
stunnel/OpenVPN fully isolated on secondary IP
1️⃣ Why nginx
ISPConfig admin panel and websites share the same IP (51.210.247.102) and port 443.
Apache alone cannot easily serve two different services on the same IP:443 because it can only listen on a port and serve one set of virtual hosts.
Nginx (or any reverse proxy) can listen on 443 and route requests based on the hostname (Host header / SNI) to different backends:
panel.example.com → ISPConfigwww.example.com → Apache websites
This is called reverse proxying.
Full working stack for your scenario:
Main IP: 51.210.247.102
Websites → Apache (HTTP/HTTPS)
ISPConfig → HTTPS on same IP, via nginx reverse proxy
Additional IP: 5.135.106.93
stunnel → OpenVPN
1️⃣ Install required packages
2️⃣ Configure Apache (websites backend)
/etc/apache2/ports.conf
/etc/apache2/sites-available/000-default.conf
Enable site & restart:
Test locally:
3️⃣ Configure ISPConfig backend
Install ISPConfig normally, but set admin panel port to 8081:
Install ISPConfig normally, but set admin panel port to 8081:
Ensure ISPConfig listens only on
127.0.0.1:8081Test:
4️⃣ Configure nginx as reverse proxy
/etc/nginx/sites-available/main-proxy.conf
Enable site: