1

I am facing a problem of certificate SSL.

I have a dedicated host, and I cannot get what I am missing to receive the error by navigator: Chrome:

NET::ERR_CERT_COMMON_NAME_INVALID

Mozilla:

SSL_ERROR_BAD_CERT_DOMAIN

Messages in browser are quite similar:

Impossible to verify from server that it is truly domain: site2.com, because its certif of security come from *.sub.site1.com. It may come from a bad config or connection getting catch by pirate. (translated message)

So it seems that the certificate is not taken while it goes threw vitrual box:

<VirtualHost *:80>
  ServerName www.site2.com
  ServerAlias site2.com

  Redirect permanent / https://site2.com/
</VirtualHost>

<VirtualHost *:443>
  ServerName www.site2.com
  ServerAlias site2.com
  DocumentRoot /var/www/site2

  Protocols h2 http:/1.1

  <If "%{HTTP_HOST} == 'www.site2.com'">
    Redirect permanent / https://site2.com/
  </If>

  ErrorLog ${APACHE_LOG_DIR}/site2-error.log
  CustomLog ${APACHE_LOG_DIR}/site2-access.log combined

  SSLEngine On
  SSLCertificateFile /home/certifs/site2.crt
  SSLCertificateKeyFile /home/certifs/site2.key
  SSLCertificateChainFile /home/certifs/site2.pem

  SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
  SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
  SSLCompression off
  SSLUseStapling on

  <Directory /var/www/site2/>
       Options FollowSymlinks
       AllowOverride All
       Require all granted
  </Directory>

  <Directory /var/www/site2/>
       RewriteEngine on
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*) index.php [PT,L]
  </Directory>

</VirtualHost>

FInaly, if I choose to go anyway to the website it is arriving to a sign in gitlab page like:

site2.com/users/sign_in

For information server works with apache2 and debian, and we have gitlab install.

Thank you in advance for your help.

MaxiGui
  • 6,190
  • 4
  • 16
  • 33

1 Answers1

0

The problem was that in apache2, I was creating well the conf file into the site-available folder. But I was never adding it to site-enabling folder.

Executing the command "a2ensite site2.conf" Fix this problem.

To check if you a enable well your site, I advice you to execute this command: apachectl -S. Please check this subject to because it may change depending your server config: How to debug an apache virtual host configuration?

MaxiGui
  • 6,190
  • 4
  • 16
  • 33