Nginx 入门(安装教程)

下载

官网 download: nginx: download
这里选择 1.24.0 版本

image.png

上传到服务器

解压到指定目录
tar -zxvf nginx-1.24.0.tar.gz

配置

./configure --prefix=/home/nginx \
--sbin-path=/home/nginx \
--conf-path=/home/nginx/conf/nginx.conf \
--pid-path=/home/nginx/logs/nginx.pid \
--with-http_stub_status_module \
--with-http_ssl_module

参数说明

参数说明
–prefix=/home/nginx配置安装目录为 /home/nginx
–sbin-path=/home/nginx配置执行文件安装目录 /home/nginx (默认名称: nginx)
–conf-path=/home/nginx/nginx.conf配置配置文件目录
–pid-path=/home/nginx/nginx.pid配置 pid 文件目录
–with-http_stub_status_module添加性能统计模块
–with-http_ssl_module添加 ssl 模块

其他路径参数参考: Nginx 安装相关参数

安装

1. 执行 make 
2. 执行 make install

启动, 关闭 …

./nginx  -c  confPath  # 启动nginx , 并指定配置文件
./nginx -s  reload  	 # 重新加载 nginx , 可使修改后的配置文件生效
./nginx  -s  quit 	   # 关闭 nginx

常用命令参考: Nginx 常用命令

下载地址

为了方便安装, 已经配置了自动安装脚本, 下载地址: 阿里云盘-nginx

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小羊Code

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值