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.

/cpanel /whm and /webmail redirects

Discussion in 'E-mail Discussions' started by zimmerru, May 29, 2006.

  1. zimmerru

    zimmerru Member

    Joined:
    Apr 30, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    I currently have it setup to use SSL for the cpanel/whm/webmail logins, and when it tries that the customer gets an invalid certificate error, since cpanel uses a self-signed certificate for SSL. I have a valid SSL vertificate for my main website and want the cpanel to redirect them to https://www.mydomain.com:2083 instead of https://www.thierdomain.com:2083 so the SSL certificate is valid, I know I can do this by editing the scripts located in /usr/local/cpanel/cgi-sys/ but this gets overwritten every time I update cPanel. I would also like to change the place that the /webmail redirect takes them, but again it gets overwritten when cpanel updates. Is there a way to do this within cpanel? Or a way to somehow auto correct them once cpanel updates?
     
    #1 zimmerru, May 29, 2006
    Last edited: May 29, 2006
  2. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Either ask your users to use http://host.yourdomain.com/whm and use the below info to avoid seeing the popup

    Get a certificate for your hostname i.e. if your hostname is host.yourdomain.com, get a certificate for that. And install it using WHM.

    WHM -> Change Server Certificates -> Change Server Certificates

    Place your cert information there and it should be ok.

    Remember anytime a user tries http://www.theirdomain.com/whm, it will go to https://www.theirdomain.com:2087 only.


    Alternatively

    If you want to really change this, just edit /usr/local/apache/conf/httpd.conf and change the path for the redirect cgi scripts. In shell copy those scripts to the path you specified in your httpd.conf. Edit the scripts to redirect users to the proper secure domain you want. Restart apache and try it out.

    The cgi files used are

    /usr/local/cpanel/cgi-sys/redirect.cgi
    /usr/local/cpanel/cgi-sys/wredirect.cgi
    /usr/local/cpanel/cgi-sys/whmredirect.cgi
    /usr/local/cpanel/cgi-sys/swhmredirect.cgi
     
  3. zimmerru

    zimmerru Member

    Joined:
    Apr 30, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    hmm.. ok I have a SSL certificate for my domain, but I had edited the /etc/httpd/conf/httpd.conf file which turns out is just a symlink'd path to the file you mention, and my changes were overwritten by the cpanel update. So I have no problem updating them but when cpanel updates it will just change them back, which I guess is the source of my problem.
     
    #3 zimmerru, May 31, 2006
    Last edited: May 31, 2006
  4. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    The redirects happen from httpd.conf and that never gets overwritten by cpanel updates. As i said earlier just make copies of the redirect cgi files and change the paths in httpd.conf as well. In the new redirect cgi's just have the user redirect to whatever url you want him to go to, in this case https://yourdomain.com.
     
  5. zimmerru

    zimmerru Member

    Joined:
    Apr 30, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    hmm then something is a bit wonky on my server because i commented the webmail redirect out and when I went back in both the scripts were changed back and my changes were undone in the conf file. Also all of the lais lines that cpanel uses had gotten moved to the bottom of the conf file, rather then them being towards the end but not at the end before. I'll do this and we'll see how it goes. Thanks for the information.
     
  6. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    hmm... could be the cpanel update is updating the httpd.conf if the lines are not present in it. Why not try to just redirect users to your squirelmail installation page ??
     
  7. zimmerru

    zimmerru Member

    Joined:
    Apr 30, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    That would work fine but I have to modify the lines in httpd.conf no matter what I do, which still leaves me with the same problem.
     
Loading...

Share This Page