linux下离线安装nginx

linux版本:CentOS Linux release 7.6.1810 (Core)
1.查询系统版本
lsb_release -a
2.在安装nginx前首先要确认系统中安装了gcc、pcre-devel、zlib-devel、openssl-devel。
如果没有手动下载依赖
3.下载最新版 nginx-1.9.9.tar.gz
nginx下载地址:https://nginx.org/download/

4.解压安装包
tar -zxvf nginx-1.9.9.tar.gz

5.进入nginx目录
cd nginx-1.9.9
6.执行脚本配置脚本 或者不执行 走默认配置
./configure --prefix=/usr/local/nginx

7.到nginx下的 找到/objs/Makefile的文件
去掉CFLAGS中里的-Werror

8.执行make、make install命令
make
make install
9.测试是否安装成功
cd /user/local/nginx/
./sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

10.启动nginx
cd /usr/local/nginx/sbin
./nginx
11.测试是否启动
[root@iZuf6gp1t778o5lk1u38n5Z sbin]# curl 127.0.0.1:80

Welcome to nginx!

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值