1

I have installed a new dedicated web server, and installed phpmyadmin, and it works. I have follow a tutorial that helps to secure phpmyadmin i.e. call phpmyadmin thru a subdomain like mysql.mydomain.tld + force it to HTTPS. It was working at the beginning. But now, https://mysql.mydomain.tld goes to a FORBIDDEN access message. While http still works. Can you help? Thanks

<VirtualHost *:80>
    # Configuration de l'addresse
    ServerAdmin     [email protected]
    ServerName      mysql.mydomain.tld
    DocumentRoot    /usr/share/phpmyadmin/

    # Redirection vers HTTPS
    RewriteEngine   on
    RewriteCond     %{HTTPS} !=on
    RewriteRule     ^(.*)$ https://%{SERVER_NAME}$1 [L,R=301]
</VirtualHost>        

<IfModule mod_ssl.c>
<VirtualHost *:443>
    # Configuration de l'addresse
    ServerAdmin     [email protected]
    ServerName      mysql.mydomain.tld
    DocumentRoot    /usr/share/phpmyadmin/

    # Personnalisation des logs
    TransferLog     /var/log/apache2/phpmyadmin-access.log
    ErrorLog        /var/log/apache2/phpmyadmin-error.log

    # Utilisation de la clé et du certificat
    SSLEngine       on
    SSLCertificateFile      /etc/apache2/certificate/server.crt
    SSLCertificateKeyFile   /etc/apache2/certificate/server.key
    SSLProxyEngine  on
</VirtualHost>
</IfModule>

phpmyadmin-error.log

[Mon May 28 18:31:44.642664 2018] [ssl:warn] [pid 6496] AH01909: mysql.mydomaintld:443:0 server certificate does NOT include an ID which matches the server name

phpmyadmin-access.log is empty

4
  • please paste /var/log/apache2/phpmyadmin-error.log and /var/log/apache2/phpmyadmin-access.log May 28, 2018 at 16:38
  • Hello Luca, I have edited my 1st post abd add the requested file content. Thanks. May 28, 2018 at 19:31
  • can you paste a screenshot of the forbidden error msg? Is it sent by your browser or apache? May 28, 2018 at 19:54
  • Are you sure the installed certificate is valid for mysql.mydomain.tld ? The log suggests otherwise.
    – fvu
    May 28, 2018 at 23:57

1 Answer 1

0

Sorry for this late answer.

I have tried with a valid certificate for mysql.mydomain.tld: same problem.

Finally, I have restarted again he configuration from the beginning. And it came to work. I could not clearly identify why it didn't work with the previous conf.

One think I have noticed, and the main difference with the conf. file above, is that I have added the IP address into the conf :

<VirtualHost *:443> replaced by <VirtualHost 123.123.123.12:443>

maybe it was the reason?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .