检测和安装环境:
rpm -qa|grep gcc,没有libgcc,gcc,gcc-c++ 3个包则安装:yum install gcc-c++ rpm -qa|grep zlib,(zlib,zlib-devel)两个包,没有则:yum install -y zlib-devel rpm -qa|grep pcre/openssl, 没有则yum install pcre*/openssl*
下载nginx:
http://nginx.org/en/download.html 选择稳定版,而非开发版或旧版
安装nginx:
tar –zxvf nginx-1.12.2.tar.gz 解压 ./configure --prefix=/app/deploy/nginx 配置nginx参数,nginx –t查看配置 make&&make install 编译和安装
配置全局环境变量执行命令或修改/etc/profile文件:
export NGINX_HOME=/app/deploy/nginx export PATH=$PATH:$NGINX_HOME/sbin source /etc/profile export 查看全局变量
启动:
nginx -c /app/deploy/nginx/conf/nginx.conf
nginx -s reload 重启
libpcre.so.0错误:
ln -s /usr/local/lib/libpcre.so.0 /lib64