[Nginx] ModSecurity 網站伺服器安全性模組編譯與安裝方法

本篇文章更新時間:2019/02/16
如有資訊過時或語誤之處,歡迎使用 Contact 功能通知或向一介資男的 LINE 社群反應。
如果本站內容對你有幫助,歡迎贊助支持


這套如果是用在 Apache 上可以很無痛,但要在 Nginx 架構下使用就有一點多毛了。

測試環境: Ubuntu 16.04 / nginx 1.10.3


apt update apt upgrade apt install gcc make libtool automake bison autoconf libxml2-dev libcurl4-openssl-dev pkgconf apache2-dev libpcre3-dev git clone https://github.com/SpiderLabs/ModSecurity.git cd ModSecurity ./autogen.sh ./configure --enable-standalone-module make

到這邊沒意外應該就 build 好 Nginx 模組檔案了。

下一步是重新編譯 Nginx ,把這模組給掛上去


cd /path/to/nginx/src/ ./configure --add-module=/path/to/ModSecurity/nginx/modsecurity make make install

搞定! 不過其實這中間有個雷,就是 error: couldn't find APXS 的問題,根據使用者 feedback 的 issue,他還沒有跟 Apache 解耦合,還會要用到 Apache 的資源。還需要裝 apache2-dev 這套(上述已加上)。

#技術相關 #Nginx #Apache #ModSecurity #Ubuntu #編譯 #安裝 #APXS

- Powered by Mxp.TW -FB2WP-


Share:

作者: Chun

WordPress 社群貢獻者、開源社群推廣者。專注於 WordPress 外掛開發、網站效能最佳化、伺服器管理,以及 iDempiere 開源 ERP 導入與客製開發。曾參與 WordCamp Taipei 等社群活動,GitHub Arctic Code Vault Contributor。提供資訊顧問、WordPress 開發教學、主機最佳化與企業 ERP 整合服務。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *


文章
Filter
Apply Filters
Mastodon