1.下载安装依赖包:
安装gcc,gcc-c++; openssl;pcre;zlib
2.下载nginx包并安装
tar -zxvf nginx-1.10.3.tar.gz
cd nginx-1.10.3
编译
./configure --prefix=/usr/local/nginx-1.10.3
--witch-openssl= #指的是openssl源码路径
--with-pcre=
--with-zlib=
--with-http_ssl_module
make
make install
3.修改nginx配置文件报错排查
nginx: [emerg] getpwnam("nginx") failed in /usr/local/nginx-1.10.3/conf/nginx.conf:2 #第二行内容如下user nginx nginx;
解决方法: useradd nginx
nginx: [error] invalid PID number "" in "/usr/local/var/run/nginx/nginx.pid"
# ./nginx -c /usr/local/nginx-1.6/conf/nginx.conf
# ./nginx -s reload