Linux安装Nginx手册
2018-02-26 14:25
381 查看
将压缩文件都拷贝到/usr/local目录下面:
1、安装zlib-1.2.11.tar.gz
解压:tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configuremake make install 2、安装pcre-8.40.tar.gz 解压:tar –zxvf pcre-8.40.tar.gz
cd pcre-8.40
./configure
make
make install
3、安装openssl-1.0.1s.tar.gz
tar -zxf openssl-1.0.1s.tar.gz
cd openssl-1.0.1s
./config
make
make test
make install
4、安装nginx-1.11.13.tar.gz
cd nginx-1.11.13
./configure --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --pid-path=/usr/local/nginx/sbin/nginx.pid --with-http_ssl_module --with-pcre=../pcre-8.40 --with-zlib=../zlib-1.2.11
或者
./configure --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf--pid-path=/usr/local/nginx/sbin/nginx.pid --with-http_ssl_module --with-stream--with-pcre=../pcre-8.40 --with-zlib=../zlib-1.2.11 --with-openssl=/usr/local/sslmake
make install
测试nginx.conf的配置是否正确: /usr/local/nginx/sbin/nginx -t
根据nginx.conf里的配置,启动nginx服务 : /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
出现错误:错误1:checking for OS
+ Linux 2.6.32-431.el6.x86_64 x86_64
checking for Ccompiler ... not found
./configure:error: C compiler cc is not found
执行脚本:yum install gcc-c++
yum cleanall
yum makecache
错误2:./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSLlibrary
into the system, or build the OpenSSL library statically from thesource
with nginx by using --with-openssl=<path> option.
获取路径which openssl
添加--with-openssl=/usr/bin/openssl
错误3:[/usr/local/openssl//.openssl/include/openssl/ssl.h]Error 127解决方案:
打开nginx源文件下的/usr/local/src/nginx-1.11.13/auto/lib/openssl/conf文件:
找到这么一段代码:
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
修改成以下代码:
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
1、安装zlib-1.2.11.tar.gz
解压:tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configuremake make install 2、安装pcre-8.40.tar.gz 解压:tar –zxvf pcre-8.40.tar.gz
cd pcre-8.40
./configure
make
make install
3、安装openssl-1.0.1s.tar.gz
tar -zxf openssl-1.0.1s.tar.gz
cd openssl-1.0.1s
./config
make
make test
make install
4、安装nginx-1.11.13.tar.gz
cd nginx-1.11.13
./configure --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --pid-path=/usr/local/nginx/sbin/nginx.pid --with-http_ssl_module --with-pcre=../pcre-8.40 --with-zlib=../zlib-1.2.11
或者
./configure --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf--pid-path=/usr/local/nginx/sbin/nginx.pid --with-http_ssl_module --with-stream--with-pcre=../pcre-8.40 --with-zlib=../zlib-1.2.11 --with-openssl=/usr/local/sslmake
make install
测试nginx.conf的配置是否正确: /usr/local/nginx/sbin/nginx -t
根据nginx.conf里的配置,启动nginx服务 : /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
出现错误:错误1:checking for OS
+ Linux 2.6.32-431.el6.x86_64 x86_64
checking for Ccompiler ... not found
./configure:error: C compiler cc is not found
执行脚本:yum install gcc-c++
yum cleanall
yum makecache
错误2:./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSLlibrary
into the system, or build the OpenSSL library statically from thesource
with nginx by using --with-openssl=<path> option.
获取路径which openssl
添加--with-openssl=/usr/bin/openssl
错误3:[/usr/local/openssl//.openssl/include/openssl/ssl.h]Error 127解决方案:
打开nginx源文件下的/usr/local/src/nginx-1.11.13/auto/lib/openssl/conf文件:
找到这么一段代码:
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
修改成以下代码:
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
相关文章推荐
- 安装服务Memcached+Nginx+Php linux下安装手册
- Linux 系列(一)——Nginx 安装手册
- Memcached+Nginx+Php linux下安装手册
- Linux下Nginx+modsecurity安装手册
- centos7_ linux : Nginx安装手册
- Linux下安装Nginx详细图解教程
- Linux 编译安装nginx
- linux 安装 nginx
- Linux下源码安装nginx
- Linux下安装Nginx1.9.3
- linux 下安装 nginx
- Linux学习总结(22)——CentOS7.2安装Nginx
- Linux下怎么确定Nginx安装目录
- linux nginx svn 安装
- linux安装nginx
- linux下安装nginx
- Linux下怎么确定Nginx安装目录、版本号信息?
- linux(Centos 7) 安装php和nginx
- linux 编译式安装nginx
- windows、linux双系统安装手册