Nginx安装加载ssl错误问题分析:

[root@localhost nginx-1.0.11]# make

make -f objs/Makefile

make[1]: Entering directory `/usr/local/src/nginx-1.0.11'

cd /etc/pki/tls/certs/Makefile \

       && make clean \

       && ./config --prefix=/etc/pki/tls/certs/Makefile/.openssl no-shared  no-threads \

       && make \

       && make install LIBDIR=lib

/bin/sh: line 0: cd: /etc/pki/tls/certs/Makefile: Not a directory

make[1]: *** [/etc/pki/tls/certs/Makefile/.openssl/include/openssl/ssl.h] Error 1

make[1]: Leaving directory `/usr/local/src/nginx-1.0.11'

make: *** [build] Error 2

       

       出现这个问题决绝办法:将你编译代命了也就是 with-openssl=/______这个路径指向你的源码安装包路径而不是你安装后的路径!

–with-pcre Nginx的rewrite功能需要使用pcre库才能工作,而Nginx的编译参数里面的这个选项并不是像常规的那样指定pcre的安装目录,而是指定pcre源代码的目录。
也就是说,如果你的系统路径下已经可以找到pcre的lib和
include文件,这个选项可以不指定了。如果你的系统没有安装pcre,那么就指定该选项,Nginx会在编译的时候从你指定的这个目录把pcre编译进来。


with-openssl
–with-zlib
–with-md5
–with-sha1

这几个选项跟pcre一样,指定的是源代码目录,不是这些类库的安装目录。


解决:


使用yum来安装openssl,安装时

若有这样的错:”This system is not registered with RHN”

就用下边方法解决:

|举报|字号订阅

红帽中出现This system is not registered with RHN这个的原因是因为红帽中没有注册RHN。解决办法:(假定你已安装yum,且网络畅通)更改yum的源,即更换/etc/yum.repos.d /rhel-debuginfo.repo 这个文件。进入/etc/yum.repos.d/目录,终端中输入wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo即可在此目录下得到CentOS- Base.repo文件,这是centos的源文件,只需将其重命名为rhel-debuginfo.repo即可,以前的文件做个备份。


随后执行命令

yum install openssl