• 龙芯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 信息如下:

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

    5.安装nginx为systemd服务

    vi /lib/systemd/system/nginx.service

    1. [Unit]
    2. Description=The NGINX HTTP and reverse proxy server
    3. After=syslog.target network-online.target remote-fs.target nss-lookup.target
    4. Wants=network-online.target
    5. [Service]
    6. Type=forking
    7. PIDFile=/usr/local/nginx/logs/nginx.pid
    8. ExecStartPre=/usr/sbin/nginx -t
    9. ExecStart=/usr/sbin/nginx
    10. ExecReload=/usr/sbin/nginx -s reload
    11. ExecStop=/bin/kill -s QUIT $MAINPID
    12. PrivateTmp=true
    13. [Install]
    14. WantedBy=multi-user.target

      systemctl daemon-reload

      systemctl enable nginx

      systemctl start nginx

      systemctl status nginx

      

  • 相关阅读:
    入门力扣自学笔记139 C++ (题目编号998)
    Git分支管理
    0928转置卷积
    选择HAL库还是标准库
    TinyOs操作系统---第1章 初识RTOS及使用
    Linux常用的指令(总结)
    LeetCode 768. 最多能完成排序的块 II
    RocketMQ源码阅读(六)CommitLog
    Ubuntu Zookeeper开机自启动服务
    如何从算法方面提升论文档次
  • 原文地址:https://blog.csdn.net/peihexian/article/details/125618139