nginx 怎样编译安装

回复 收藏
一、安装nginx时必须先安装相应的编译工具
yum -y install gcc gcc-c++ autoconf automake
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
建立nginx 组
groupadd -r nginx
useradd -s /sbin/nologin -g nginx -r nginx
id nginx
zlib:nginx提供gzip模块,需要zlib库支持
openssl:nginx提供ssl功能
pcre:支持地址重写rewrite功能
二、tar -zxvf nginx-1.2.8.tar.gz
三、cd nginx-1.2.8

四、./configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx/nginx.pid \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi \
--with-http_stub_status_module
五、make && make install

若centos没有安装make编译器
解决:yum -y install gcc automake autoconf libtool make


2016-04-14 23:11 举报
已邀请:
0

tkk

赞同来自:

有没有遇到什么错误~~!
0

gsy36559067

赞同来自:

tkk 发表于 2016-4-15 12:08
有没有遇到什么错误~~!

你指的错误是?

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: