How to determine if OpenSSL and mod_ssl are installed on Apache2

Does anyone know a command to determine if OpenSSL and mod_ssl are installed on Apache2?

+50
ssl apache2
Sep 02 '09 at 12:56
source share
14 answers

If you have PHP installed on your server, you can create a php file, resolve its name phpinfo.php and add this <?php echo phpinfo();?> And open the file in your browser, this displays information about your system environment so that quickly find information about your loaded Apache modules, find "Loaded modules" on the resulting page.

+27
Apr 20 2018-12-12T00:
source share

If you have PHP installed on your server, you can execute it at runtime using extension_loaded "funciontion. Similarly:

 <?php if (!extension_loaded('openssl')) { // no openssl extension loaded. } ?> 
+21
Mar 11 '13 at 19:59
source share

Usually, when you compile apache2 server (or install it using package objects), you can check any directive available for use by clicking this command:

 ~# $(which httpd) -L | grep SSL # on RHEL/CentOS/Fedora ~# $(which apache2) -L | grep SSL # on Ubuntu/Debian 

If you do not see SSL * directives, this means that you do not have apache2 with mod_ssl compilation.

Hope this helps;)

+19
Jun 10 2018-11-11T00:
source share

The default Apache installation is configured to send this information in the Server header line. You can view this for any server using the curl command.

 $ curl --head http://localhost/ HTTP/1.1 200 OK Date: Fri, 04 Sep 2009 08:14:03 GMT Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8a DAV/2 PHP/5.2.6 SVN/1.5.4 proxy_html/3.0.0 
+16
Sep 04 '09 at 8:15
source share

Use the following commands.

 $ openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 (or similar output) 

For RHEL / CentOS / Fedora:

 $ httpd -t -D DUMP_MODULES | grep ssl ssl_module (shared) 

For Ubuntu / Debian

 $ apache2 -t -D DUMP_MODULES | grep ssl ssl_module (shared) 

For SUSE

 $ httpd2 -t -D DUMP_MODUELS | grep ssl ssl_module (shared) 
+12
Jun 26 '15 at 8:58
source share

If you just started openssl in your terminal, it should present the openSSL shell. My first key to understanding that I did not have mode_ssl was when I received the following error after adding SSLEngine on to my virtualhost file:

 Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration 

In centos, I just needed to install it through yum install mod_ssl

+3
Jul 13 '14 at 1:51 on
source share

To define openssl and ssl_module

 # rpm -qa | grep openssl openssl-libs-1.0.1e-42.el7.9.x86_64 openssl-1.0.1e-42.el7.9.x86_64 openssl098e-0.9.8e-29.el7.centos.2.x86_64 openssl-devel-1.0.1e-42.el7.9.x86_64 

mod_ssl

 # httpd -M | grep ssl 

or

 # rpm -qa | grep ssl 
+3
Jul 13 '15 at 11:08
source share

Using Apache 2, you can see which modules are currently loaded by the HTTP daemon by running the following command:

 apache2ctl -M 

The -M option is really just the option passed to httpd.

apache2ctl is the Apache HyperText Transfer Protocol (HTTP) interface. It is designed to help an administrator manage the operation of the Apache2 daemon.

  NOTE: The default Debian configuration requires the environment variables APACHE_RUN_USER, APACHE_RUN_GROUP, and APACHE_PID_FILE to be set in /etc/apache2/envvars. The apache2ctl script returns a 0 exit value on success, and >0 if an error occurs. For more details, view the comments in the script. 
+3
Nov 30 '15 at 19:08
source share

Fortunately, most Linux variants have OpenSSL out of the box.

To verify the installation:

openssl version
Answer:
OpenSSL 1.0.1t 3 May 2016

Note: OpenSSL version 1.0.1 to 1.0.1f (inclusive)
vulnerable to OpenSSL Heartbleed errors. Version 1.0.1g and higher are fixed.

Additional installation information:

Ubuntu / Debian
dpkg -l | grep -i openssl
Answer:
ii libcrypt-openssl-random-perl 0.04-2+b1 amd64 module to access the OpenSSL pseudo-random number generator
ii libcurl3:amd64 7.38.0-4+deb8u5 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour)
ii libgnutls-openssl27:amd64 3.3.8-6+deb8u4 amd64 GNU TLS library - OpenSSL wrapper
ii openssl 1.0.1t-1+deb8u6 amd64 Secure Sockets Layer toolkit - cryptographic utility
ii python-ndg-httpsclient 0.3.2-1 all enhanced HTTPS support for httplib and urllib2 using PyOpenSSL
ii python-openssl 0.14-1 all Python 2 wrapper around the OpenSSL library
ii ssl-cert 1.0.35 all simple debconf wrapper for OpenSSL

Yes, OpenSSL is installed!

To install OpenSSL, if you don't have one, try:

Debian / Ubuntu:
sudo apt-get install openssl

RedHat / CentOS:
yum install openssl

+3
Feb 19 '17 at 19:24
source share

You should install this Apache mod, http://httpd.apache.org/docs/2.0/mod/mod_info.html , it basically gives you a run of the mod you are using and Apache Settings. I have included this on my Apache and it gives me this information for my website,

Server Version: Apache / 2.2.3 (Debian) mod_jk / 1.2.18 PHP / 5.2.0-8 + etch13 mod_ssl / 2.2.3 OpenSSL / 0.9.8c mod_perl / 2.0.2 Perl / v5.8.8

+2
Sep 04 '09 at 8:05
source share

Just look in ssl_engine.log in the Apache log directory, where you should find something like:

 [ssl:info] [pid 5963:tid 139718276048640] AH01876: mod_ssl/2.4.9 compiled against Server: Apache/2.4.9, Library: OpenSSL/1.0.1h 
+2
Dec 22 '14 at 11:18
source share

Include mod_ssl in httpd.conf and restart apache. You will see openssl information in error.log as below

 [Fri Mar 23 15:13:38.448268 2018] [mpm_worker:notice] [pid 8891:tid 1] AH00292: Apache/2.4.29 (Unix) OpenSSL/1.0.2n configured -- resuming normal operations [Fri Mar 23 15:13:38.448502 2018] [core:notice] [pid 8891:tid 1] AH00094: Command line: '/opt/apps/apache64/2.4.29/bin/httpd' 
0
Mar 23 '18 at 21:19
source share

To find ssl version

  1. Go to the Apache bin folder on the command line
  2. Enter these commands "openssl version"
0
Dec 11 '18 at 8:45
source share

In my case, I got the information:

  • find where the apache logs are and go there, in my case:

    cd /var/log/apache2

  • Find where log information can be found:

    grep -i apache.*openssl *_log

    eg error_log ...

  • restart apache, for example, to get the latest information.

    rcapache2 restart # or service apache2 restart

  • check recent log entries e.g.

    /var/log/apache2 # tail error_log

    [Thu Jun 09 07:42:24 2016] [notice] Apache/... (Linux/...) mod_ssl/2.2.22 OpenSSL/1.0.1t ...

-one
Jun 09 '16 at 6:01
source share



All Articles