linux安装nginx

  1. 下载nginx https://nginx.org/en/download.html
    在这里插入图片描述

  2. 创建目录并安装所需依赖

mkdir /usr/local/nginx -p
# 安装所需依赖
yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel pcre-devel
  1. 解压 文件拖入目录 /usr/local/nginx
cd  /usr/local/nginx
tar -zxvf nginx-1.26.1.tar.gz	
  1. 配置- - - -编译- - - -安装
cd nginx-1.26.1
#配置
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

编译,安装

make && make install
  1. 查看版本号
#进入可执行目录sbin
cd /usr/local/nginx/sbin/
#查看nginx版本信息
./nginx -v
  1. 启动

cd /usr/local/nginx/sbin/
./nginx
  1. 浏览器访问ip:80端口 出现该页面即可 (注意防火墙需放行80端口)
    在这里插入图片描述

  2. nginx 基本命令

#启动
./nginx
#停止
./nginx -s stop  
# 检查nginx.conf配置是否正确
./nginx -t  
#重启 
./nginx -s reload  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值