linux-Ngix下载-安装

工具包下载

wget http://www.openssl.org/source/openssl-fips-2.0.2.tar.gz
wget http://sourceforge.net/projects/pcre/files/pcre/8.35/pcre-8.35.tar.gz
wget http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz
wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz
wget http://nginx.org/download/nginx-1.7.2.tar.gz

解压及配置命令

1.安装openssl-fips-2.0.2.tar.gz

[root@localhost mrms]# tar -zxvf openssl-fips-2.0.2.tar.gz 

[root@localhost mrms]# cd openssl-fips-2.0.2

[root@localhost openssl-fips-2.0.2]# ./config 

[root@localhost openssl-fips-2.0.2]# make

[root@localhost openssl-fips-2.0.2]# make install

2.安装zlib-1.2.8.tar.gz

[root@localhost mrms]# tar -zxvf zlib-1.2.8.tar.gz

[root@localhost mrms]# cd zlib-1.2.8

[root@localhost zlib-1.2.7]# ./configure 

[root@localhost zlib-1.2.7]# make

[root@localhost zlib-1.2.7]# make install

3.安装pcre-8.35.tar.gz

[root@localhost mrms]# tar -zxvf pcre-8.35.tar.gz

[root@localhost mrms]# cd pcre-8.35

[root@localhost pcre-8.21]# ./configure 

[root@localhost pcre-8.21]# make

[root@localhost pcre-8.21]# make install

4.安装 nginx-1.7.2.tar.gz

[root@localhost mrms]# tar -zxvf nginx-1.7.2.tar.gz 

[root@localhost mrms]# cd nginx-1.7.2

[root@localhost nginx-1.2.6]# ./configure --with-pcre=../pcre-8.35 --with-zlib=../zlib-1.2.8 --with-openssl=../openssl-fips-2.0.2

[root@localhost nginx-1.2.6]# make

[root@localhost nginx-1.2.6]# make install

检查是否安装成功

[root@localhost nginx-1.2.6]# cd /usr/local/nginx/sbin
[root@localhost sbin]# ./nginx -t 

出现如下所示提示,表示安装成功
linux-Ngix下载-安装_第1张图片

启动nginx

[root@localhost sbin]# ./nginx 

查看端口

[root@localhost sbin]# netstat -ntlp 

结果如下
linux-Ngix下载-安装_第2张图片
nginx常用命令
查看nginx 进程

ps -ef|grep nginx

启动nginx

[root@iZ2ze9wsbomxf6nnmj03e0Z sbin]# ./nginx

强行杀死nginx

[root@iZ2ze9wsbomxf6nnmj03e0Z sbin]# pkill -9 nginx

停止nginx

[root@iZ2ze9wsbomxf6nnmj03e0Z sbin]# ./nginx -s stop

查看nginx版本

[root@iZ2ze9wsbomxf6nnmj03e0Z sbin]# ./nginx -v

检查配置文件是否正确

[root@iZ2ze9wsbomxf6nnmj03e0Z sbin]# ./nginx -t

你可能感兴趣的:(ngix,缓存,linux-ngix)