Nginx 1.10编译安装过程

Nginx 1.10编译安装过程 - 1
好好玩哦

yum install gcc gcc-c++ automake zlib-devel  openssl-devel pcre-devel #安装编译所需软件包
yum install git #安装git
#下载nginx
git clone https://github.com/nginx/nginx.git stable/1.10 #
unzip nginx-1.10.zip
cd nginx-1.10/auto
#添加nginx系统用户和组
groupadd -r nginx
useradd -s /sbin/nologin -g nginx -r nginx
#最新版本有点奇怪,执行后会出现./configure: line 10: auto/options: No such file or directory这种错误,只需要把auto下面的configure移动到上级目录就可以了
mv configure ..
#开始编译安装
cd ..
./configure
--group=nginx #指定nginx工作组
--user=nginx #指定nginx工作用户
--prefix=/usr/local/nginx #指定nginx安装目录
--conf-path=/etc/nginx/nginx.conf #指定nginx配置文件
--error-log-path=/var/log/nginx/error.log #指定错误日志
--pid-path=/tmp/nginx/nginx.pid #指定nginx进程文件
--http-log-path=/var/log/nginx/access.log #指定访问日志
--with-http_ssl_module #添加SSL模块
--sbin-path=/usr/bin/nginx #指定nginx命令位置
make && make install
nginx #启动NGINX

2 thoughts on “Nginx 1.10编译安装过程”

Leave a Reply

Your email address will not be published. Required fields are marked *