linux Nginx-1.10.2 安装部署教程

时间:2019-10-29
本文章向大家介绍linux Nginx-1.10.2 安装部署教程,主要包括linux Nginx-1.10.2 安装部署教程使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
一、下载Nginx以及依赖组件
[root@localhost src]# wget http://nginx.org/download/nginx-1.10.2.tar.gz [root@localhost src]# wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz [root@localhost src]# wget http://zlib.net/zlib-1.2.11.tar.gz [root@localhost src]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz

安装C++编译环境
[root@localhost src]# yum install gcc-c++

 安装Nginx及相关组件

 openssl安装

[root@localhost src]# tar zxvf openssl-fips-2.0.10.tar.gz
省略安装内容... [root@localhost src]# cd openssl-fips-2.0.10 [root@localhost openssl-fips-2.0.10]# ./config && make && make install
省略安装内容...

 pcre安装

[root@localhost src]# tar zxvf pcre-8.40.tar.gz
省略安装内容... [root@localhost src]# cd pcre-8.40 [root@localhost pcre-8.40]# ./configure && make && make install
省略安装内容...

 zlib安装

[root@localhost src]# tar zxvf zlib-1.2.11.tar.gz
省略安装内容... [root@localhost src]# cd zlib-1.2.11 [root@localhost zlib-1.2.11]# ./configure && make && make install
省略安装内容...

 nginx安装

[root@localhost src]# tar zxvf nginx-1.10.2.tar.gz
省略安装内容... [root@localhost src]# cd nginx-1.10.2 [root@localhost nginx-1.10.2]# ./configure && make && make install
省略安装内容...

3、启动Nginx

nginx的基本操作

启动
[root@localhost ~]# /usr/local/nginx/sbin/nginx
停止/重启
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s stop(quit、reload)
命令帮助
[root@localhost ~]# /usr/local/nginx/sbin/nginx -h
验证配置文件
[root@localhost ~]# /usr/local/nginx/sbin/nginx -t
配置文件
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf


原文地址:https://www.cnblogs.com/Nanaya/p/11759426.html