侧边栏壁纸
  • 累计撰写 4 篇文章
  • 累计创建 1 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

Linux部署Nginx

Simon
2025-12-01 / 0 评论 / 0 点赞 / 0 阅读 / 0 字
温馨提示:
部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

Linux部署nginx

  1. 官网下载
       https://nginx.org/en/download.html 选择stable version下nginx-xxx pgp
  1. 在线安装nginx所需要的依赖包
       yum install -y gcc-c++  zlib zlib-devel openssl openssl-devel pcre pcre-devel
  1. 切换路径,没有进行创建
	   cd /usr/local/nginx/ 
  1. 解压
	   tar -zxvf nginx-1.28.0.tar.gz
  1. 进入nginx目录
       cd /usr/local/nginx/nginx-1.26.1
  1. 执行配置脚本,标准配置(包含常用模块)
	   ./configure --prefix=/usr/local/nginx/nginx \
	            --with-http_ssl_module \
	            --with-http_v2_module \
	            --with-http_realip_module \
	            --with-http_stub_status_module \
	            --with-http_gzip_static_module \
	            --with-pcre \
	            --with-stream \
	            --with-stream_ssl_module
  1. 编译和安装
	   make & make install	
  1. 启动Nginx
	   进入nginx/sbin目录cd /usr/local/nginx/sbin
	   # 启动脚本
		./nginx
	   # 停止
		./nginx -s stop
	   # 重载
		./nginx -s reload
	   # 杀掉nginx
		./nginx -s quit
0

评论区