38 lines
1.2 KiB
Markdown
38 lines
1.2 KiB
Markdown
Installation de divers modules dynamiques avec Nginx
|
|
====================================================
|
|
``` shell
|
|
# Répertoire d'installation
|
|
cd ~/ngx-modules-src/
|
|
|
|
# Copie de la version de Nginx - VERSION
|
|
command="nginx -v"
|
|
nginxv=$( ${command} 2>&1 )
|
|
VERSION=$(echo $nginxv | grep -o '[0-9.]*$')
|
|
|
|
# récupération des sources de Nginx et décompression
|
|
wget http://nginx.org/download/nginx-${VERSION}.tar.gz
|
|
tar -xzvf nginx-${VERSION}.tar.gz
|
|
|
|
# Récupération des modules
|
|
git clone --depth 1 -b v3/master --single-branch https://github.com/SpiderLabs/ModSecurity
|
|
git clone --depth 1 https://github.com/SpiderLabs/ModSecurity-nginx.git
|
|
git clone https://github.com/openresty/headers-more-nginx-module.git
|
|
git clone https://github.com/masterzen/nginx-upload-progress-module.git
|
|
|
|
# Installation de ModSecurity (Library) -> /usr/local/modsecurity/
|
|
cd ~/ngx-modules-src/ModSecurity
|
|
git submodule init
|
|
git submodule update
|
|
./build.sh
|
|
./configure
|
|
make
|
|
sudo make install
|
|
|
|
cd ~/ngx-modules-src/nginx-${VERSION}/
|
|
|
|
# Installation de ModSecurity & Header-More (Modules Nginx)
|
|
./configure --with-compat --add-dynamic-module=../ModSecurity-nginx --add-dynamic-module=../ModSecurity-nginx
|
|
make modules
|
|
sudo cp objs/*.so /etc/nginx/modules-available/
|
|
```
|