Skip to content

Commit 5b79982

Browse files
authored
Merge pull request #465 from dbarzin/main
Rebase
2 parents 7140d09 + 80f3017 commit 5b79982

File tree

5 files changed

+339
-7
lines changed

5 files changed

+339
-7
lines changed

INSTALL.debian.fr.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Peupler la base de données avec la norme ISO 27001:2022 et générer un jeu de
114114
php artisan deming:import-framework ./storage/app/repository/ISO27001-2022.fr.xlsx
115115
php artisan deming:generate-tests
116116

117-
Démarrer l'application avec PHP
117+
## Démarrer l'application avec PHP
118118

119119
php artisan serve
120120

@@ -132,6 +132,36 @@ L'administrateur utilise la langue anglaise par défaut. Pour changer de langue,
132132

133133
Pour importer un référentiel et générer des données de test, allez dans "Configuration" -> "Import" (optionel).
134134

135+
## Démarrer l'application avec systemd
136+
137+
Il est également possible de faire démarrer l'application en tant que service `systemd`. Pour cela, créez un nouveau fichier de définition du service :
138+
139+
su root -c "vi /etc/systemd/system/deming.service"
140+
141+
Ajoutez les lignes suivantes:
142+
143+
[Unit]
144+
Description=Deming
145+
After=network.target
146+
After=mariadb.service
147+
After=apache2.service
148+
149+
[Service]
150+
Type=simple
151+
ExecStart=/usr/bin/php artisan serve --host 127.0.0.1 --port 8000
152+
User=www-data
153+
Group=www-data
154+
WorkingDirectory=/var/www/deming
155+
KillMode=mixed
156+
157+
[Install]
158+
WantedBy=multi-user.target
159+
160+
Prenez en compte ce nouveau service et démarrez l'application :
161+
162+
systemctl daemon-reload
163+
systemctl enable --now deming.service
164+
135165
## Apache
136166

137167
Pour configurer Apache, modifiez les propriétés du répertoire Deming et accordez les autorisations appropriées au répertoire de stockage avec la commande suivante :
@@ -166,6 +196,60 @@ Enfin, redémarrez le service Apache pour activer les modifications :
166196

167197
su - root -c "systemctl restart apache2"
168198

199+
## Apache avec configuration HTTPS
200+
201+
En complément des étapes ci-dessus, créez ou modifiez le fichier de configuration d'hôte virtuel Apache pour servir l'application :
202+
203+
su root -c "vi /etc/apache2/sites-available/deming.conf"
204+
205+
Ajouter les lignes suivantes :
206+
207+
<VirtualHost *:80>
208+
ServerName deming.local
209+
210+
RewriteEngine On
211+
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1
212+
</VirtualHost>
213+
214+
<VirtualHost *:443>
215+
ServerName deming.local
216+
DocumentRoot /var/www/deming/public
217+
218+
Protocols h2 h2c http/1.1
219+
220+
<Directory /var/www/deming>
221+
AllowOverride All
222+
</Directory>
223+
224+
ProxyPass / http://127.0.0.1:8000/
225+
ProxyPassReverse / http://127.0.0.1:8000/
226+
ProxyPreserveHost On
227+
228+
# Si vous utilisez php-fpm (chemin de la socket à adapter à votre cas)
229+
#<FilesMatch \.php$>
230+
# SetHandler "proxy:unix:/var/run/php/php8.2-fpm.sock|fcgi://localhost/"
231+
#</FilesMatch>
232+
233+
ErrorLog ${APACHE_LOG_DIR}/error.log
234+
CustomLog ${APACHE_LOG_DIR}/access.log combined
235+
236+
<IfModule mod_headers.c>
237+
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
238+
Header always set Referrer-Policy "no-referrer"
239+
Header always set X-Content-Type-Options "no-sniff"
240+
Header always set X-XSS-Protection "1; mode=block"
241+
Header always set X-Robots-Tag "none"
242+
Header always set X-Frame-Options "SAMEORIGIN"
243+
Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=Strict"
244+
</IfModule>
245+
246+
SSLEngine on
247+
SSLCertificateFile /etc/apache2/ssl/deming.local.crt
248+
SSLCertificateKeyFile /etc/apache2/ssl/deming.local.key
249+
</VirtualHost>
250+
251+
Dans le cadre de cette configuration servant l'application en HTTPS, il pourra être nécessaire de positionner la variable `APP_ENV` à la valeur `production` dans le fichier `.env` de Deming.
252+
169253
## PHP
170254

