【问题标题】:How to compile modsecurity on Ubuntu?如何在 Ubuntu 上编译 modsecurity?
【发布时间】:2015-11-16 15:56:49
【问题描述】:

按照modsecurity dev guide 中(构建自定义ModSecurity 模块)部分中的说明使用apxs -ca mod_tfn_reverse.c 命令编译(mod_tfn_reverse.c)后,我仍然发现“致命错误”,例如unable to find the file modsecurity.h在 C 文档的标题中提到。

这里是github上的源链接modsec

我做的说明:

  1. 我使用的是 Ubuntu 14.4 64 位(带有更新的全新安装)。
  2. 我安装了“apache dev”包,在终端上运行“APXS”命令。
  3. 从 github 下载“modsecurity”zip 文件。
  4. 我提取了 zip 文件,然后找到了 mod_tfn_reverse.c 所在的位置。

它的路径:ModSecurity/ext/mod_tfn_reverse.c

  1. 然后我把目录改成目标文件CD modsecurity/ext 当我将文件夹放在“home”中时。
  2. 最后,我执行了命令apxs -ca mod_tfn_reverse.c

这些是我做的指令,apxs 工作,但是编译失败,因为没有找到头文件中声明的“modsecurity.h”,我搜索了这个文件,我在另一个目录中找到了它(ModSecurity/apache2/modsecurity.h) .

因此,困难在于,我如何才能成功编译该特定文件并完成模块并准备好在 apache2 服务器中使用。 我还对以下所需的其他档案、标头和开发工具感到困惑:

  1. 编译自定义 apache 模块。
  2. 编译mod_tfn_reverse.c,就我而言,知道这只是为modsecurity创建自定义模块的起点。

【问题讨论】:

  • 我建议您在另一个 StackExchange 社区 askubuntu.com 上提问,在那里您将获得更专业的帮助。

标签: c apache ubuntu module


【解决方案1】:

包含在自述文件中:

  apxs -I<MODSECURITY_SOURCE_CODE> -I/usr/include/libxml2 \
       -ca mod_tfn_reverse.c

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-05
    • 2020-09-10
    • 2013-02-13
    • 1970-01-01
    • 2020-09-17
    • 2018-10-14
    • 1970-01-01
    相关资源
    最近更新 更多