Jul 04

Proxy subdomains not working

When proxy subdomains such as cpanel.domain.com, webmail.domain.com is not working, first make sure that Proxy subdomains is turned on in “Main >> Server Configuration >> Tweak Settings”. If the problem again persist, then go and add the virtual host entry manually in very bottom of httpd.conf file.

======================================================
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS

ServerName server.hostname.com
ServerAlias cpanel.* whm.* webmail.* webdisk.*
DocumentRoot /usr/local/apache/htdocs
ServerAdmin servers@domain.com

suPHP_UserGroup nobody nobody

RewriteEngine On

SSLProxyEngine On

RewriteCond %{HTTP_HOST} ^cpanel.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
RewriteCond %{HTTP_HOST} ^webmail.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
RewriteCond %{HTTP_HOST} ^whm.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
RewriteCond %{HTTP_HOST} ^webdisk.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
RewriteCond %{HTTP_HOST} ^cpanel.
RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
RewriteCond %{HTTP_HOST} ^webmail.
RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
RewriteCond %{HTTP_HOST} ^whm.
RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
RewriteCond %{HTTP_HOST} ^webdisk.
RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
UseCanonicalName Off

Include “/usr/local/apache/conf/includes/post_virtualhost_global.conf”
Include “/usr/local/apache/conf/includes/post_virtualhost_2.conf”
======================================================

Leave a Reply

Your email address will not be published.