https access redirects to defaultwebpage.cgi

PatrickVeenstra

Well-Known Member
Feb 12, 2012
169
3
68
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
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.
 

Irksome73

Member
Oct 17, 2013
13
0
51
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
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?
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.
 

Irksome73

Member
Oct 17, 2013
13
0
51
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
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.
 

oviliz

Member
Feb 23, 2013
12
0
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.
404 Not Found
The server can not find the requested page:
domain.com/subpage.php (port 443)
Any other idea?
 

oviliz

Member
Feb 23, 2013
12
0
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...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
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.
 

oviliz

Member
Feb 23, 2013
12
0
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.
webserver.myserver.com - This CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store.
 

oviliz

Member
Feb 23, 2013
12
0
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
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.
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
New Ok, that's fair enough. But still, there is no way to redirect HTTPS requests to the legitimate HTTP domains?
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.
 

oviliz

Member
Feb 23, 2013
12
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
New 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?
Yes, this will work by default as long as the server is using CentOS/RHEL/CL version 6 or higher (supports SNI).

Thank you.