如何确定是否OpenSSL和mod_ssl的是在安装的Apache2(How to determin

2019-08-03 10:50发布

有谁知道命令,以确定是否OpenSSL和mod_ssl的是在安装的Apache2?

Answer 1:

如果您已经安装在服务器上的PHP,你可以创建一个PHP文件,我们把它称为phpinfo.php的,并添加此<?php echo phpinfo();?> ,并在浏览器中打开该文件,这表明有关系统的信息环境,快速找到你的Apache加载的模块信息,找到所生成的页面上“加载的模块”。



Answer 2:

如果你有你的服务器上安装PHP,你可以使用“在运行时赤它extension_loaded ” funciontion。 像这样:

<?php
if (!extension_loaded('openssl')) {
    // no openssl extension loaded.
}
?>


Answer 3:

通常,当您编译的Apache2服务器(或包装设施的东西安装它),你可以检查可用通过点击此命令可以使用任何指令that're:

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

如果您没有看到任何支持SSL的指令,这意味着你不必与mod_ssl的编译Apache2的。

希望它帮助;)



Answer 4:

默认的Apache安装配置为发送对服务器标题行此信息。 您可以使用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


Answer 5:

使用下面的命令。

$ 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)


Answer 6:

如果你只是运行openssl在终端也应提供OpenSSL的外壳。 我的第一个线索,知道我没有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



Answer 7:

要确定的OpenSSLssl_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


Answer 8:

使用Apache 2,你可以看到哪些模块目前由HTTP守护进程加载运行以下命令:

apache2ctl -M

-M选项实际上只是传递给httpd的参数。

apache2ctl是一个前端到Apache超文本传输​​协议(HTTP)服务器。 它的目的是帮助管理员控制Apache的Apache2守护进程的功能。

  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. 


Answer 9:

幸运的是,大多数Linux口味有OpenSSL的“开箱即用”。

要验证安装:

openssl version
响应:
OpenSSL 1.0.1t 3 May 2016

注:OpenSSL版本1.0.1通过1.0.1f(含)
易受OpenSSL的心脏出血漏洞的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



Answer 10:

您应该安装此阿帕奇国防部, http://httpd.apache.org/docs/2.0/mod/mod_info.html ,它基本上给你运行你正在使用MODS的和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



Answer 11:

只要看看在你的Apache日志目录的ssl_engine.log,你应该找这样的:

[ssl:info] [pid 5963:tid 139718276048640] AH01876: mod_ssl/2.4.9 compiled against Server: Apache/2.4.9, Library: OpenSSL/1.0.1h


Answer 12:

验证在PHP命令谎言

 $php -i | grep openssl


Answer 13:

启用在httpd.conf了mod_ssl并重新启动Apache。 您将看到OpenSSL的信息error.log中,如下

 [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' 



Answer 14:

为了找到ssl version

  1. 转到Apache的bin文件夹在命令提示符
  2. 输入以下命令“OpenSSL的版本”


Answer 15:

在我的情况下,这是我得到的信息:

  • 寻找到Apache日志的位置,并去那里,在我的情况:

    cd /var/log/apache2

  • 在其中找到日志OpenSSL的信息可以发现:

    grep -i apache.*openssl *_log

    eg 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 ...



文章来源: How to determine if OpenSSL and mod_ssl are installed on Apache2
标签: ssl apache2