liunx 中Nginx 安装

1.参考

https://blog.youkuaiyun.com/fhf2424045058/article/details/106499283

2.Nginx下载

1)Nginx
http://nginx.org/en/download.html (版本:nginx-1.16.1 tar.gz)
2)Pcre
https://sourceforge.net/projects/pcre/files/pcre/8.41/(版本:pcre-8.41.tar.gz)
3)Zlib
http://www.zlib.net/(版本:zlib-1.2.11.tar.gz)
4)Oppenssl
https://www.openssl.org/source/(版本:openssl-1.1.1g.tar.gz)

3.Nginx安装

1)解压
1.tar -xzvf nginx-1.16.1 tar.gz
2.tar -xzvf pcre-8.41.tar.gz
3.tar -xzvf zlib-1.2.11.tar.gz
4.tar -xzvf openssl-1.1.1g.tar.gz
2)安装
1.进入nginx目录:cd nginx-1.16.1
2.创建安装目录:mkdir installs
3.编译nginx
./configure --prefix=/usr/local/nginx/
./configure --prefix=/usr/local/nginx/ --with-stream  //--with-stream 转发服务
./configure --prefix=/home/ZDHQX/Nginx/nginx-1.16.1/installs –-with-pcre=../pcre-8.41 --with-openssl=../openssl-1.1.1g --with-zlib=../zlib-1.2.11
4.安装nginx:make && make install

5.修改配置文件:

1)cd conf
2)vi nginx.conf
3)i编辑、esc退出、:wq保存
3)查看版本
1.cd installs/sbin
2.查看版本:./nginx -V
3.检测:./nginx -t
4)启动与停止
1.启动:./nginx
2.停止:./nginx -s stop
3.重启:./nginx -s reload
4.指定conf文件检测与启动
1)检测
./nginx -t -c path/conf/nginx.conf
2)启动
./nginx -c path/conf/nginx.conf
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值