Compare commits
1 Commits
8a914d70e1
...
lia
| Author | SHA1 | Date | |
|---|---|---|---|
| fae69adb10 |
54
Readme.md
54
Readme.md
@@ -1,53 +1,13 @@
|
|||||||
# VirtualHost
|
# Vhost
|
||||||
|
|
||||||
## Introduction
|
Mise en place d'un vhost pour héberge _votre_ site avec les spec suivantes:
|
||||||
|
|
||||||
Mise en place du site _formation1.lia.fr_
|
* docroot dans /srv/NOM/www
|
||||||
|
* log d'accès dans /srv/NOM/logs/access\_log
|
||||||
|
* log d'erreur dans /srv/NOM/logs/error\_log
|
||||||
|
|
||||||
On s'assurera de l'association formation1.lia.fr <-> adresse ip du serveur apache via le fichier /etc/hosts, ou encore mieux le serveur dns mis en place avant-hier.
|
Validation
|
||||||
|
|
||||||
## Atelier 1
|
curl http://NOM doit permettre d'accéder aux fichiers stockés dans /srv/NOM/www
|
||||||
|
|
||||||
Nom du fichier de conf: /etc/httpd/conf.d/formation1.lia.fr.conf
|
|
||||||
|
|
||||||
Nom du serveur: formation1.lia.fr
|
|
||||||
|
|
||||||
Emplacement des fichiers web: /srv/formation1.lia.fr/www
|
|
||||||
|
|
||||||
Emplacement des logs d'accès: /srv/formation1.lia.fr/logs/access_log
|
|
||||||
|
|
||||||
Emplacement des logs d'erreur: /srv/formation1.lia.fr/logs/error_log
|
|
||||||
|
|
||||||
Affichage des stats via url /status, accessible uniquement depuis _local_
|
|
||||||
```bash
|
|
||||||
<VirttualHost *>
|
|
||||||
ServerName formation1.lia.fr
|
|
||||||
ServerAdmin root@formation1.lia.fr
|
|
||||||
DocumentRoot /srv/formation1.lia.fr/www
|
|
||||||
ErrorLog /srv/formation1.lia.fr/logs/error_log
|
|
||||||
CustomLog /srv/formation1.lia.fr/logs/access_log combined
|
|
||||||
|
|
||||||
<Directory />
|
|
||||||
require all denied
|
|
||||||
Options None
|
|
||||||
</Directory>
|
|
||||||
|
|
||||||
<Directory /srv/formation1.lia.fr/www>
|
|
||||||
Require all granted
|
|
||||||
Options +indexes
|
|
||||||
</Directory>
|
|
||||||
|
|
||||||
<Location /status>
|
|
||||||
SetHandler server-status
|
|
||||||
Require local
|
|
||||||
</Location>
|
|
||||||
</VirtualHost>
|
|
||||||
```
|
|
||||||
## Atelier 2
|
|
||||||
|
|
||||||
Faire la même chose pour héberger /etc/httpd/conf.d/formation2.lia.fr.conf
|
|
||||||
|
|
||||||
Comment mutualiser les éléments identiques ? (par exemple la partie concernant server-status)
|
|
||||||
|
|
||||||
> on déplace le bloc concernant "location status" dans un fichier à part, qu'on inclue directement dans /etc/httpd/conf.d ou via une directive include
|
|
||||||
|
|
||||||
|
|||||||
14
eval.sh
Normal file
14
eval.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
# this script is meant to be run by ansible
|
||||||
|
|
||||||
|
source /root/functions.sh
|
||||||
|
# check that alias has been tried
|
||||||
|
addHeader
|
||||||
|
fileMustExist /etc/httpd/conf.d/cours.opendoor.fr.conf
|
||||||
|
dirMustExist /srv/cours/www
|
||||||
|
dirMustExist /srv/cours/logs
|
||||||
|
pkgInstalled httpd
|
||||||
|
serviceIsEnabled httpd
|
||||||
|
serviceIsActive httpd
|
||||||
|
okIfCurl http://localhost/status "Apache Server Status for localhost"
|
||||||
|
okIfCurl http://localhost/config "strong>MPM Name"
|
||||||
Reference in New Issue
Block a user