LINUX系统安装nginx过程记录

2019-03-1808:01:29服务器及运维Comments2,058 views字数 841阅读模式

主要是记录nginx安装过程(仅供参考):文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

下载解压包(以1.59版本为例)

$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.12.0.tar.gz

解压压缩包文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

$ tar xvf nginx-1.12.0.tar.gz

设置配置文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

$ cd nginx-1.12.0

普通安装

$ ./configure --prefix=/usr/local/nginx

安装SSL模块(支持https)

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

安装HTTP2.0模块

查看openssl版本文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

openssl version -a

如果版本小于1.0.2版本则从新下载安装文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz
tar xvf openssl-1.1.0e.tar.gz

安装文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_v2_module --with-openssl=../openssl-1.1.0e

安装依赖文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

$ yum -y install pcre-devel openssl openssl-devel

编译安装nginx文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

$ make
$ make install

安装完毕启动nginx文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

$ /usr/local/nginx/sbin/nginx

常用nginx操作命令文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

//查询nginx主进程号
$ ps -ef | grep nginx

//从容停止Nginx
$kill -QUIT 主进程号

//快速停止Nginx
kill -TERM 主进程号

//强制停止Nginx:
pkill -9 nginx

自此nginx安装完毕!文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html

文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/10086.html
  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/yunwei/10086.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定