nginx1.9源码安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx1.9源码安装相关的知识,希望对你有一定的参考价值。
操作系统环境
[[email protected] ~]# cat /etc/issue CentOS release 6.4 (Final) Kernel \r on an \m [[email protected] ~]# uname -r 2.6.32-358.el6.x86_64 [[email protected] ~]# uname -m x86_64
安装依赖组件
[[email protected] ~]# yum install make gcc gcc-c++ openssl-devel unzip -y
安装pcre
[[email protected] ~]# wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.zip [[email protected] ~]# unzip pcre-8.38.zip [[email protected] ~]# cd pcre-8.38 [[email protected] pcre-8.38]# ./configure --prefix=/usr/local/pcre [[email protected] pcre-8.38]# make && make install
安装nginx
[[email protected] ~]# wget http://nginx.org/download/nginx-1.9.12.tar.gz [[email protected] ~]# tar fxz nginx-1.9.12.tar.gz [[email protected] ~]# cd nginx-1.9.12 [[email protected] nginx-1.9.12]# ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_dav_module --with-pcre=/root/pcre-8.38 [[email protected] nginx-1.9.12]# make && make install [[email protected] nginx-1.9.12]# useradd www -s /sbin/nologin -M
启动nginx
[[email protected] ~]# /usr/local/nginx/sbin/nginx
查看nginx端口
[[email protected] ~]# netstat -ntpl|grep nginx tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 14778/nginx
使用curl访问下
[[email protected] ~]# curl -I http://127.0.0.1 HTTP/1.1 200 OK Server: nginx/1.9.12 Date: Sat, 05 Mar 2016 02:32:23 GMT Content-Type: text/html Content-Length: 612 Last-Modified: Sat, 05 Mar 2016 02:31:33 GMT Connection: keep-alive ETag: "56da4505-264" Accept-Ranges: bytes
至此nginx源码安装完成!!
本文出自 “村里的男孩” 博客,转载请与作者联系!
以上是关于nginx1.9源码安装的主要内容,如果未能解决你的问题,请参考以下文章
CentOS 7中Nginx1.9.5编译安装教程systemctl启动