JAVA和Nginx 教程大全

网站首页 > 精选教程 正文

安装Nginx的几种方式

wys521 2024-09-06 04:28:17 精选教程 32 ℃ 0 评论


yum安装


手动下载安装包安装

下载地址:http://nginx.org/en/download.html

下载最新稳定版本Stable version,目前最新版本为:1.18.0



安装前的检查:检查并安装所需的依赖软件

yum install gcc-c++

yum install -y pcre pcre-devel

yum install -y zlib zlib-devel

yum install -y openssl openssl-devel


解压编译

[root@leo ~]# tar -zxvf nginx-1.18.0.tar.gz

[root@leo ~]# cd nginx-1.18.0

[root@leo ~]# ./configure

[root@leo ~]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module --with-http_realip_module

常用命令:

重启: [root@leo ~]# ./nginx -s reload

(最好是停止后启动、不要直接用重启)

启动: [root@leo ~]# ./nginx

停止: [root@leo ~]# pkill -9 nginx

关闭进程: [root@leo ~]# nginx -s stop

平滑关闭: [root@leo ~]# nginx -s quit

检测: [root@leo ~]# nginx -t

版本: [root@leo ~]# nginx -V (注意大写)

开机自启动: [root@leo ~]# systemctl enable nginx.service


Tags:

猜你喜欢

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表