Proxy subdomains point to first SSL entry on Apache

Rogerio

Well-Known Member
Sep 26, 2016
78
14
8
Sao Paulo, Brazil
cPanel Access Level
Root Administrator
Hello,

all proxy entries like webmail, cpanel, whm of all accounts are pointing to the IP's first created account.

Example:

- server has IPS 1.1.1.1, 1.1.1.2, 1.1.1.3
- main server IP is 1.1.1.1
- first.com was the first account created in the server in the second IP 1.1.1.2
- after, second.com and third.com created in the same 1.1.1.2

If I access:

www.first.com shows the correct website

But I access:

http :// webmail.second.com
http :// cpanel.third.com

show www.first.com too and the customers are not related!

If I edit httpd.conf, and search for "1.1.1.2:80", the first virtualhost shows:

<VirtualHost 1.1.1.2:80>
ServerName first.com
(...)

Note: only happens in http:// entries. https://webmail.second.com works.

How can I fix this?
 
Last edited:

Rogerio

Well-Known Member
Sep 26, 2016
78
14
8
Sao Paulo, Brazil
cPanel Access Level
Root Administrator
Found the problem!

1.1.1.2:80 entries does NOT have webmail, cpanel, whm, etc entries.

<VirtualHost 1.1.1.2:80>
ServerName second.com
ServerAlias mail.second.com www.second.com

<VirtualHost 1.1.1.2:443>
ServerName second.com
ServerAlias mail.second.com www.second.com autodiscover.second.com webdisk.second.com cpanel.second.com webmail.second.com

Why and how to fix without edit httpd.conf manually to insert missing entries?

------------

EDIT:

I think this is not the problem. I can see entries in the other IP 1.1.1.3 like this and works... only happens with 1.1.1.2 and no problems with 1.1.1.1 and 1.1.1.3.
 
Last edited:

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
6,816
541
263
Houston
cPanel Access Level
DataCenter Provider
You can add service domains (formerly proxy subdomains) with the following:

Code:
# /scripts/servicedomains --help
Usage:
    servicedomains [action] [options]

        Options:
          --help                          Brief help message
          --man                           Full help message
          --user=                         User to configure
          --domain=                       Domain to configure
          --subdomain=                    Service subdomain to manipulate
          --no_replace=0                  Enable replacment of existing records (currently
                                          only used for changing autodiscover hosts)
          --old_autodiscover_host=        The previously configured autodiscover host (used
                                          for matching old records and updating them to the
                                          new host)
          --force_autodiscover_support=1  Behave as if the autodiscover support has not been
                                          disabled even if it has. This is useful for
                                          removing the autodiscovery service subdomains after
                                          the support for them has been disabled.
          --ifenabled                     Only perform the operation if service subdomains
                                          are enabled.

        Actions:
          add          Create service subdomains
          remove       Remove service subdomains