银河麒麟服务器版V10-编译安装nginx

银河麒麟服务器版V10-编译安装nginx

1、海光芯片(x86架构)、银河麒麟v10sp3

2、下载所需版本的nginx源码
https://nginx.org/en/download.html

3、通过ftp工具上传到服务器中

4、解压
tar -zxvf nginx-1.24.0.tar.gz

5、执行configure配置编译环境,可以保持默认,也可以根据需要添加具体的参数
cd nginx-1.24.0
./configure

默认配置如下

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

6、编译
make

7、安装
make install

8、编写控制脚本
cd /usr/lib/systemd/system
vim nginx.service

[Unit]
Description=nginx service
After=network.target 
   
[Service] 
Type=forking 
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true 
   
[Install] 
WantedBy=multi-user.target

9、通过systemctl命令控制nginx

#查看nginx状态
systemctl status nginx.service
#启动nginx 
systemctl start nginx.service
#停止nginx
systemctl stop nginx.service
#重启nginx
systemctl restart nginx.service
#开启开机启动nginx 
systemctl enable nginx.service 
#关闭开机启动nginx 
systemctl disable nginx.service 

小尾巴~~
只要有积累,就会有进步

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值