Site vhosts not regenerating with correct ports after changing apache.ports

I’m running HAProxy → Varnish → Apache setup. HAProxy handles SSL on 443, so I need Apache on different ports.

Did this:

# Move HTTP to port 8081, disable SSL
cpcmd scope:set apache.ports '[8081,false]'
# Update configuration on all accounts
EditDomain --reconfig --all
EditDomain --rebuild --all

Problem:

  • Main server vhost (server.hostname.com) correctly uses port 8081
  • Site vhosts (wordpress.example.com) still generate for ports 80/443 in /etc/httpd/conf/virtual-httpd-built
  • Running htrebuild doesn’t update the site vhosts to use the new ports
  • This causes Apache to route requests to server root instead of site document root (403 errors)

Expected:
Site vhosts should be generated for ports 8081/8443 (or 8081 only if ssl_port=false) to match the httpd config.

Question:
How do I force site vhosts to regenerate with the correct ports from config.ini?
What is the correct approach of achieving the goal? (Put vHost behind HAproxy/other ports)

lgtm.

Ports are sourced from:

const HTTP_NOSSL_PORT = HTTPD_NOSSL_PORT;
const HTTPD_SSL_PORT  = HTTPD_SSL_PORT;

These are pulled from configuration:

cpcmd scope:get cp.config httpd nossl_port
# Returns 8082

Running EditDomain --reconfig --all rebuilds Apache configuration:

# cat /etc/httpd/conf/virtual/site1

<VirtualHost 192.168.0.26:8082>
        ServerName www.site123456.com
    ServerAlias site123456.com *.site123456.com
    DocumentRoot /home/virtual/site1/fst/var/www/html
... *snip*