Title: Error with SSL certificate installation
Tags: ssl;ssl-certificate
Question: I'm trying to install SSL certificate but got stuck in the last step where i'm trying to restart the service. Did I do something wrong in the .conf file that needs to be fixed?
Also, the .key file is the one generated by me when .csr file was generated while both the .crt files are given by godaddy.
<VirtualHost *:443&gt;
<Directory /var/www/html&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory&gt;
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName mydomain.net
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/b1ea8634211f5783.crt
SSLCertificateKeyFile /etc/apache2/ssl/pride.key
SSLCertificateChainFile /etc/apache2/ssl/gd_bundle-g2-g1.crt
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost&gt;
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
~
~
~
~
When I try to restart, this is the error I get:
root@ip-172-31-18-132:/etc/apache2/sites-available# service apache2 restart
* Restarting web server apache2                                                       Action 'start' failed.
The Apache error log may have more information.
[fail]
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Here's the error report (/var/log/apache2/error.log) which I failed to understand :(
[Wed Jul 13 01:30:07.883524 2016] [negotiation:error] [pid 4631] [client 151.154.11.224:59294] AH00687: Negotiation: discovered file(s) matching request: /var/www/html/robots.txt (None could be negotiated).
[Wed Jul 13 04:04:45.397728 2016] [mpm_prefork:notice] [pid 1106] AH00169: caught SIGTERM, shutting down
[Wed Jul 13 04:07:06.724.275.0890] [mpm_prefork:notice] [pid 1111] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.16 configured -- resuming normal operations
[Wed Jul 13 04:07:06.724.275.0890] [core:notice] [pid 1111] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jul 13 04:07:18.724.275.0890] [mpm_prefork:notice] [pid 1111] AH00169: caught SIGTERM, shutting down
[Wed Jul 13 04:08:04.724.275.0890] [mpm_prefork:notice] [pid 1110] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.16 configured -- resuming normal operations
[Wed Jul 13 04:08:04.724.275.0890] [core:notice] [pid 1110] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jul 13 05:20:12.724.275.0890] [mpm_prefork:notice] [pid 1110] AH00169: caught SIGTERM, shutting down
[Wed Jul 13 05:20:14.005134 2016] [mpm_prefork:notice] [pid 1728] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.16 OpenSSL/1.0.1f configured -- resuming normal operations
[Wed Jul 13 05:20:14.006303 2016] [core:notice] [pid 1728] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jul 13 05:38:00.724.275.0890] [negotiation:error] [pid 1734] [client 151.154.11.224:54015] AH00687: Negotiation: discovered file(s) matching request: /var/www/html/robots.txt (None could be negotiated).
[Wed Jul 13 06:43:08.724.275.0890] [mpm_prefork:notice] [pid 1728] AH00169: caught SIGTERM, shutting down
[Wed Jul 13 06:43:09.353465 2016] [ssl:emerg] [pid 3180] AH02238: Unable to configure RSA server private key
[Wed Jul 13 06:43:09.353512 2016] [ssl:emerg] [pid 3180] SSL Library Error: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch
[Wed Jul 13 06:43:09.353516 2016] [ssl:emerg] [pid 3180] AH02311: Fatal error initialising mod_ssl, exiting. See /var/log/apache2/error.log for more information
[Wed Jul 13 06:44:36.376515 2016] [ssl:emerg] [pid 3257] AH02238: Unable to configure RSA server private key
[Wed Jul 13 06:44:36.376562 2016] [ssl:emerg] [pid 3257] SSL Library Error: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch
[Wed Jul 13 06:44:36.376566 2016] [ssl:emerg] [pid 3257] AH02311: Fatal error initialising mod_ssl, exiting. See /var/log/apache2/error.log for more information
[Wed Jul 13 06:47:16.724.275.0890] [mpm_prefork:notice] [pid 3329] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.16 OpenSSL/1.0.1f configured -- resuming normal operations
[Wed Jul 13 06:47:16.724.275.0890] [core:notice] [pid 3329] AH00094: Command line: '/usr/sbin/apache2'
Comment: 'x509_check_private_key:key values mismatch'. The key file doesn't match the certificate file. Off topic.

Comment: "*The Apache error log may have more information [..] Please read the log files to discover problems*" -> what do the log files say?

Comment: I have updated the log file. See if that makes sense? I can't understand any of it.

Comment: Yes and I got this: `b1ea8634211f5783.crt`  `gd_bundle-g2-g1.crt` `pride.key`

Comment: Yes, I found it out and replaced it with the correct .key file. It's done. Thank you so much :)

Comment: Can you run `ls /etc/apache2/ssl/`



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 6, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:07/13/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ssl><ssl-certificate>', 'Title': 'Error with SSL certificate installation', 'ViewCount': 906, 'id': 38344531, 'user_AboutMe': None, 'user_AccountId': 5626691.0, 'user_DisplayName': 'Elaine Byene', 'user_Reputation': 3806.0, 'user_Views': 608.0, 'user_id': 4454909.0}}