171255
Vous devez définir les valeurs de upload_max_filesize et post_max_size dans votre php.ini (/etc/php/8.2/apache2/php.ini):

INSTALL.debian.md

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Populate database with ISO 27001:2022 standard and generate test set (optional)
114114
php artisan deming:import-framework ./storage/app/repository/ISO27001-2022.en.xlsx
115115
php artisan deming:generate-tests
116116

117-
Start application with PHP
117+
## Start application with PHP
118118

119119
php artisan serve
120120

@@ -132,6 +132,36 @@ The administrator's default language is English. To change language, go to the u
132132

133133
To import a repository and generate test data, go to "Configuration" -> "Import" (optional).
134134

135+
## Start application with systemd
136+
137+
It is also possible to have the application start as a `systemd` service. For this you will need to create the service's defintion file:
138+
139+
su root -c "vi /etc/systemd/system/deming.service"
140+
141+
and add it the following content:
142+
143+
[Unit]
144+
Description=Deming
145+
After=network.target
146+
After=mariadb.service
147+
After=apache2.service
148+
149+
[Service]
150+
Type=simple
151+
ExecStart=/usr/bin/php artisan serve --host 127.0.0.1 --port 8000
152+
User=www-data
153+
Group=www-data
154+
WorkingDirectory=/var/www/deming
155+
KillMode=mixed
156+
157+
[Install]
158+
WantedBy=multi-user.target
159+
160+
Reload `systemd` to take this new service in account and start the application:
161+
162+
systemctl daemon-reload
163+
systemctl enable --now deming.service
164+
135165
## Apache
136166

137167
To configure Apache, modify the Deming directory properties and grant appropriate permissions to the hive with the following command:
@@ -166,6 +196,58 @@ Finally, restart the Apache service to activate the changes:
166196

167197
su - root -c "systemctl restart apache2"
168198

199+
## Apache with HTTPS configuration
200+
201+
In addition to the above instructions, create or modify the virtual host configuration's file:
202+
203+
su root -c "vi /etc/apache2/sites-available/deming.conf"
204+
205+
and add the following content:
206+
207+
<VirtualHost *:80>
208+
ServerName deming.local
209+
210+
RewriteEngine On
211+
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1
212+
</VirtualHost>
213+
214+
<VirtualHost *:443>
215+
ServerName deming.local
216+
DocumentRoot /var/www/deming/public
217+
218+
Protocols h2 h2c http/1.1
219+
220+
<Directory /var/www/deming>
221+
AllowOverride All
222+
</Directory>
223+
224+
ProxyPass / http://127.0.0.1:8000/
225+
ProxyPassReverse / http://127.0.0.1:8000/
226+
ProxyPreserveHost On
227+
228+
# If you user php-fpm adapt the socket's path below and uncomment
229+
#<FilesMatch \.php$>
230+
# SetHandler "proxy:unix:/var/run/php/php8.2-fpm.sock|fcgi://localhost/"
231+
#</FilesMatch>
232+
233+
ErrorLog ${APACHE_LOG_DIR}/error.log
234+
CustomLog ${APACHE_LOG_DIR}/access.log combined
235+
236+
<IfModule mod_headers.c>
237+
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
238+
Header always set Referrer-Policy "no-referrer"
239+
Header always set X-Content-Type-Options "no-sniff"
240+
Header always set X-XSS-Protection "1; mode=block"
241+
Header always set X-Robots-Tag "none"
242+
Header always set X-Frame-Options "SAMEORIGIN"
243+
Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=Strict"
244+
</IfModule>
245+
246+
SSLEngine on
247+
SSLCertificateFile /etc/apache2/ssl/deming.local.crt
248+
SSLCertificateKeyFile /etc/apache2/ssl/deming.local.key
249+
</VirtualHost>
250+
169251
## PHP
170252

171253
You must define the values for upload_max_filesize and post_max_size in your php.ini (/etc/php/8.2/apache2/php.ini):

INSTALL.fr.md

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Lancer MariaDB avec les droits root
5252
Créer la base de données _deming_ et l'utilisateur _deming_user_
5353

5454
CREATE DATABASE deming CHARACTER SET utf8 COLLATE utf8_general_ci;
55-
CREATE USER 'deming_user'@'localhost' IDENTIFIED BY 'demPasssword-123';
55+
CREATE USER 'deming_user'@'localhost' IDENTIFIED BY 'demPasssword-123';
5656
GRANT ALL ON deming.* TO deming_user@localhost;
5757
GRANT PROCESS ON *.* TO 'deming_user'@'localhost';
5858

