源代码编译安装nginx
来源:互联网 发布:淘宝1元秒杀入口 编辑:程序博客网 时间:2024/06/05 11:53
源代码编译安装nginx
安装前的准备
- 保证安装编译环境
# yum group list
查看是否有安装Development
没有的话安装Development# yum group install "Development"
- wget 源代码包
我是在官网上下载的,在http://nginx.org 中找到适合适合CentOS安装的版本。# wget http://nginx.org/download/nginx-1.4.7.tar.gz
- 解压
# tar xf nginx-1.4.7.tar.gz
进入目录查看帮助信息并安装
# cd nginx-1.4.7
# ./configure --help
# cnfigure --prefix=/usr/local/nginx
- 报错,安装出现问题:
” ./configure: error: the HTTP rewrite module requires the PCRE library.You can either disable the module by using –without-http_rewrite_moduleoption, or install the PCRE library into the system, or build the PCRE librarystatically from the source with nginx by using –with-pcre= option.”
问题是需要PCRE的共享库(library) - 下载,一般这个共享库的命名为:package_name-devel-xxx
# yum install pcre-devel
再次安装# ./configure --prefix=/usr/local/nginx
- 报错,依旧是共享库的问题:
“./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using –without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using –with-zlib= option.”
这次是zlib的共享库 - 下载zlib共享库
# yum install zlib-devel
再次安装# ./configure --prefix=/usr/local/nginx
Configuration summary \+ using system PCRE library \+ OpenSSL library is not used \+ using builtin md5 code \+ sha1 library is not found \+ using system zlib library nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/sbin/nginx" nginx configuration prefix: "/usr/local/nginx/conf" nginx configuration file: "/usr/local/nginx/conf/nginx.conf" nginx pid file: "/usr/local/nginx/logs/nginx.pid" nginx error log file: "/usr/local/nginx/logs/error.log" nginx http access log file: "/usr/local/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp"
显示这段信息时则表明安装成功。
- 报错,安装出现问题:
- 开始编译
# make
注意,make命令必须才./configure所在的目录中执行。 - 安装
# make install
- 启动服务
# /usr/local/nginx/sbin/nginx
- 查看是否启动成功,查看80端口是否被监听。
# netstat -ntlp
安装成功,进入网页查看:http://192.168.98.135
“Welcome to nginx!”
0 0
- 源代码编译安装nginx
- Nginx+Php-fpm+MySQL+Redis源代码编译安装指南
- Nginx+Php-fpm+MySQL+Redis源代码编译安装指南
- Nginx+Php-fpm+MySQL+Redis源代码编译安装指南
- Nginx+Php-fpm+MySQL+Redis源代码编译安装指南
- 源代码编译安装nginx续——程序的系统化
- centos 源代码安装nginx
- 源代码编译安装Nagios
- linux 源代码 编译 安装
- Apache源代码编译安装
- 编译安装nginx [Ubuntu]
- ubuntu 编译安装nginx
- 手工编译安装nginx
- nginx编译安装
- 编译安装nginx
- CentOS6编译安装Nginx
- 编译安装Nginx
- nginx 编译安装
- android 自定义view之绘制(二)
- 带验证码的页面登录
- windows下安装TexLive2016,黑窗口一闪而过
- 自然语言处理基于java实现(1) 之 中文分词
- JAVA多线程之——CountDownLatch
- 源代码编译安装nginx
- 廖雪峰老师——Python进阶( 类的继承 )
- 数据结构 栈和队列
- adapter适配器与LIST列表与listview的三者关系(自己看法)
- CNN代码系列之数据准备(一)
- Mac开发环境搭建笔记
- 包学会之浅入浅出Vue.js:结业篇
- 会场安排问题
- 初始界面UI