Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 91a081fda3 |
22
Readme.md
22
Readme.md
@@ -13,28 +13,16 @@ Cette instance va:
|
|||||||
|
|
||||||
## Mise en oeuvre
|
## Mise en oeuvre
|
||||||
|
|
||||||
Copier le fichier /usr/share/doc/httpd/instance.conf comme /etc/httpd.conf/*site1*.conf
|
cf site1.conf, à copier dans /etc/httpd/conf/site1.conf
|
||||||
|
|
||||||
Adapter ce fichier pour répondre aux objectifs ci-dessus
|
|
||||||
|
|
||||||
Il est possible de vérifier la syntaxe du fichier via la commande
|
|
||||||
```bash
|
|
||||||
export HTTPD_INSTANCE=site1 ; httpd -tf /etc/httpd/conf/site1.conf
|
|
||||||
```
|
|
||||||
## Gestion du service
|
## Gestion du service
|
||||||
|
|
||||||
on utilise l'unité httpd@**site1**.service avec systemctl
|
|
||||||
|
|
||||||
Pour que instance1 soit relancé avec l'instance principale:
|
```bash
|
||||||
|
systemctl enble httpd@site1.service
|
||||||
créer le répertoire + fichier /etc/systemd/system/httpd\@instance1.service.d/override.conf
|
systemctl start httpd@site1.service
|
||||||
|
|
||||||
Y ajouter:
|
|
||||||
```ini
|
|
||||||
[Unit]
|
|
||||||
ReloadPropagatedFrom=httpd.service
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration du serveur frontal
|
## Configuration du serveur frontal
|
||||||
|
|
||||||
Il suffit de définir un VirtualHost qui va rediriger toutes les requètes reçues sur l'instance concernée, en utilisantl les directives _proxypass_ et _proxypassreverse_
|
cf fichier vh-site1.conf à déployer dans /etc/httpd/conf.d/
|
||||||
|
|||||||
25
site1.conf
Normal file
25
site1.conf
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#/etc/httpd/conf/site1.conf
|
||||||
|
DefaultRuntimeDir /run/httpd/instance-${HTTPD_INSTANCE}
|
||||||
|
PidFile /run/httpd/instance-${HTTPD_INSTANCE}.pid
|
||||||
|
Listen 8801
|
||||||
|
Include conf.modules.d/*.conf
|
||||||
|
User user1
|
||||||
|
Group user1
|
||||||
|
ServerAdmin root@site1.lia.fr
|
||||||
|
<Directory />
|
||||||
|
Options none
|
||||||
|
AllowOverride none
|
||||||
|
Require all denied
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
DocumentRoot "/srv/site1/www/"
|
||||||
|
<Directory "/srv/site1/www">
|
||||||
|
Require all granted
|
||||||
|
Options +indexes
|
||||||
|
</Directory>
|
||||||
|
DirectoryIndex index.html index.php
|
||||||
|
<Files ".ht*">
|
||||||
|
require all denied
|
||||||
|
</Files>
|
||||||
|
TypesConfig /etc/mime.types
|
||||||
|
EnableSendfile on
|
||||||
15
vh-site1.conf
Normal file
15
vh-site1.conf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#/etc/httpd/conf.d/vh-site1.conf
|
||||||
|
<VirtualHost *:443>
|
||||||
|
ServerName site1.lia.fr
|
||||||
|
ServerAlias www.site1.lia.fr
|
||||||
|
ServerAdmin root@site1.lia.fr
|
||||||
|
|
||||||
|
ErrorLog /srv/site1/logs/error_log
|
||||||
|
CustomLog /srv/site1/logs/access_log combined
|
||||||
|
SSLEngine on
|
||||||
|
SSLCertificateFile /etc/ssl/certs/webserver.crt
|
||||||
|
SSLCertificateKeyFile /etc/ssl/private/webserver.key
|
||||||
|
|
||||||
|
ProxyPass / http://127.0.0.1:8801
|
||||||
|
ProxyPassReverse / http://127.0.0.1:8801
|
||||||
|
</VirtualHost>
|
||||||
Reference in New Issue
Block a user