Proxy Redirect /webmail

gcserv

Registered
Apr 24, 2013
4
0
1
cPanel Access Level
Root Administrator
Hi all

got a bit of a problem on my hands i was trying to make a redirect where if any of my hosts type in webmail.* it would automaticaly redirect to https://webmail.myhost.co.za:2096 but for some or other reason it wouldnt work and now when i try to put everything back to the way it was all of it is broken so now when they enter webmail. it redirects to the cgi-sys/default and i cant get it to redirect to the original webmail login page....



httpd.conf :
Code:
ErrorLog "logs/error_log"
ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi
ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/webmailredirect.pl
ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi

RewriteEngine on
AddType text/html .shtml

Alias /bandwidth /usr/local/bandmin/htdocs/
Alias /img-sys /usr/local/cpanel/img-sys/
Alias /java-sys /usr/local/cpanel/java-sys/
Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/


ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/
ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/
End of httpd.conf
Code:
# CPANEL/WHM/WEBMAIL/WEBDISK/AUTOCONFIG PROXY SUBDOMAINS

<VirtualHost my_ip:80 my_ip:443 127.0.0.1:80 127.0.0.1:443>
    ServerName my_server

    ServerAlias cpanel.* whm.* webmail.* webdisk.* autodiscover.* autoconfig.*

    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin my_email
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
    <IfModule mod_security2.c>
        SecRuleEngine Off
    </IfModule>
    UserDir disabled
    RewriteEngine On
    <IfModule mod_ssl.c>
        SSLProxyEngine On
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off
        SSLProxyCheckPeerExpire Off
    </IfModule>
    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]

    RewriteCond %{HTTP_HOST} ^autodiscover\.
    RewriteRule ^[^?]*(\?.*)? http://127.0.0.1/cgi-sys/autodiscover.cgi [P]
    RewriteCond %{HTTP_HOST} ^autoconfig\.
    RewriteRule ^[^?]*(\?.*)? http://127.0.0.1/cgi-sys/autoconfig.cgi [P]


    UseCanonicalName Off
</VirtualHost>


Include "/usr/local/apache/conf/includes/post_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf"

I have remove IP and server name for security reasons... respectively...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello :)

To clarify, you are attempting to restore the standard proxy subdomains behavior for webmail? If so, have you ensured there are no custom Apache configurations in place and attempted to rebuild the Apache configuration file? EX:

Code:
/scripts/rebuildhttpdconf
Are the other proxy subdomains (e.g. cpanel/whm) working well?

Thank you.
 

gcserv

Registered
Apr 24, 2013
4
0
1
cPanel Access Level
Root Administrator
Yellow...

yes and i have done the
Code:
/scripts/rebuildhttpdconf
already that didnt work...
there is no special configs in place as shown in the start of my post...

the idea i was trying to get was to redirect any webmail.* domain hosted on my server to redirect to my main server SSL host so that the people wont receive SSL warning when accessing webmail and the sorts... it didnt work so i put it all back restored the httpd.conf.bck.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Feel free to open a support ticket so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

Thank you.