冰恋 发表于 2018-11-8 08:23:57

nginx openssl

  分别在suse-i586_sp3与centos6.0-x86_64下安装试安装了nginx及openssl,以下把安装中出现的错误及解决方法记了下
  1.环境:操作系统--SUSE-i586_sp3
  nginx-0.8.54    zlib-1.2.3.tar.gzpcre-8.10.tar.gzopenssl-0.9.8d.tar.gz
  2>.安装要求(只做反向代理):
  nginx编译选项:
  ./configure --prefix=/usr/local/nginx --with-poll_module --with-
  http_ssl_module --with-http_stub_status_module --with-pcre
  3>.出现问题:
  a.编译时发现没有gcc--从安装光盘安装--把安装安装光盘放入光驱---执行    mount /dev/cdrom /mnt---错误---再执行 mount /dev/sr0 /mnt 提示XXX superblock,制作iso镜像:dd if=/dev/sr0 of=/root/suse10.iso--mount -o loop -t iso9660 /root/suse10.iso /mnt
  b.再编译时,提示没有 openssl library --下载openssl-0.9.8d.tar.gz--tar xf openssl-0.9.8d.tar.gz
  c.加参数 --with-openssl=/usr/local/src/openssl-0.9.8d/---提示没有 zlib
  library--下载zlib-1.2.3.tar.gz--tar xf zlib-1.2.3.tar.gz
  d.加参数 --with-zlib=/usr/local/src/zlib   --出现如下错误:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cd /usr/local/src/zlib/ \
  && make distclean \
  && CFLAGS="-O2 -fomit-frame-pointer -pipe " CC="gcc" \
  ./configure \
  && make libz.a
  make: Entering directory `/usr/local/src/zlib'
  make: *** No rule to make target `distclean'.Stop.
  make: Leaving directory `/usr/local/src/zlib'
  make: *** Error 2
  make: Leaving directory `/usr/local/src/nginx-0.8.54'
  make: *** Error 2
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~把
  ./configure ......--with-zlib/换成
  ./configure ......--with-zlib/1.2.3/
  make的时候就没有报错了,
  又执行
  make install ,
  又出现以下错误:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~make: *** Error 1
  make: Leaving directory `/usr/local/src/openssl-0.9.8d/apps'
  make: *** Error 2
  make: Leaving directory `/usr/local/src/openssl-0.9.8d/apps'
  make: *** Error 1
  make: Leaving directory `/usr/local/src/openssl-0.9.8d'
  make: *** [../openssl-0.9.8d/.openssl/include/openssl/ssl.h] Error 2
  make: Leaving directory `/usr/local/src/nginx-0.8.54'
  make: *** Error 2
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  执行makeclean后,再makeinstall,安装成功
  2.centos6.0-x86_64
  1>.执行步骤:a. yum groupinstall "Development Tools" -y
  2>.安装nginx :   a. ./configure --prefix=/usr/local/nginx --with-poll_module --with-http_ssl_module --with-http_stub_status_module --with-pcre=/root/workstation/pcre-8.10 --with-openssl=/root/workstation/openssl-0.9.8d --with-zlib=/root/workstation/zlib/1.2.3
  b.错误:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  : Entering directory `/root/workstation/openssl-0.9.8d/crypto/md5'
  gcc -I.. -I../.. -I../../include -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -DMD5_ASM   -c -o md5_dgst.o md5_dgst.c
  gcc -I.. -I../.. -I../../include -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -DMD5_ASM   -c -o md5_one.o md5_one.c
  /usr/bin/perl asm/md5-x86_64.pl md5-x86_64.s
  gcc -I.. -I../.. -I../../include -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -DMD5_ASM -c-o md5-x86_64.o md5-x86_64.s
  md5-x86_64.s: Assembler messages:
  md5-x86_64.s:41: Error: 0xd76aa478 out range of signed 32bit displacement
  md5-x86_64.s:50: Error: 0xe8c7b756 out range of signed 32bit displacement
  md5-x86_64.s:68: Error: 0xc1bdceee out range of signed 32bit displacement
  md5-x86_64.s:77: Error: 0xf57c0faf out range of signed 32bit displacement
  md5-x86_64.s:95: Error: 0xa8304613 out range of signed 32bit displacement
  md5-x86_64.s:104: Error: 0xfd469501 out range of signed 32bit displacement
  md5-x86_64.s:122: Error: 0x8b44f7af out range of signed 32bit displacement
  md5-x86_64.s:131: Error: 0xffff5bb1 out range of signed 32bit displacement
  md5-x86_64.s:140: Error: 0x895cd7be out range of signed 32bit displacement
  md5-x86_64.s:158: Error: 0xfd987193 out range of signed 32bit displacement
  md5-x86_64.s:167: Error: 0xa679438e out range of signed 32bit displacement
  md5-x86_64.s:187: Error: 0xf61e2562 out range of signed 32bit displacement
  md5-x86_64.s:196: Error: 0xc040b340 out range of signed 32bit displacement
  md5-x86_64.s:214: Error: 0xe9b6c7aa out range of signed 32bit displacement
  md5-x86_64.s:223: Error: 0xd62f105d out range of signed 32bit displacement
  md5-x86_64.s:241: Error: 0xd8a1e681 out range of signed 32bit displacement
  md5-x86_64.s:250: Error: 0xe7d3fbc8 out range of signed 32bit displacement
  md5-x86_64.s:268: Error: 0xc33707d6 out range of signed 32bit displacement
  md5-x86_64.s:277: Error: 0xf4d50d87 out range of signed 32bit displacement
  md5-x86_64.s:295: Error: 0xa9e3e905 out range of signed 32bit displacement
  md5-x86_64.s:304: Error: 0xfcefa3f8 out range of signed 32bit displacement
  md5-x86_64.s:322: Error: 0x8d2a4c8a out range of signed 32bit displacement
  md5-x86_64.s:332: Error: 0xfffa3942 out range of signed 32bit displacement
  md5-x86_64.s:340: Error: 0x8771f681 out range of signed 32bit displacement
  md5-x86_64.s:356: Error: 0xfde5380c out range of signed 32bit displacement
  md5-x86_64.s:364: Error: 0xa4beea44 out range of signed 32bit displacement
  md5-x86_64.s:380: Error: 0xf6bb4b60 out range of signed 32bit displacement
  md5-x86_64.s:388: Error: 0xbebfbc70 out range of signed 32bit displacement
  md5-x86_64.s:404: Error: 0xeaa127fa out range of signed 32bit displacement
  md5-x86_64.s:412: Error: 0xd4ef3085 out range of signed 32bit displacement
  md5-x86_64.s:428: Error: 0xd9d4d039 out range of signed 32bit displacement
  md5-x86_64.s:436: Error: 0xe6db99e5 out range of signed 32bit displacement
  md5-x86_64.s:452: Error: 0xc4ac5665 out range of signed 32bit displacement
  md5-x86_64.s:463: Error: 0xf4292244 out range of signed 32bit displacement
  md5-x86_64.s:481: Error: 0xab9423a7 out range of signed 32bit displacement
  md5-x86_64.s:490: Error: 0xfc93a039 out range of signed 32bit displacement
  md5-x86_64.s:508: Error: 0x8f0ccc92 out range of signed 32bit displacement
  md5-x86_64.s:517: Error: 0xffeff47d out range of signed 32bit displacement
  md5-x86_64.s:526: Error: 0x85845dd1 out range of signed 32bit displacement
  md5-x86_64.s:544: Error: 0xfe2ce6e0 out range of signed 32bit displacement
  md5-x86_64.s:553: Error: 0xa3014314 out range of signed 32bit displacement
  md5-x86_64.s:571: Error: 0xf7537e82 out range of signed 32bit displacement
  md5-x86_64.s:580: Error: 0xbd3af235 out range of signed 32bit displacement
  md5-x86_64.s:598: Error: 0xeb86d391 out range of signed 32bit displacement
  make: *** 错误 1
  make: Leaving directory `/root/workstation/openssl-0.9.8d/crypto/md5'
  make: *** 错误 1
  make: Leaving directory `/root/workstation/openssl-0.9.8d/crypto'
  make: *** 错误 1
  make: Leaving directory `/root/workstation/openssl-0.9.8d'
  make: *** 错误 2
  make: Leaving directory `/root/workstation/nginx-0.8.54'
  make: *** 错误 2
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3>.解决:
  a.google了下,得到是版本问题,参考:http://forums.gentoo.org/viewtopic-t-802600.html;
  b.下载最新版本 openssl-1.0.0e.tar.gz : http://www.openssl.org/source/
  c.重新编译 问题解决:./configure --prefix=/usr/local/nginx --with-poll_module --with-http_ssl_module --with-http_stub_status_module --with-pcre=/root/workstation/pcre-8.10 --with-openssl=/root/workstation/openssl-1.0.0e--with-zlib=/root/workstation/zlib/1.2.3/
  3.总结
  在suse10中安装主要是因为zlib,在编译nginx 的时候,参数--with-zlib=DIR,DIR 应该是zlib.tar.gz的解压次目录,因为在主目录下不能执行编译安装;
  在centos6.0 中的错误完全是因为版本的问题;

页: [1]
查看完整版本: nginx openssl