在ubuntu 18.x上编译nginx和naxsi

LXG

我正在尝试在ubuntu 18.x上安装naxsi。经过谷歌搜索和尝试后,我发现:

nginx-naxsi不再可用于ubuntu,因此您必须自己编译。很好地了解我已经安装了哪个模块和设置

apt install nginx-extras

然后是nginx -V

我发现了这一点:

nginx version: nginx/1.14.0 (Ubuntu)
built with OpenSSL 1.1.0g  2 Nov 2017
TLS SNI support enabled
configure arguments: 

--with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-mcUg8N/nginx-1.14.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' \
--with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' \
--prefix=/usr/share/nginx \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--lock-path=/var/lock/nginx.lock \
--pid-path=/run/nginx.pid \
--modules-path=/usr/lib/nginx/modules \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ 
--with-debug \
--with-pcre-jit \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_auth_request_module \
--with-http_v2_module \
--with-http_dav_module \
--with-http_slice_module \ 
--with-threads \
--with-http_addition_module \
--with-http_flv_module \
--with-http_geoip_module=dynamic \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_image_filter_module=dynamic \
--with-http_mp4_module \
--with-http_perl_module=dynamic \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_sub_module \
--with-http_xslt_module=dynamic \
--with-mail=dynamic \
--with-mail_ssl_module \
--with-stream=dynamic \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-headers-more-filter \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-auth-pam \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-cache-purge \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-dav-ext \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-ndk \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-echo \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-fancyindex \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/nchan \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-lua \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/rtmp \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-uploadprogress \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-upstream-fair \
--add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-subs-filter 

所以我组装成这批

#!/usr/bin/env bash

apt-get install -y libpcre3 libpcre3-dev libssl-dev unzip make \
  libgoogle-perftools-dev google-perftools jq gcc
mkdir /tmp/ngxbuild
cd /tmp/ngxbuild
latestNginx=$(curl -s http://hg.nginx.org/nginx/tags |
  grep "^ *release-" | head -1 | cut -c 9-)
latestNaxsi=$(curl -s https://api.github.com/repos/nbs-system/naxsi/releases |
  jq -r .[].tag_name | grep -v rc | head -1)
wget -q http://nginx.org/download/nginx-${latestNginx}.tar.gz
wget -q https://github.com/nbs-system/naxsi/archive/${latestNaxsi}.tar.gz
tar xzf nginx-${latestNginx}.tar.gz
tar xzf ${latestNaxsi}.tar.gz
cd nginx*


./configure --conf-path=/etc/nginx/nginx.conf \
    --add-module=../naxsi-${latestNaxsi}/naxsi_src/ \

    --with-cc-opt='-g -O2 -fdebug-prefix-map=/b
    (... see up for complete list of parameters)
    ...
    --add-dynamic-module=/build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-subs-filter 

make -j 4
make install    

但是会出现错误...

--with-debug : unknow command
--with-pcre-jit : unknow command

...
--with-http_ssl_module : unknow command 

and module like /build/nginx-mcUg8N/nginx-1.14.0/debian/modules/http-subs-filter is from library or I've to download

所以我只想在ubuntu 18.x上安装nginx-naxsi,任何解决方案?

生锈的沙克福德

您在编译时的选择被解释为命令,这就是为什么这样说的原因command not found您很可能没有在转义符,因此外壳程序认为下一行的选项是要运行的命令。

您的示例中的此换行符未正确转义:

./configure --conf-path=/etc/nginx/nginx.conf \
--add-module=../naxsi-${latestNaxsi}/naxsi_src/ \

--with-cc-opt='-g -O2 -fdebug-prefix-map=/b

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

ubuntu 18的openprinting密钥

来自分类Dev

戴尔XPS 18:触摸屏可在OpenSuse上使用!在Ubuntu中如何做?

来自分类Dev

在Ubuntu 18.X上运行add-apt-repository后,禁用自动执行apt更新。

来自分类Dev

Netbeans的在Ubuntu 18不开放

来自分类Dev

Chromium v79图形渲染在Ubuntu 18上意外冻结

来自分类Dev

Kerberos服务以错误启动:无法在Ubuntu 18上打开DB2数据库

来自分类Dev

ubuntu 18的openprinting密钥

来自分类Dev

戴尔XPS 18:触摸屏可在OpenSuse上使用!在Ubuntu中如何做?

来自分类Dev

在Ubuntu 18.X上运行add-apt-repository后,禁用自动执行apt更新。

来自分类Dev

Ubuntu 18,无法安装xelatex

