NGINX 之 安装方法 一

NGINX 之 安装方法 一

1、下载NGINX编译包

wget http://nginx.org/download/nginx-1.6.3.tar.gz

2、创建nginx软件所需的用户与组

[root@localhost software]# useradd www -s /sbin/nologin -M       #不能登陆,不带家目录
[root@localhost software]# groupadd www                                     #创建组

3、安装nginx所需要的依赖包

[root@localhost software]# yum -y install pcre pcre-devel gcc-c++ zlib-devel zlib open-ssl openssl-devel

4、开始安装NGINX

[root@localhost software]# tar -zxvf nginx-1.6.3.tar.gz
[root@localhost software]# cd nginx-1.6.3
[root@localhost nginx-1.6.3]# ./configure --user=www --group=www --with-http_ssl_module --prefix=/app/nginx-1.6.3
[root@localhost nginx-1.6.3]# make && make install
[root@localhost nginx-1.6.3]# ll /app/nginx-1.6.3/                 #安装成功
总用量 16
drwxr-xr-x 2 root root 4096 7月  16 11:32 conf
drwxr-xr-x 2 root root 4096 7月  16 11:32 html
drwxr-xr-x 2 root root 4096 7月  16 11:32 logs
drwxr-xr-x 2 root root 4096 7月  16 11:32 sbin

5、查看nginx当前安装了那些模块

[root@localhost nginx-1.6.3]# ./sbin/nginx -V
nginx version: nginx/1.6.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) 
TLS SNI support enabled
configure arguments: --user=www --group=www --with-http_ssl_module --prefix=/app/nginx-1.6.3

6、给当前安装的NGINX添加一个新模块功能,如:状态模块--with-http_stub_status_module

猜你喜欢

转载自blog.51cto.com/12965094/2144041