Nginx-0.7.X 集成openssl 安装出错解决
今天线上需要安装nginx,提供下载使用,并集成openssl 提供加密认证
安装环境[CentOS release 5 (Final) _x86_64 系统]
Nginx 版本:nginx-0.7.65
Openssl版本:openssl-0.9.8m
软件下载:
openssl:wget http://www.openssl.org/source/openssl-0.9.8m.tar.gz
Nginx:http://mirrors.sohu.com/nginx/nginx-0.7.65.tar.gz
解压Openssl,Nginx
以上没有问题,最后安装Openssl
PS:网上文章出错原因
1: 编译安装Nginx 路径不对,Openssl 路径指向不对,不是/opt/app/openssl 而是源码目录,也就是本环境中的/opt/app/openssl-0.9.8m
2:没有安装PCRE 软件包,注意,如果是通过Yum 安装的,一定安装pcre-devel软件包,如下:
[root@clear nginx-0.7.65]# yum install pcre-devel
3:64位系统环境中安装的软件要注意软件安装路径下的lib 目录。看是否是手动指定lib64还是软件自动检测的!!,如Nginx 编译调用openssl 头文件
如下的代码中,可以看到Nginx 调用默认调用的是/opt/app/openssl-0.9.8m/.openssl 目录下的头文件
安装环境[CentOS release 5 (Final) _x86_64 系统]
Nginx 版本:nginx-0.7.65
Openssl版本:openssl-0.9.8m
软件下载:
openssl:wget http://www.openssl.org/source/openssl-0.9.8m.tar.gz
Nginx:http://mirrors.sohu.com/nginx/nginx-0.7.65.tar.gz
解压Openssl,Nginx
引用
[root@clear app]# tar -zxvf openssl-0.9.8m.tar.gz
[root@clear openssl-0.9.8m]# pwd
/opt/app/openssl-0.9.8m -----解压路径
[root@clear src]# tar -zxvf nginx-0.7.65.tar.gz
[root@clear nginx-0.7.65]# --prefix=/opt/app/nginx/ --with-http_stub_status_module --with-http_ssl_module --with-openssl=/opt/app/openssl-0.9.8m --user=nginx --group=nginx
[root@clear nginx-0.7.65]# make
[root@clear nginx-0.7.65]# make install
[root@clear openssl-0.9.8m]# pwd
/opt/app/openssl-0.9.8m -----解压路径
[root@clear src]# tar -zxvf nginx-0.7.65.tar.gz
[root@clear nginx-0.7.65]# --prefix=/opt/app/nginx/ --with-http_stub_status_module --with-http_ssl_module --with-openssl=/opt/app/openssl-0.9.8m --user=nginx --group=nginx
[root@clear nginx-0.7.65]# make
[root@clear nginx-0.7.65]# make install
以上没有问题,最后安装Openssl
引用
[root@clear openssl-0.9.8m]# ./config --prefix=/opt/app/openssl
[root@clear openssl-0.9.8m]# make
[root@clear openssl-0.9.8m]# make install
[root@clear openssl-0.9.8m]# make
[root@clear openssl-0.9.8m]# make install
PS:网上文章出错原因
1: 编译安装Nginx 路径不对,Openssl 路径指向不对,不是/opt/app/openssl 而是源码目录,也就是本环境中的/opt/app/openssl-0.9.8m
2:没有安装PCRE 软件包,注意,如果是通过Yum 安装的,一定安装pcre-devel软件包,如下:
[root@clear nginx-0.7.65]# yum install pcre-devel
3:64位系统环境中安装的软件要注意软件安装路径下的lib 目录。看是否是手动指定lib64还是软件自动检测的!!,如Nginx 编译调用openssl 头文件
如下的代码中,可以看到Nginx 调用默认调用的是/opt/app/openssl-0.9.8m/.openssl 目录下的头文件
引用
-I /opt/app/openssl-0.9.8m/.openssl/include \
src/core/ngx_open_file_cache.h \
src/event/ngx_event_openssl.h \
/opt/app/openssl-0.9.8m/.openssl/include/openssl/ssl.h \
-I /opt/app/openssl-0.9.8m/.openssl/include \
objs/src/core/ngx_open_file_cache.o \
objs/src/event/ngx_event_openssl.o \
objs/src/core/ngx_open_file_cache.o \
objs/src/event/ngx_event_openssl.o \
-lcrypt -lpcre /opt/app/openssl-0.9.8m/.openssl/lib/libssl.a /opt/app/openssl-0.9.8m/.openssl/lib/libcrypto.a -ldl -lz
objs/src/core/ngx_open_file_cache.o: $(CORE_DEPS) \
src/core/ngx_open_file_cache.c
-o objs/src/core/ngx_open_file_cache.o \
src/core/ngx_open_file_cache.c
objs/src/event/ngx_event_openssl.o: $(CORE_DEPS) \
src/event/ngx_event_openssl.c
-o objs/src/event/ngx_event_openssl.o \
src/event/ngx_event_openssl.c
/opt/app/openssl-0.9.8m/.openssl/include/openssl/ssl.h: objs/Makefile
cd /opt/app/openssl-0.9.8m \
&& ./config --prefix=/opt/app/openssl-0.9.8m/.openssl no-shared no-threads \
src/core/ngx_open_file_cache.h \
src/event/ngx_event_openssl.h \
/opt/app/openssl-0.9.8m/.openssl/include/openssl/ssl.h \
-I /opt/app/openssl-0.9.8m/.openssl/include \
objs/src/core/ngx_open_file_cache.o \
objs/src/event/ngx_event_openssl.o \
objs/src/core/ngx_open_file_cache.o \
objs/src/event/ngx_event_openssl.o \
-lcrypt -lpcre /opt/app/openssl-0.9.8m/.openssl/lib/libssl.a /opt/app/openssl-0.9.8m/.openssl/lib/libcrypto.a -ldl -lz
objs/src/core/ngx_open_file_cache.o: $(CORE_DEPS) \
src/core/ngx_open_file_cache.c
-o objs/src/core/ngx_open_file_cache.o \
src/core/ngx_open_file_cache.c
objs/src/event/ngx_event_openssl.o: $(CORE_DEPS) \
src/event/ngx_event_openssl.c
-o objs/src/event/ngx_event_openssl.o \
src/event/ngx_event_openssl.c
/opt/app/openssl-0.9.8m/.openssl/include/openssl/ssl.h: objs/Makefile
cd /opt/app/openssl-0.9.8m \
&& ./config --prefix=/opt/app/openssl-0.9.8m/.openssl no-shared no-threads \
相关推荐
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10
windle 2020-10-29