JerryJohnson

Registered
Apr 25, 2013
1
0
1
cPanel Access Level
Root Administrator
Hi,

My name is Jerry Johnson and I am the administrator for a free webhost.
If it means anything, this is my cpanel setup:
uml.png

I have a wildcard SSL for *.domain.com

I want to use proxy subdomains for all servers, but I can't do whm.cp1.domain.com without invalidating the SSL cert.

Is there a way I can set up like:
(whm|cpanel|webmail|webdisk)(1|2|3).domain.com?

(Sorry if you are not familiar with regex, i don't feel like typing all of it.)
 

mhofer

Member
May 10, 2013
16
0
1
cPanel Access Level
Root Administrator
I tried to accomplish the same today, here's my solution (excluding webdisk).

1. make sure you installed mod_proxy

2. in your post_virtualhost_global.conf, on each server, add the following (edit IP, DOMAIN and the numbers according to your server-number):
Code:
<VirtualHost IP:443 IP:80>
        ServerName webmail1.DOMAIN

        ServerAlias cpanel1.DOMAIN whm1.DOMAIN

        ServerAdmin support@DOMAIN

        <IfModule mod_suphp.c>
                suPHP_UserGroup nobody nobody
        </IfModule>

        RewriteEngine On

        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

        <IfModule core.c>
                SSLProxyEngine On
        </IfModule>

        RewriteCond %{HTTP_HOST} ^webmail1\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]

        RewriteCond %{HTTP_HOST} ^cpanel1\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]

        RewriteCond %{HTTP_HOST} ^whm1\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]

        UseCanonicalName Off
</VirtualHost>
make sure you have installed your wildcard certificate on the chosen IP, then restart apache

3. add corresponding DNS-entries manually (webmail1 IN A IP etc...)

This worked for me, hope it helps you.
Let me know if there's something wrong or you have questions.

Greetings
Marcel
 

mhofer

Member
May 10, 2013
16
0
1
cPanel Access Level
Root Administrator
Seems like I cant edit my previous post anymore?

Anyway i've posted the wrong ports, cpanel would be 2083, whm 2087 and if you add webdisk take 2078