The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom Proxy Subdomain

Discussion in 'General Discussion' started by JerryJohnson, Apr 25, 2013.

  1. JerryJohnson

    JerryJohnson Registered

    Joined:
    Apr 25, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    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.)
     
  2. mhofer

    mhofer Member

    Joined:
    May 10, 2013
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    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
     
  3. mhofer

    mhofer Member

    Joined:
    May 10, 2013
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    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
     
Loading...

Share This Page