Nginx编译openssl版本兼容或排错修复


The latest stable versions are nginx-0.7.59(软件在FTP里)

本篇文章要用到的相关软件发布FTP:

FTP地址:ftp://www.bkjia.com

用户名:www.bkjia.com

密码:www.muu.cc

2010年LinuxIDC.com\1月\《Nginx编译openssl版本兼容或排错修复》相关软件

在nginx-0.7.59之前,系统自带的openssl版本低于openssl-0.9.8e时编译时报错如下:

    objs/ngx_modules.o \
        -lcrypt -lpcre -lz
objs/src/http/ngx_http_file_cache.o: In function `ngx_http_file_cache_create_key':
/EBS/soft-backup/nginx-0.7.58/src/http/ngx_http_file_cache.c:128: undefined reference to `MD5_Init'
/EBS/soft-backup/nginx-0.7.58/src/http/ngx_http_file_cache.c:138: undefined reference to `MD5_Update'
/EBS/soft-backup/nginx-0.7.58/src/http/ngx_http_file_cache.c:145: undefined reference to `MD5_Final'
collect2: ld returned 1 exit status
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory `/EBS/soft-backup/nginx-0.7.58'
make: *** [build] Error 2
the change log:
Changes with nginx 0.7.59                                        25 May 2009
    *) Feature: the "proxy_cache_methods" and "fastcgi_cache_methods"
       directives.
    *) Bugfix: socket leak; the bug had appeared in 0.7.25.
       Thanks to Maxim Dounin.
    *) Bugfix: a segmentation fault occurred in worker process,
       if a request had no body and the $request_body variable was used;
       the bug had appeared in 0.7.58.
    *) Bugfix: the SSL modules might not built on Solaris and Linux;
       the bug had appeared in 0.7.58.
    *) Bugfix: ngx_http_xslt_filter_module responses were not handled by
       SSI, charset, and gzip filters.
    *) Bugfix: a "charset" directive did not set a charset to
       ngx_http_gzip_static_module responses.

先确定好 openssl 的版本 以及跟nginx的版本匹配,排除一个可能

这里有最新版本的(软件在FTP里)

然后我发现在Makefile 里面,nginx 都是依旧的默认要手动安装,当然不排除linuxtone里面的roin 教的方法,原理就是要搜索 ldconfig 的目录下的libssl.so

ln -sf openssl/lib/libsslXXXX /usr/lib 手动整理库链接

知道归知道,但是对于Makefile不熟悉没找出调用的结构体,而如果有需要(就是无法使用ldconfig或者其他原因)就可以手改Makefile 的目录

~/soft/openssl-0.9.8l/openssl/include/openssl/ssl.h: objs/Makefile
        cd ~/soft/openssl-0.9.8l \
        && $(MAKE) clean \
        && ./config
--prefix=/home/yuan520/soft/nginx-0.7.64/~/soft/openssl-0.9.8l/openssl 这里的路径是错误的,具体按需修改,顺利指向你的openssl目录即可

no-shared no-threads \   ---虽然说使用挂了no-shared 理论上会不和其他版本的openssl冲突,但是实际上我试验了却不行,依旧需要处理好版本兼容的问题
        && $(MAKE) \
        && $(MAKE) install

另外还有一个就是openssl 是包括md5的,但是如果你想使用自己的md5的话。(软件在FTP里)

相关内容