installation_apache
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| installation_apache [2023/09/17 11:49] – créée baalth | installation_apache [2023/12/08 22:39] (Version actuelle) – voir aussi fred.th | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Installation avec Apache2 ====== | ====== Installation avec Apache2 ====== | ||
| + | Cette page décrit l' | ||
| + | |||
| + | ===== Exigences ===== | ||
| + | |||
| + | Il faut disposer d'un serveur Linux, la démonstration est faite sur Ubuntu 20.04. | ||
| + | <code bash> | ||
| + | $ cat / | ||
| + | DISTRIB_ID=Ubuntu | ||
| + | DISTRIB_RELEASE=20.04 | ||
| + | DISTRIB_CODENAME=focal | ||
| + | DISTRIB_DESCRIPTION=" | ||
| + | </ | ||
| + | Il faut un serveur apache, idéalement en version 2.4 | ||
| + | <code bash> | ||
| + | $ apache2 -v | ||
| + | Server version: Apache/ | ||
| + | Server built: | ||
| + | </ | ||
| + | |||
| + | Ainsi que les modules suivants : | ||
| + | - mod_rewrite | ||
| + | - mod_proxy | ||
| + | - mod_proxy_http | ||
| + | |||
| + | Enfin il faut python et pip en version récente. | ||
| + | |||
| + | ===== Installation ===== | ||
| + | |||
| + | On commence par installer les paquets nécessaires. | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | Ensuite on va activer les modules nécessaires à Apache2. | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | Puis on rédémarre le service | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | ===== Création des répertoires ===== | ||
| + | |||
| + | Il faut créer des répertoires. | ||
| + | Dans le cas présent, nous avons 2 répertoires à la racine de /var/www/. | ||
| + | Le répertoire site/ contient NoethysWeb et grav/, le site vitrine (Optionnel). | ||
| + | |||
| + | <code bash>cd /var/www/ | ||
| + | mkdir site/ | ||
| + | cd site/ | ||
| + | </ | ||
| + | |||
| + | ===== Installation de NoethysWeb ===== | ||
| + | |||
| + | Il faut télécharger la dernière version de NoethysWeb | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | Une fois le fichier télécharger il suffit d' | ||
| + | |||
| + | |||
| + | ====== Exemple de fichier (téléchargeable et commenté) ====== | ||
| + | |||
| + | <file bash exemple-ssl.conf> | ||
| + | < | ||
| + | < | ||
| + | DocumentRoot / | ||
| + | # Gestion des alias sur le serveur | ||
| + | # Alias pour l' | ||
| + | Alias /phpmyadmin / | ||
| + | # Alias des media et des fichiers statiques de NoethysWeb | ||
| + | Alias /media / | ||
| + | Alias /static / | ||
| + | # Alias de la racine du Site créé avec le CMS GRAV (Optionnel) | ||
| + | Alias / / | ||
| + | |||
| + | # ProxyPreserveHost permet de servir NoethysWeb tel qu'il est exposé par Django | ||
| + | ProxyPreserveHost On | ||
| + | # Cette route permet la transmission du captcha via apache. | ||
| + | ProxyPass /captcha http:// | ||
| + | # Routes spécifiques correspondantes aux URLS paramétrées dans le fichier settings.production.py | ||
| + | ProxyPass / | ||
| + | ProxyPassReverse / | ||
| + | ProxyPass / | ||
| + | ProxyPassReverse / | ||
| + | ProxyPass /portail http:// | ||
| + | ProxyPassReverse /portail http:// | ||
| + | # Route spécifique à l' | ||
| + | ProxyPass / | ||
| + | ProxyPassReverse / | ||
| + | # Route avertissant l' | ||
| + | ProxyPass /locked http:// | ||
| + | ProxyPassReverse /locked http:// | ||
| + | |||
| + | ServerAdmin webmaster@localhost | ||
| + | | ||
| + | < | ||
| + | Require all granted | ||
| + | </ | ||
| + | < | ||
| + | Require all granted | ||
| + | </ | ||
| + | < | ||
| + | Require all granted | ||
| + | Options FollowSymlinks | ||
| + | AllowOverride all | ||
| + | Allow from all | ||
| + | </ | ||
| + | < | ||
| + | Require all granted | ||
| + | </ | ||
| + | < | ||
| + | Options SymLinksIfOwnerMatch | ||
| + | DirectoryIndex index.php | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | Require all denied | ||
| + | </ | ||
| + | | ||
| + | < | ||
| + | Require all denied | ||
| + | </ | ||
| + | | ||
| + | < | ||
| + | Require all granted | ||
| + | Options FollowSymlinks | ||
| + | AllowOverride all | ||
| + | </ | ||
| + | ErrorLog ${APACHE_LOG_DIR}/ | ||
| + | CustomLog ${APACHE_LOG_DIR}/ | ||
| + | ServerName www.mon_association.fr | ||
| + | SSLCertificateFile / | ||
| + | SSLCertificateKeyFile / | ||
| + | Include / | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | =====Voir aussi===== | ||
| + | Dans la rubrique installation-hébergement : | ||
| + | * [[autohebergement]] | ||
| + | * [[installation_apache]] | ||
| + | * [[settings_production_detail]] | ||
| + | * [[noethysweb_easy]] | ||
installation_apache.1694944164.txt.gz · Dernière modification : 2023/09/17 11:49 de baalth