Nginx使用命令安装过程及说明
更新时间:2025年07月26日 11:47:57 作者:lytcreate.
本文概述安装Nginx流程:解压安装包,安装依赖,配置路径为/usr/local/nginx/conf/nginx.conf,设置软连接,启动服务并检查版本
1.获取安装包
wget https://nginx.org/download/nginx-1.20.2.tar.gz
2.解压安装包
tar -zxvf nginx-1.20.2.tar.gz
3.安装依赖
yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
4.安装nginx
cd nginx-1.20.2/ ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module make make install
5.检查nginx版本
cd /usr/local/nginx/sbin/ ./nginx -v
6.增加软连接
cd /usr/bin/ ln -s /usr/local/nginx/sbin/nginx nginx
7.启动机相关命令
- 启动: nginx
- 停止:nginx -s stop
- 重载配置: nginx -s reload
- 配置文件位置:/usr/local/nginx/conf/nginx.conf
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
nginx部署前端项目location时root和alias配置指南
nginx指定文件路径有两种方式root和alias,下面这篇文章主要给大家介绍了关于nginx部署前端项目location时root和alias配置的相关资料,文中通过代码介绍的非常详细,需要的朋友可以参考下2024-01-01
Nginx基础配置(main、events、http、server、location)
本文主要介绍了Nginx基础配置(main、events、http、server、location),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2023-06-06
Nginx HttpMemcModule和直接访问memcached效率对比测试
2013-09-09
详解proxy_pass根据path路径转发时的"/"问题记录
这篇文章主要介绍了详解proxy_pass根据path路径转发时的"/"问题记录,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2018-09-09


最新评论