0

We have a 3 Year Standard UCC SSL Certificate in Godaddy and I added 2 SAN - one in a different domain and 1 in a subdomain. The domain added is in https without a problem. I have completely installed the SSL in my subdomain but the content of the subdomain is showing Error establishing a database connection.

This should not happen because the content of the subdomain is just index.php with hello world inside.

I already asked Godaddy what should be done but they can't be of help. They said it has something to do with our hosting but we are using VPS and I only installed the SSL through the server.

My guess is that maybe it's not working because the main domain is not in https:// because I always see the error: Error establishing a database connection in Wordpress but I'm not sure.

EDIT

Here's the content of my conf file:

<VirtualHost *:80>
ServerName subdomain.example.com
Redirect permanent / https://subdomain.example.com
<Directory /var/www/subdomain_directory>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerAdmin email@example.com
ServerName subdomain.example.com
DocumentRoot /var/www/subdomain_directory
<Directory /var/www/subdomain_directory>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
        Require all granted
</Directory>

SSLEngine on
SSLCertificateFile /etc/apache2/SSL/subdomain.example.com.crt
SSLCertificateKeyFile /etc/apache2/SSL/subdomain.example.com.key
SSLCACertificateFile /etc/apache2/SSL/intermediate.crt
</VirtualHost>
  • 1
    You are likely looking in the wrong place.... This is something wrong with your wordpress install – Drifter104 Jun 5 '18 at 14:20
  • @Drifter104 but the subdomain has no wordpress installed. just index.php to see if it works – jeepers_creepers Jun 5 '18 at 14:22
  • Are you running apache or nginx? Have you updated the site configs for ssl? Are they proxying to the right directory? Just because you only have index.php for the sub domain, it doesn't mean that is the file you are getting to to get that message – Drifter104 Jun 5 '18 at 14:23
  • @Drifter104 apache. I have added the configs in its conf. I'll post the content above – jeepers_creepers Jun 5 '18 at 14:24
  • Add all the site confs above because it might not actually be using the one that you think it is using – Drifter104 Jun 5 '18 at 14:25
0

I have added this in my conf:

DocumentRoot /var/www/subdomain_directory

So now it looks like:

<VirtualHost *:80>
ServerName subdomain.example.com
Redirect permanent / https://subdomain.example.com
<Directory /var/www/subdomain_directory>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerAdmin email@example.com
ServerName subdomain.example.com
DocumentRoot /var/www/subdomain_directory
<Directory /var/www/subdomain_directory>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
        Require all granted
</Directory>

SSLEngine on
SSLCertificateFile /etc/apache2/SSL/subdomain.example.com.crt
SSLCertificateKeyFile /etc/apache2/SSL/subdomain.example.com.key
SSLCACertificateFile /etc/apache2/SSL/intermediate.crt
</VirtualHost>
| improve this answer | |
  • Did this solve the problem? If not, this should be edited into the question, not posted as an answer. – Jenny D Jun 5 '18 at 15:30
  • @JennyD It did solve the problem. And thanks for the edit! – jeepers_creepers Jun 5 '18 at 15:36
  • I'm glad you found a solution! – Jenny D Jun 5 '18 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.