龙芯3a5000下编译nginx源码

1.nginx源码获取

http://hg.nginx.org/nginx

  选择tag,选择稳定版本1.22,点击gz下载gz压缩格式的源码。

2.编译环境需要安装一大堆依赖,不过我测试这台机器因为之前尝试编译过gcc及redis等,pcre,openssl,zlib等都比较全,这里就不再写编译依赖的安装准备过程了。

3.解压缩nginx源码,然后进入解压缩路径,执行./auto/configure --with-http_ssl_module --with-http_mp4_module --with-http_flv_module

4.编译安装

make  && make install

ln -s /usr/local/nginx/sbin/nginx /usr/sbin/nginx

nginx -V 信息如下:

nginx version: nginx/1.22.0
built by gcc 8.3.0 (Loongnix 8.3.0-6.lnd.vec.30) 
built with OpenSSL 1.1.1d  10 Sep 2019
TLS SNI support enabled
configure arguments: --with-http_ssl_module --with-http_mp4_module --with-http_flv_module

5.安装nginx为systemd服务

vi /lib/systemd/system/nginx.service

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

  systemctl daemon-reload

  systemctl enable nginx

  systemctl start nginx

  systemctl status nginx

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

peihexian

你的鼓励是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值