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.

https access redirects to defaultwebpage.cgi

Discussion in 'General Discussion' started by PatrickVeenstra, May 17, 2014.

  1. PatrickVeenstra

    PatrickVeenstra Well-Known Member

    Joined:
    Feb 12, 2012
    Messages:
    75
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Barcelona
    cPanel Access Level:
    Root Administrator
    If I try to access my site using https I get redirected to /cgi-sys/defaultwebpage.cgi
    Why is that and how can I fix it?
     
  2. PatrickVeenstra

    PatrickVeenstra Well-Known Member

    Joined:
    Feb 12, 2012
    Messages:
    75
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Barcelona
    cPanel Access Level:
    Root Administrator
    Not sure if this is a bug, but here's a fix: Fix cPanel showing “Default Website Page” for HTTPS/SSL | daft spunk blog

    edit /usr/local/apache/htdocs/index.html
    replace
    Code:
    <html><head><META HTTP-EQUIV="refresh" CONTENT="0;URL=/cgi-sys/defaultwebpage.cgi"></head><body></body></html>
    with
    Code:
    <html><head><script> window.location.href = (window.location.protocol != "http:") ? "http:" + window.location.href.substring(window.location.protocol.length) : "/cgi-sys/defaultwebpage.cgi"; </script></head><body></body></html>
    - - - Updated - - -

    OK, that doesn't seem to work when there's a htaccess redirect :(

    any solution?
     
  3. PatrickVeenstra

    PatrickVeenstra Well-Known Member

    Joined:
    Feb 12, 2012
    Messages:
    75
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Barcelona
    cPanel Access Level:
    Root Administrator
    ok, so without certificate it redirects.... interesting, and solved.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Is a SSL certificate installed for the domain name? Or, is a SSL certificate installed on the same IP address assigned to this account?

    Thank you.
     
  5. Irksome73

    Irksome73 Member

    Joined:
    Oct 17, 2013
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I'm seeing the same thing here. Michael what exactly are you referring to about where the SSL certificate is installed - we have a wildcard cert installed in cPanel (SSL Manager) for some of the domains?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's likely you have installed a SSL certificate on a shared IP address. Thus, any attempts to access SSL content on other domain names assigned that same IP address will result in you seeing the contents of the domain name you installed the certificate for. Ensure you install a SSL certificate individually for each domain name on that IP address to avoid this problem.

    Thank you.
     
  7. Irksome73

    Irksome73 Member

    Joined:
    Oct 17, 2013
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Michael,

    I want to use a shared IP - this should be possible as 99% of our visitors support SNI and we as a provider are trying to restrict the number of IP4 address's we hand out?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, it's perfectly acceptable to install a SSL certificate on a shared IP address using the SNI functionality. However, if the account is assigned a shared IP address, and a SSL certificate is installed on that IP address, then any secure request to a domain name on that IP address will load the contents of the primary host the certificate is installed for. This is by design. You will need to assign a dedicated IP address to the account that uses the SSL certificate if you don't want that certificate applied to the other domain names on it's IP address. Or, you could generate/install a self-signed certificate for each domain name on the server. You can also make a different installed certificate the primary certificate via the "Make Primary" action under the "Manage SSL Hosts" option in WHM if you want a different certificate to appear for Virtual Hosts without a certificate installed.

    Thank you.
     
  9. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Michael,
    I had a domain using an IP shared with other accounts and this main domain had it's own SSL. Actually when tying with HTTPS other domains on the shared, they used to be redirected to the domain with the SSL certificate, as you explained.

    Now I have first removed the certificate, then moved the domain account to a dedicated IP and then reinstalled the certificate for that specific account and everything is fine.
    But when typing with HTTPS other domains on the old shared IP, I'm receiving the default Apache page as described in this post.

    I have changed the /usr/local/apache/htdocs/index.html as described but this is not a proper fix as when typing with subapages (HTTPS://domain.com/subpage.php) does not really work.
    Any other idea?
     
  10. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    PS. Don't know if related but worth to mention that I'm using Apache with nginx. When moved the domain to the different dedicated IP, the domain didn't work anymore when accessing with only HTTP (httpS was fine). So I had to manually change the IP on the nginx vhost domain file from the old shared (and server main) IP to the dedicated IP.
    The interesting thing is that I have recently moved a new domain to the server directly with it's own dedicated IP (so never been on the shared IP) and on the nginx vhosts I however have the server (shared) IP and it works fine both HTTP/HTTPS... no glue on this...
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Are you able to reproduce the issue after temporarily disable Nginx? Nginx is not natively supported so we often ask customers to temporarily disable it when troubleshooting these types of issues.

    Thank you.
     
  12. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Michael, thanks for your reply.

    I was actually following these steps penguinbliss.com/?p=281#comment-16943 to understand that the HTTP request of the moved IP domain didn't work because of nginx.

    I have disabled nginx as you requested and both HTTP/HTTPS requests didn't work at all.
    This is strange because when I have disabled nginx the first time to test my first issue, everything went fine with just Apache...

    HTTPS worked fine on the 2 domains with certificates (didn't tried just HTTP on these 2 because of htaccess and WordPress redirection settings / is a production server too with many domains so I have to test and revert quickly).

    There is one more thing when trying HTTPS on domains without SSL. They are using the webserver (cPanel) certificate and this I believe is how is supposed to be.
     
  13. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    PS. Sorry but I'm not more able to edit my previous post.

    Just didn't replaced all the 8081... Actually with Apache HTTP is fine but HTTPS still doesn't work (cleared browser cache and tried with different browsers and alternative domains).

    HTTPS is only fine with SSL domains.
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Have you installed a multi-domain certificate or have you shared an existing certificate? Keep in mind that sharing a certificate won't make other domain names accessible over HTTPS. Rather, you can access the content from other domain names over the name of the existing certificate (e.g. domain.com/~username).

    Thank you.
     
  15. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Ok, that's fair enough. But still, there is no way to redirect HTTPS requests to the legitimate HTTP domains?
     
  16. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    That's only possible if you install a SSL certificate on the domain name and then use custom Mod_Rewrite rules in the .htaccess file to redirect secure requests to the insecure URL.

    Thank you.
     
  17. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you Michael!
     
  18. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    PS. Sorry, just a last question. Can I use the same shared IP between different accounts to install multiple specific SSL certs for their domains?
     
  19. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, this will work by default as long as the server is using CentOS/RHEL/CL version 6 or higher (supports SNI).

    Thank you.
     
  20. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have actually tested it and it works. :)
    Thank you.
     
Loading...

Share This Page