编译安装nginx
2016-04-16 20:36
483 查看
系统版本:centos6.4
工具:nginx-1.8.1.tar.gz、pcre-8.37.tar.gz
搭建好编译环境:
本地源:yum - y groupinstall "Development tools" "Server Platform Development"
将工具nginx-1.8.1.tar.gz、pcre-8.37.tar.gz放在/root下面,于是
tar xf pcre-8.37.tar.gz
cd pcre-8.37
./configure --prefix=/usr/local/pcre
make && make install
注:nginx安装所需的库:pcre库,安装pcre库是为了nginx支持http rewrite模块
于是开始安装nginx:
useradd -M -s /sbin/nologin nginx
tar xf nginx-1.8.1.tar.gz
./configure --user-user --group-nginx --prefix=/usr/local/nginx-1.8.1 --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/pcre
make
注意:当./configure完成后执行make的时候出现如下错误:
cd /usr/local/pcre/ \
&& if [ -f Makefile ]; then make distclean; fi \
&& CC="gcc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \
./configure --disable-shared
/bin/sh: line 2: ./configure: No such file or directory
make[1]: *** [/usr/local/pcre//Makefile] Error 127
于是查看编译的参数
./configure --help找到了如下:
--with-pcre=DIR set path to PCRE library sources:设置路径为pcre库源
于是改变pcre路径重新来过
./configure --user-user --group-nginx --prefix=/usr/local/nginx-1.8.1 --with-http_stub_status_module --with-http_ssl_module --with-pcre=/root/pcre-8.37
make
make install
至此编译nginx完成
ln -s /usr/local/nginx-1.8.1/ /usr/local/nginx
[root@nginx nginx-1.8.1]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.8.1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.8.1/conf/nginx.conf test is successful
工具:nginx-1.8.1.tar.gz、pcre-8.37.tar.gz
搭建好编译环境:
本地源:yum - y groupinstall "Development tools" "Server Platform Development"
将工具nginx-1.8.1.tar.gz、pcre-8.37.tar.gz放在/root下面,于是
tar xf pcre-8.37.tar.gz
cd pcre-8.37
./configure --prefix=/usr/local/pcre
make && make install
注:nginx安装所需的库:pcre库,安装pcre库是为了nginx支持http rewrite模块
于是开始安装nginx:
useradd -M -s /sbin/nologin nginx
tar xf nginx-1.8.1.tar.gz
./configure --user-user --group-nginx --prefix=/usr/local/nginx-1.8.1 --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/pcre
make
注意:当./configure完成后执行make的时候出现如下错误:
cd /usr/local/pcre/ \
&& if [ -f Makefile ]; then make distclean; fi \
&& CC="gcc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \
./configure --disable-shared
/bin/sh: line 2: ./configure: No such file or directory
make[1]: *** [/usr/local/pcre//Makefile] Error 127
于是查看编译的参数
./configure --help找到了如下:
--with-pcre=DIR set path to PCRE library sources:设置路径为pcre库源
于是改变pcre路径重新来过
./configure --user-user --group-nginx --prefix=/usr/local/nginx-1.8.1 --with-http_stub_status_module --with-http_ssl_module --with-pcre=/root/pcre-8.37
make
make install
至此编译nginx完成
ln -s /usr/local/nginx-1.8.1/ /usr/local/nginx
[root@nginx nginx-1.8.1]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.8.1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.8.1/conf/nginx.conf test is successful
相关文章推荐
- linux+nginx+mysql+php
- Nginx启动/重启失败
- nginx的server_name配置
- [转] nginx 开启gzip压缩--字符串压缩比率很牛叉
- Apacche与Nginx优缺点比较
- nginx配置性能优化
- nginx lvs haproxy负载优缺点比较
- 基于Nginx1.9+LuaJIT+Kafka的点播监控系统实战(上海卓越智慧树网点播监控系统)
- nginx 一二事(1) - 简单图片服务器解决方案
- nginx 父子进程通信 channel
- Nginx与Lua
- 由Lua 粘合的Nginx生态环境
- Nginx配置Awstats分析Nginx日志笔记
- Nginx配置文件详细说明
- nginx1.8.1(稳定版本) nginx.conf 配置文件详解二
- nginx1.8.1(稳定版本) ngixn.conf 配置文件详解一
- windows7 下nginx1.8.1(稳定版本) 启动、停止和重新加载配置
- windows7 集成nginx 1.8.1(稳定版本)
- fastDFS+nginx配置
- nginx 访问路径配置