wdcp自带的Apache 2.2.24 ,如何安装mod_ssl.so模块?(不支持ssl/https)
[i=s] 本帖最后由 zhipengw 于 2017-10-17 20:13 编辑 [/i]wdcp自带的Apache 2.2.24 没有ssl组件,需要安装mod_ssl.so,然后设置调用,
论坛中找到Apache 2.2.22的配置方法,但是没找到Apache 2.2.24的mod_ssl.so的安装文件,
如果使用云在线安装(yum -y install mod_ssl),则配置好的网址无法正常访问;
请问如何让Apache 2.2.24 支持ssl?
下面是论坛中找到的方法,经测试都不行
---------------
以最流行的wdlinux系统为例,说说怎么添加SSL模块。
1、下载httpd-2.2.22,下载地址:http://download.csdn.net/detail/qq363685855/9821211
(注意,如果是别的版本,就去下载对应的版本。)
2、下载以后,把压缩包里的下面两个文件夹:httpd-2.2.22\modules\loggers和httpd-2.2.22\modules\ssl 上传到服务器目录:/www/wdlinux/httpd-2.2.24/modules 下。
3、使用 whereis openssl 命令获取lib和include的路径。
4、然后运行命令:cd /www/wdlinux/httpd-2.2.24/modules/ssl
这样在apache 源码的modules/ssl文件夹下,使用命令:
/www/wdlinux/httpd-2.2.24/bin/apxs -i -a -D HAVE_OPENSSL=1 -I/usr/include/openssl/ -L/usr/lib64/openssl/ -c *.c -lcrypto -lssl -ldl
注意:上面的apxs路径修改一下。
这样,mod_ssl.so模块就成功添加进去了。
------------------
检查apache是否安装了 mod_ssl.so模块。
检查方法是查看是否在 modules (/www/wdlinux/apache/modules/)下存在。不存在那么安装(yum -y install mod_ssl)。
1、编辑Apache根目录下 conf/httpd.conf 文件
找到 #LoadModule ssl_module modules/mod_ssl.so 和 #Include conf/extra/httpd-ssl.conf,去掉前面的#号注释;
2、编辑Apache根目录下 conf/extra/httpd-ssl.conf 文件
修改如下内容:
将<VirtualHost default:443>***</VirtualHost>删除。
3、上传SSL证书
将申请好的SSL证书上传到www/wdlinux/apache/conf/ssl目录下。
注意:apache下的SSL证书是3个文件。
4、启用网站的https访问
在apache/vhost目录下找到网站的配置文件。一般是XXX.conf
使用notepad++打开配置文件,将配置文件中的内容复制一下到配置文件里面,然后将复制的内容中的80修改为443;
在复制的内容中添加以下内容:
SSLEngine on
SSLCertificateFile /www/wdlinux/apache/conf/ssl/2_www.domain.com_cert.crt
SSLCertificateKeyFile /www/wdlinux/apache/conf/ssl/3_www.domain.com.key
SSLCertificateChainFile /www/wdlinux/apache/conf/ssl/1_root_bundle.crt
以上代码的意思是:
第一句开启SSL,
后面三句是SSL证书路径。
5、重启apache
重启下apache,尝试用https访问网站试下呢。
6、将http跳转到https
具体教程看这里:http://www.aitiancheng.com/article-563.html 按照要求 报错了 什么情况
engine_vars.lo ssl_engine_vars.c && touch ssl_engine_vars.slo
ssl_engine_vars.c:870:50: error: ../../modules/loggers/mod_log_config.h: No such file or directory
ssl_engine_vars.c: In function ‘ssl_var_log_config_register’:
ssl_engine_vars.c:881: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
ssl_engine_vars.c:881: error: ‘log_pfn_register’ undeclared (first use in this function)
ssl_engine_vars.c:881: error: (Each undeclared identifier is reported only once
ssl_engine_vars.c:881: error: for each function it appears in.)
ssl_engine_vars.c:883: error: ‘apr_OFN_ap_register_log_handler_t’ undeclared (first use in this function)
ssl_engine_vars.c:883: error: expected expression before ‘)’ token
apxs:Error: Command failed with rc=65536
. loggers 忘记上传 上传上去 执行
/www/wdlinux/httpd-2.2.22/bin/apxs -i -a -D HAVE_OPENSSL=1 -I/usr/include/openssl/ -L/usr/lib/openssl/ -c *.c -lcrypto -lssl -ldl
报错
wdlinux/httpd-2.2.22/include -I/usr/include/openssl/ -DHAVE_OPENSSL=1 -c -o ssl_engine_vars.lo ssl_engine_vars.c && touch ssl_engine_vars.slo
ssl_engine_vars.c:870:50: error: ../../modules/loggers/mod_log_config.h: No such file or directory
ssl_engine_vars.c: In function ‘ssl_var_log_config_register’:
ssl_engine_vars.c:881: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
ssl_engine_vars.c:881: error: ‘log_pfn_register’ undeclared (first use in this function)
ssl_engine_vars.c:881: error: (Each undeclared identifier is reported only once
ssl_engine_vars.c:881: error: for each function it appears in.)
ssl_engine_vars.c:883: error: ‘apr_OFN_ap_register_log_handler_t’ undeclared (first use in this function)
ssl_engine_vars.c:883: error: expected expression before ‘)’ token
apxs:Error: Command failed with rc=65536 路径不对 ? ../../modules/loggers/m 重新测试 成功了
Libraries have been installed in:
/www/wdlinux/httpd-2.2.22/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /www/wdlinux/httpd-2.2.22/modules/mod_ssl.so
[activating module `ssl' in /www/wdlinux/httpd-2.2.22/conf/httpd.conf] 还是没有配置好啊 请求帮助
[root@wdOS ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: /bin/bash: line 1: 2653 Segmentation fault /www/wdlinux/apache/bin/httpd
[FAILED]
页:
[1]