我如何确定是否在Apache2上安装了OpenSSL和mod_ssl
有没有人知道命令,以确定是否OpenSSL和mod_ssl安装在apache2?
问候,菲奥娜
如果您的服务器上安装了PHP,您可以创build一个php文件,我们称之为phpinfo.php并添加这个<?php echo phpinfo();?> ,然后在浏览器中打开该文件,这会显示有关您的系统的信息环境,快速find有关Apache加载模块的信息,find页面上的“加载模块”。 
如果您的服务器上安装了PHP,则可以使用“ extension_loaded ”function在运行时使用它。 像这样:
 <?php if (!extension_loaded('openssl')) { // no openssl extension loaded. } ?> 
通常,当你编译你的apache2服务器(或者通过包工具来安装)时,你可以通过点击这个命令来检查是否有可用的指令:
 ~# $(which httpd) -L | grep SSL # on RHEL/CentOS/Fedora ~# $(which apache2) -L | grep SSL # on Ubuntu/Debian 
如果你没有看到任何SSL *指令,这意味着你没有编译mod_ssl的apache2。
希望有帮助;)
默认的Apache安装被configuration为在服务器标题行上发送这些信息。 您可以使用curl命令查看任何服务器。
 $ 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 
使用以下命令。
 $ openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 (or similar output) 
对于RHEL / CentOS / Fedora:
 $ httpd -t -D DUMP_MODULES | grep ssl ssl_module (shared) 
对于Ubuntu / Debian
 $ apache2 -t -D DUMP_MODULES | grep ssl ssl_module (shared) 
对于SUSE
 $ httpd2 -t -D DUMP_MODUELS | grep ssl ssl_module (shared) 
 如果你只是在你的terminal中运行openssl ,它应该提供openSSL shell。 我知道我没有mode_ssl第一个线索是当我在虚拟主机文件中添加SSLEngine on后出现以下错误: 
 Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration 
 在Centos中,我只需要通过yum install mod_ssl来安装它 
确定openssl & 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 
要么
 # rpm -qa | grep ssl 
幸运的是,大部分的Linux都有OpenSSL“开箱即用”。
validation安装:
 openssl version 
 响应: 
 OpenSSL 1.0.1t 3 May 2016 
  注意:版本OpenSSL 1.0.1到1.0.1f(含) 
  容易受到OpenSSL Heartbleed Bug的影响。 
  版本1.0.1g和更高版本是固定的。 
有关其他安装信息:
  Ubuntu的/ Debian的 
 dpkg -l | grep -i openssl 
 响应: 
 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
 是的,安装OpenSSL! 
如果你没有安装OpenSSL,请尝试:
 于Debian / Ubuntu: 
 sudo apt-get install openssl 
 红帽/ CentOS的: 
 yum install openssl 
你应该安装这个Apache mod, http://httpd.apache.org/docs/2.0/mod/mod_info.html ,它基本上给你一个你正在使用的mod和Apache设置的运行。 我有这个在我的Apache启用,它给了我这个信息为我的网站,
服务器版本: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
只要看看你的Apache日志目录中的ssl_engine.log ,你应该find如下所示:
 [ssl:info] [pid 5963:tid 139718276048640] AH01876: mod_ssl/2.4.9 compiled against Server: Apache/2.4.9, Library: OpenSSL/1.0.1h 
使用Apache 2,可以通过运行以下命令来查看HTTP守护程序当前加载的模块:
 apache2ctl -M 
  -M选项实际上只是一个传递给httpd的参数。 
apache2ctl是Apache超文本传输协议(HTTP)服务器的前端。 它旨在帮助pipe理员控制Apache apache2守护进程的function。
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.
就我而言,这是我得到的信息:
- 
findapache日志所在的地方,然后去那里,在我的情况下: cd /var/log/apache2
- 
find可以find哪些日志openssl信息: grep -i apache.*openssl *_logeg error_log ...
- 
获取新鲜的信息,重新启动Apache,例如 rcapache2 restart # or service apache2 restart
- 
检查日志中的最后一个条目,例如 /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 ...