Compare commits
17 Commits
86d64033e4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 269e4194c9 | |||
| 09d26f26c5 | |||
| 2031b5cbe6 | |||
| 191b395ca0 | |||
| 64af95d1de | |||
| 59fef71435 | |||
| 75d1b69fc5 | |||
| d6efb2f52e | |||
| c8e4d390a6 | |||
| 1df74e1682 | |||
| f9d1044278 | |||
| 5b600b5a3d | |||
| 030a0bac10 | |||
|
|
b56da4ae68 | ||
|
|
d13f7792f5 | ||
| e08ef34c29 | |||
|
|
ae7f823fdf |
@@ -1,35 +1,71 @@
|
||||
Installation de divers modules dynamiques avec Nginx
|
||||
====================================================
|
||||
|
||||
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
|
||||
```
|
||||
# Répertoire d'installation
|
||||
cd ~/ngx-modules-src/
|
||||
|
||||
# Copie de la version de Nginx - VERSION
|
||||
sudo nginx -v
|
||||
On récupère la version courante du nginx installé
|
||||
```shell
|
||||
# Détermination de la version courante de Nginx
|
||||
command="nginx -v"
|
||||
nginxv=$( ${command} 2>&1 )
|
||||
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
|
||||
wget http://nginx.org/download/nginx-VERSION.tar.gz
|
||||
tar -xzvf nginx-VERSION.tar.gz
|
||||
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
|
||||
```
|
||||
|
||||
ModSecurity Lib
|
||||
---------------
|
||||
Ce passage n'est nécessaire que si on souhaite utiliser le module dynamique ModSecurity
|
||||
|
||||
```shell
|
||||
# Installation de ModSecurity (Library) -> /usr/local/modsecurity/
|
||||
cd ~/ngx-modules-src/ModSecurity
|
||||
cd ModSecurity
|
||||
git submodule init
|
||||
git submodule update
|
||||
./build.sh
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
cd -
|
||||
```
|
||||
|
||||
cd ~/ngx-modules-src/nginx-VERSION/
|
||||
Compilation des modules dynamiques
|
||||
----------------------------------
|
||||
|
||||
# Installation de ModSecurity & Header-More (Modules Nginx)
|
||||
```shell
|
||||
cd nginx-${VERSION}
|
||||
|
||||
# Compilation de ModSecurity & Header-More
|
||||
./configure --with-compat --add-dynamic-module=../ModSecurity-nginx --add-dynamic-module=../ModSecurity-nginx
|
||||
make modules
|
||||
sudo cp objs/*.so /etc/nginx/modules-available/
|
||||
```
|
||||
```
|
||||
|
||||
Installation des modules
|
||||
------------------------
|
||||
```shell
|
||||
sudo cp objs/*.so /etc/nginx/modules/
|
||||
|
||||
# Retour au répertoire parent
|
||||
cd -
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user