@@ -109,7 +109,7 @@ Peupler la base de données avec la norme ISO 27001:2022 et générer un jeu de
109109
php artisan deming:import-framework ./storage/app/repository/ISO27001-2022.fr.xlsx --clean
110110
php artisan deming:generate-tests
111111

112-
Démarrer l'application avec PHP
112+
## Démarrer l'application avec PHP
113113

114114
php artisan serve
115115

@@ -127,6 +127,36 @@ L'administrateur utilise la langue anglaise par défaut. Pour changer de langue,
127127

128128
Pour importer un référentiel et générer des données de test, allez dans "Configuration" -> "Import" (optionel).
129129

130+
## Démarrer l'application avec systemd
131+
132+
Il est également possible de faire démarrer l'application en tant que service `systemd`. Pour cela, créez un nouveau fichier de définition du service :
133+
134+
su root -c "vi /etc/systemd/system/deming.service"
135+
136+
Ajoutez les lignes suivantes:
137+
138+
[Unit]
139+
Description=Deming
140+
After=network.target
141+
After=mariadb.service
142+
After=apache2.service
143+
144+
[Service]
145+
Type=simple
146+
ExecStart=/usr/bin/php artisan serve --host 127.0.0.1 --port 8000
147+
User=www-data
148+
Group=www-data
149+
WorkingDirectory=/var/www/deming
150+
KillMode=mixed
151+
152+
[Install]
153+
WantedBy=multi-user.target
154+
155+
Prenez en compte ce nouveau service et démarrez l'application :
156+
157+
systemctl daemon-reload
158+
systemctl enable --now deming.service
159+
130160
## Apache
131161

132162
Pour configurer Apache, modifiez les propriétés du répertoire Deming et accordez les autorisations appropriées au répertoire de stockage avec la commande suivante :
@@ -164,6 +194,60 @@ Enfin, redémarrez le service Apache pour activer les modifications :
164194

165195
sudo systemctl restart apache2
166196

197+
## Apache avec configuration HTTPS
198+
199+
En complément des étapes ci-dessus, créez ou modifiez le fichier de configuration d'hôte virtuel Apache pour servir l'application :
200+
201+
su root -c "vi /etc/apache2/sites-available/deming.conf"
202+
203+
Ajouter les lignes suivantes :
204+
205+
<VirtualHost *:80>
206+
ServerName deming.local
207+
208+
RewriteEngine On
209+
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1
210+
</VirtualHost>
211+
212+
<VirtualHost *:443>
213+
ServerName deming.local
214+
DocumentRoot /var/www/deming/public
215+
216+
Protocols h2 h2c http/1.1
217+
218+
<Directory /var/www/deming>
219+
AllowOverride All
220+
</Directory>
221+
222+
ProxyPass / http://127.0.0.1:8000/
223+
ProxyPassReverse / http://127.0.0.1:8000/
224+
ProxyPreserveHost On
225+
226+
# Si vous utilisez php-fpm (chemin de la socket à adapter à votre cas)
227+
#<FilesMatch \.php$>
228+
# SetHandler "proxy:unix:/var/run/php/php8.3-fpm.sock|fcgi://localhost/"
229+
#</FilesMatch>
230+
231+
ErrorLog ${APACHE_LOG_DIR}/error.log
232+
CustomLog ${APACHE_LOG_DIR}/access.log combined
233+
234+
<IfModule mod_headers.c>
235+
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
236+
Header always set Referrer-Policy "no-referrer"
237+
Header always set X-Content-Type-Options "no-sniff"
238+
Header always set X-XSS-Protection "1; mode=block"
239+
Header always set X-Robots-Tag "none"
240+
Header always set X-Frame-Options "SAMEORIGIN"
241+
Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=Strict"
242+
</IfModule>
243+
244+
SSLEngine on
245+
SSLCertificateFile /etc/apache2/ssl/deming.local.crt
246+
SSLCertificateKeyFile /etc/apache2/ssl/deming.local.key
247+
</VirtualHost>
248+
249+
Dans le cadre de cette configuration servant l'application en HTTPS, il pourra être nécessaire de positionner la variable `APP_ENV` à la valeur `production` dans le fichier `.env` de Deming.
250+
167251
## PHP
168252

169253
Vous devez définir les valeurs de upload_max_filesize et post_max_size dans votre php.ini

0 commit comments

Comments
 (0)