Mise à jour de 'Nginx/Modules.md'
This commit is contained in:
@@ -1,14 +1,29 @@
|
|||||||
Installation de divers modules dynamiques avec Nginx
|
Installation de divers modules dynamiques avec Nginx
|
||||||
====================================================
|
====================================================
|
||||||
``` shell
|
|
||||||
# Répertoire d'installation
|
|
||||||
cd ~/ngx-modules-src/
|
|
||||||
|
|
||||||
# Copie de la version de Nginx - VERSION
|
Préparation
|
||||||
|
-----------
|
||||||
|
|
||||||
|
On commence par créer un répertoire qui recevra les sources nécessaires
|
||||||
|
``` shell
|
||||||
|
# Création d'un répertoire pour compiler les modules
|
||||||
|
mkdir ngx-modules-src
|
||||||
|
cd ngx-modules-src
|
||||||
|
```
|
||||||
|
|
||||||
|
On récupère la version courante du nginx installé
|
||||||
|
```shell
|
||||||
|
# Détermination de la version courante de Nginx
|
||||||
command="nginx -v"
|
command="nginx -v"
|
||||||
nginxv=$( ${command} 2>&1 )
|
nginxv=$( ${command} 2>&1 )
|
||||||
VERSION=$(echo $nginxv | grep -o '[0-9.]*$')
|
VERSION=$(echo $nginxv | grep -o '[0-9.]*$')
|
||||||
|
```
|
||||||
|
|
||||||
|
Sources nécessaires
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
On télécharge les sources nécessaires
|
||||||
|
```shell
|
||||||
# récupération des sources de Nginx et décompression
|
# récupération des sources de Nginx et décompression
|
||||||
wget http://nginx.org/download/nginx-${VERSION}.tar.gz
|
wget http://nginx.org/download/nginx-${VERSION}.tar.gz
|
||||||
tar -xzvf nginx-${VERSION}.tar.gz
|
tar -xzvf nginx-${VERSION}.tar.gz
|
||||||
@@ -17,8 +32,11 @@ tar -xzvf nginx-${VERSION}.tar.gz
|
|||||||
git clone --depth 1 -b v3/master --single-branch https://github.com/SpiderLabs/ModSecurity
|
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 --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/openresty/headers-more-nginx-module.git
|
||||||
git clone https://github.com/masterzen/nginx-upload-progress-module.git
|
```
|
||||||
|
|
||||||
|
ModSecurity Lib
|
||||||
|
---------------
|
||||||
|
```shell
|
||||||
# Installation de ModSecurity (Library) -> /usr/local/modsecurity/
|
# Installation de ModSecurity (Library) -> /usr/local/modsecurity/
|
||||||
cd ~/ngx-modules-src/ModSecurity
|
cd ~/ngx-modules-src/ModSecurity
|
||||||
git submodule init
|
git submodule init
|
||||||
@@ -27,11 +45,21 @@ git submodule update
|
|||||||
./configure
|
./configure
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
Compilation des modules dynamiques
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
```shell
|
||||||
cd ~/ngx-modules-src/nginx-${VERSION}/
|
cd ~/ngx-modules-src/nginx-${VERSION}/
|
||||||
|
|
||||||
# Installation de ModSecurity & Header-More (Modules Nginx)
|
# Compilation de ModSecurity & Header-More
|
||||||
./configure --with-compat --add-dynamic-module=../ModSecurity-nginx --add-dynamic-module=../ModSecurity-nginx
|
./configure --with-compat --add-dynamic-module=../ModSecurity-nginx --add-dynamic-module=../ModSecurity-nginx
|
||||||
make modules
|
make modules
|
||||||
sudo cp objs/*.so /etc/nginx/modules-available/
|
```
|
||||||
|
|
||||||
|
Installation des modules
|
||||||
|
------------------------
|
||||||
|
```shell
|
||||||
|
sudo cp objs/*.so /etc/nginx/modules/
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user