Yes, set UCP to listen only on the zerotier hostname or IP, on port 80 and 443.
To achieve this, we need to tell the Apache web server to bind specifically to your ZeroTier IP address rather than "listening" on every available interface.
Here is how to configure your system to listen only on your ZeroTier IP for ports 80 and 443.
1. Identify your ZeroTier IP
Before making changes, you need the exact IP address assigned to your ZeroTier interface (usually zt0 or similar).
Run this command in your CLI:
ip addr show
Look for the entry associated with your ZeroTier network and note the IP address (e.g.,
10.147.17.2).
2. Configure Apache Listen Directives
- nano /etc/apache2/ports.conf
- Locate the Listen directives. You want to change them from generic ports to IP-specific ports:
Change this:
Listen 80
Listen 443
To this (using your ZT IP):
Listen 10.147.17.2:80
Listen 10.147.17.2:443
3. Adjust the Virtual Hosts
If you want to ensure the UCP specifically responds only to the ZeroTier hostname, you may need to edit the VirtualHost file for the UCP.
In
/etc/apache2/hosts-enabled/<YourIPBXhost>.conf ensure the
VirtualHost tag has the IP:
Apache
<VirtualHost 10.147.17.2:80>
# Configuration here
<VirtualHost>
4. Restart Apache
For the changes to take effect, restart the web server:
sudo systemctl restart apache2
Important Considerations
- Admin Access: If you bind ports 80 and 443 to the ZeroTier IP, you will not be able to access the login page via your local LAN IP or Public IP anymore. Ensure your ZeroTier connection is stable before applying.
- Port Conflicts: If you have the FreePBX Admin Panel and UCP sharing ports, this binding applies to both. If you want them separate, you must assign them different ports, or different subdomain names.