来自分类Dev

(X)Ubuntu无法启动,反复打印“ ^ [[18〜”及更多内容

来自分类Dev

在Ubuntu 16.04上安装libmysqlclient18

来自分类Dev

如何使用Wine 1.8将Adobe Reader 11.x安装到Mint 18 x64(Ubuntu 16.04)上

来自分类Dev

Razer Nari耳机无法在Ubuntu 18上无线工作

来自分类Dev

在ubuntu 18上正确配置Netplan

来自分类Dev

修复Google Cloud Ubuntu 18实例上的sudo访问

来自分类Dev

减少WSL安装的大小(在Windows 10上为Ubuntu 18)

来自分类Dev

Windows 7和Ubuntu 18?

来自分类Dev

Ubuntu 18 NFS更改

来自分类Dev

在Ubuntu 18上进行Xrdp的安装步骤,以实现从Mac OS X Sierra到Ubuntu 18的连接

来自分类Dev

无法在 Ubuntu 18 上安装 Chrome

来自分类Dev

如何在 Ubuntu 18.x 中的 Coffee Lake CPU 上启用集成 GPU(带 QSV)

来自分类Dev

Kerberos 和 Ubuntu 18

来自分类Dev

如何使用单独的分区加密和 UEFI/安全启动运行多个 Ubuntu 18.x?

来自分类Dev

在 Ubuntu 18 上安装后如何修复 RStudio 的 SSL 错误?

来自分类Dev

NUC6CAYH 上的 Ubuntu Core 18

来自分类Dev

我正在尝试在我的 ubuntu 18 上安装 Internet Explorer

来自分类Dev

iMac 上的 Ubuntu (2019 - 18,3) 在挂起时崩溃

来自分类Dev

在 Ubuntu 18 上使用 Imagemagick 转换 PDF 时出错

Related 相关文章

  1. 1

    ubuntu 18的openprinting密钥

  2. 2

    戴尔XPS 18:触摸屏可在OpenSuse上使用!在Ubuntu中如何做?

  3. 3

    在Ubuntu 18.X上运行add-apt-repository后,禁用自动执行apt更新。

  4. 4

    Netbeans的在Ubuntu 18不开放

  5. 5

    Chromium v79图形渲染在Ubuntu 18上意外冻结

  6. 6

    Kerberos服务以错误启动:无法在Ubuntu 18上打开DB2数据库

  7. 7

    ubuntu 18的openprinting密钥

  8. 8

    戴尔XPS 18:触摸屏可在OpenSuse上使用!在Ubuntu中如何做?

  9. 9

    在Ubuntu 18.X上运行add-apt-repository后,禁用自动执行apt更新。

  10. 10

    Ubuntu 18,无法安装xelatex

  11. 11

    (X)Ubuntu无法启动,反复打印“ ^ [[18〜”及更多内容

  12. 12

    在Ubuntu 16.04上安装libmysqlclient18

  13. 13

    如何使用Wine 1.8将Adobe Reader 11.x安装到Mint 18 x64(Ubuntu 16.04)上

  14. 14

    Razer Nari耳机无法在Ubuntu 18上无线工作

  15. 15

    在ubuntu 18上正确配置Netplan

  16. 16

    修复Google Cloud Ubuntu 18实例上的sudo访问

  17. 17

    减少WSL安装的大小(在Windows 10上为Ubuntu 18)

  18. 18

    Windows 7和Ubuntu 18?

  19. 19

    Ubuntu 18 NFS更改

  20. 20

    在Ubuntu 18上进行Xrdp的安装步骤,以实现从Mac OS X Sierra到Ubuntu 18的连接

  21. 21

    无法在 Ubuntu 18 上安装 Chrome

  22. 22

    如何在 Ubuntu 18.x 中的 Coffee Lake CPU 上启用集成 GPU(带 QSV)

  23. 23

    Kerberos 和 Ubuntu 18

  24. 24

    如何使用单独的分区加密和 UEFI/安全启动运行多个 Ubuntu 18.x?

  25. 25

    在 Ubuntu 18 上安装后如何修复 RStudio 的 SSL 错误?

  26. 26

    NUC6CAYH 上的 Ubuntu Core 18

  27. 27

    我正在尝试在我的 ubuntu 18 上安装 Internet Explorer

  28. 28

    iMac 上的 Ubuntu (2019 - 18,3) 在挂起时崩溃

  29. 29

    在 Ubuntu 18 上使用 Imagemagick 转换 PDF 时出错

热门标签

归档