在龙芯mips64平台上编译Nginx

在龙芯mips64平台上编译Nginx

参考内容

部分参考内容见 https://blog.csdn.net/shan_xg/article/details/75356271

Nginx编译环境搭建

下载nginx源代码

下载地址

下载pcre源代码

nginx依赖pcrepcre,下载地址

下载openssl源代码

下载地址

编译Nginx

nginx-1.18.0.tar.gzpcre-7.8.tar.gzopenssl-OpenSSL_1_1_1g.tar.gz示例在龙芯设备上编译nginx

# 在设备上解压源代码
tar xf nginx-1.18.0.tar.gz
tar xf pcre-7.8.tar.gz
tar xf openssl-OpenSSL_1_1_1g.tar.gz

cd nginx-1.18.0

#配置编译环境,/root/pcre-7.8、/root/openssl-OpenSSL_1_1_1g分别是pcre、openssl源代码目录
./configure --prefix=/opt/nginx/nginx-1.18.0 --with-pcre=/root/pcre-7.8 --with-openssl=/root/openssl-OpenSSL_1_1_1g --with-http_ssl_module

修改openssl编译配置,编辑objs/Makefile文件,找到以下内容

/root/openssl-OpenSSL_1_1_1g/.openssl/include/openssl/ssl.h:    objs/Makefile
        cd /root/openssl-OpenSSL_1_1_1g \
        && if [ -f Makefile ]; then $(MAKE) clean; fi \
        && ./config --prefix=/root/openssl-OpenSSL_1_1_1g/.openssl no-shared no-threads  \
        && $(MAKE) \
        && $(MAKE) install_sw LIBDIR=lib

&& ./config --prefix=/root/openssl-OpenSSL_1_1_1g/.openssl no-shared no-threads \行替换为&& ./Configure linux64-mips64 no-asm --prefix=/root/src/openssl-1.1.1g/.openssl no-shared no-threads \,如

/root/src/openssl-1.1.1g/.openssl/include/openssl/ssl.h:        objs/Makefile
        cd /root/src/openssl-1.1.1g \
        && if [ -f Makefile ]; then $(MAKE) clean; fi \
        && ./Configure linux64-mips64 no-asm --prefix=/root/src/openssl-1.1.1g/.openssl no-shared no-threads  \
        && $(MAKE) \
        && $(MAKE) install_sw LIBDIR=lib

编译、安装

make -j4

make install

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值