Nginx-1.12.1安装笔记

Nginx-1.12.1安装笔记

1、所需模块

2、安装环境介绍

平台 IP NGINX版本 安装模块
CentOS 6.7 64Bit 192.168.2.245 NGINX-1.12.1 naxsi\nginx-limit-upstream\nginx-upstream-jvm-route

3、Nginx安装步骤

3.1、安装系统工具

1
[root@localhost ~]# yum install vim telnet wget nethogs htop glances dstat traceroute lrzsz goaccess ntpdate dos2unix openssl-devel tcpdump lrzsz fio -y

3.2、安装编译开发组件

1
[root@localhost ~]# yum groupinstall "Development Tools" -y

3.3、安装EPEL源

1
[root@localhost ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/e/epel-release-6-8.noarch.rpm

3.4、安装NGINX各项依赖组件

1
[root@localhost ~]# yum install pcre-devel zlib-devel libjpeg-devel libpng-devel freetype-devel   	openssl-devel curl curl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel libmcrypt libmcrypt-devel openldap openldap-devel openssh-client -y

3.5、解压nginx及各项模块

1
2
3
4
5
6
7
8
[root@localhost soft]# unzip nginx-limit-upstream-master.zip
###nginx负载限制模块
[root@localhost soft]# unzip naxsi-master.zip
###nginx软防火墙
[root@localhost soft]# tar xzvf nginx-1.12.1.tar.gz
###nginx主程序
[root@localhost soft]# unzip nginx-upstream-jvm-route-master.zip
###cookie粘贴模块

3.1、安装nginx及各项模块

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost soft]# cd nginx-1.12.1
[root@localhost nginx-1.12.1]# patch -p0 < /soft/nginx-limit-upstream-master/nginx-1.10.1.patch

[root@localhost nginx-1.12.1]# patch -p0 < /soft/nginx-upstream-jvm-route-master/jvm_route.patch

[root@localhost nginx-1.12.1]# useradd -s /sbin/nologin -M www

[root@localhost nginx-1.12.1]#./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --without-mail_pop3_module --without-mail_smtp_module --without-mail_imap_module
--add-module=/soft/naxsi-master/naxsi_src --add-module=/soft/nginx-limit-upstream-master --add-module=/soft/nginx-upstream-jvm-route-master && make && make install

[root@localhost nginx-1.12.1]# chmod a+x /etc/init.d/nginx
[root@localhost nginx-1.12.1]# chkconfig --add nginx
[root@localhost nginx-1.12.1]# chkconfig nginx on

3.6、测试与验证

1
2
3
4
5
6
7
8
[root@localhost sbin]# pwd
/usr/local/nginx/sbin
[root@localhost sbin]# ./nginx -V
nginx version:
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --without-mail_pop3_module --without-mail_smtp_module --without-mail_imap_module --with-http_ssl_module --add-module=/soft/naxsi-master/naxsi_src --add-module=/soft/nginx-limit-upstream-master --add-module=/soft/nginx-upstream-jvm-route-master
-------------本文结束感谢您的阅读-------------
LiGuanCheng wechat
如有问题,请与我微信交流或通过右下角“daovoice”与我联系~。
请我喝一杯咖啡~