本篇文章更新時間:2019/02/16
如有資訊過時或語誤之處,歡迎使用 Contact 功能通知。
一介資男的 LINE 社群開站囉!歡迎入群聊聊~
如果本站內容對你有幫助,歡迎使用 BFX Pay 加密貨幣 或 新台幣 贊助支持。
這套如果是用在 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-