Results 1 to 6 of 6

Thread: Not able to enable SSL in Apache

  1. #1
    Join Date
    Apr 2017
    Beans
    1

    Unhappy Not able to enable SSL in Apache

    I'm trying to enable SSL on my Apache 2.4 (Ubuntu 16.04.2), but without any success.

    I can run the command a2enmod ssl and it does state that ssl is already enabled.

    But whenever I try to include a "SSLEngine on" in the wiki.conf, Apache displays:
    "Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration"

    Any idea what I'm doing wrong? Could it be that mod_ssl.c is not available?

    Best and thanks
    Christoph

    Ports Conf
    Code:
    Listen 80
    <IfModule mod_ssl.c>
        Listen 443
    </IfModule>
    
    
    <IfModule mod_gnutls.c>
            Listen 443
    </IfModule>
    
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    wiki.conf

    Code:
    <VirtualHost *:443>
            SSLEngine On
            SSLCertificateFile /etc/ssl/certs/wiki.crt
            SSLCertificateKeyFile /etc/ssl/private/wiki.key
            ServerName wiki.xyz.com
            ServerAdmin christoph@xyz.com
            DocumentRoot /var/www/html/wiki/
    
    
            <Directory /var/www/html/wiki/>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Require all granted
            </Directory>
    
    
            ErrorLog /var/log/apache2/error.log
            LogLevel debug
            CustomLog /var/log/apache2/access.log combined
            ServerSignature On
    
    
    </VirtualHost>
    Last edited by cariboo; April 9th, 2017 at 07:25 PM. Reason: normalize font to comply with Forum C of C

  2. #2
    Join Date
    Apr 2017
    Beans
    11

    Re: Not able to enable SSL in Apache

    I was checking my Nagios conf, I am using the SSL on the default site..
    Code:
    <IfModule mod_ssl.c>
    	<VirtualHost _default_:443>
    		ServerAdmin webmaster@localhost
    		DocumentRoot /var/www/html
    		ErrorLog ${APACHE_LOG_DIR}/error.log
    		CustomLog ${APACHE_LOG_DIR}/access.log combined
    		SSLEngine on
            SSLCertificateFile /etc/ssl/server.crt
            SSLCertificateKeyFile /etc/ssl/private/server.key
    Different than your, of course, but actually the same... If not for "SSLEngine on" where in your case is "On".
    It should not be this a case sensitive.. but.. you may want to check this.
    I do not see issues in this conf..

    Also, add the SSLRequireSSL in the <Directory>.

  3. #3
    Join Date
    Sep 2011
    Location
    Behind you!
    Beans
    701
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Not able to enable SSL in Apache

    Did you restart Apache after you did the "a2enmod ssl"?

    Does the ServerName need to also specify the port?

    Code:
    ServerName wiki.xyz.com:443

  4. #4
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,851
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Not able to enable SSL in Apache

    Also what you can try just for comparison, is to use the default-ssl site. Just to check if it will work with it. If it does, you can even consider using it instead of your own .conf site.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  5. #5
    Join Date
    Mar 2009
    Beans
    1,749

    Re: Not able to enable SSL in Apache

    Do your encryption key files exist? Do they contain a valid key?
    Help stamp out MBR partition tables. Use GPT instead!

  6. #6
    Join Date
    Sep 2011
    Location
    Behind you!
    Beans
    701
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Not able to enable SSL in Apache

    Quote Originally Posted by 1clue View Post
    Do your encryption key files exist? Do they contain a valid key?
    I thought about that too but invalid keys wouldn't produce an Invalid command regarding SSLEngine.

    Seems like he just didn't restart Apache so it doesn't know about SSL being enabled.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •