Outils pour utilisateurs

Outils du site


benevoles:compte_rendus:travaux-2019-05-24

Mettre le site de hackstub sur web d'ARN

Je crois que c'est une solution transitoire d'urgence ou quelque chose. En tout cas, ça semble moins déconnant que de les mettre sur github/gitlab/etc. vu qu'on prône l'autonomie et l'autohébergement.

Création du virtual host

root@web:/home/jmlibs# cp /etc/apache2/sites-available/arn-fai.net.conf /etc/apache2/sites-available/hackstub.netlib.re.conf
root@web:/home/jmlibs# vi /etc/apache2/sites-available/hackstub.netlib.re.conf

Your choices are: 000-default arn-fai.net codelib.re hackstub.netlib.re lg.arn-fai.net netlib.re shaarli.arn-fai.net vps.arn-fai.net
Which site(s) do you want to enable (wildcards ok)?
hackstub.netlib.re
Enabling site hackstub.netlib.re.
To activate the new configuration, you need to run:
  systemctl reload apache2

Test

root@web:/home/jmlibs# apache2ctl configtest
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/ports.conf:8
[Fri May 17 22:25:33.543159 2019] [alias:warn] [pid 27126] AH00671: The Alias directive in /etc/apache2/conf-enabled/acme-challenges.conf at line 1 will probably never match because it overlaps an earlier Alias.
AH00112: Warning: DocumentRoot [/var/www/hackstub.netlib.re] does not exist
AH00526: Syntax error on line 22 of /etc/apache2/sites-enabled/hackstub.netlib.re.conf:
SSLCertificateFile: file '/etc/letsencrypt/www.hackstub.netlib.re/www.hackstub.netlib.re.crt+chain' does not exist or is empty
Action 'configtest' failed.

Deux problèmes * on n'a pas mis les fichiers en place * faut configurer letsencrypt

Mise en place des fichiers

root@web:/home/jmlibs/backups_hackstub.netlib.re# mkdir /var/www/hackstub.netlib.re
root@web:/home/jmlibs/backups_hackstub.netlib.re# cd /var/www/hackstub.netlib.re/

Je commente la partie SSL

root@web:/var/www/hackstub.netlib.re# vi -u /home/jmlibs/.vimrc /etc/apache2/sites-available/hackstub.netlib.re.conf
root@web:/var/www/hackstub.netlib.re# vi -u /home/jmlibs/.vimrc /etc/apache2/sites-available/hackstub.netlib.re.conf
root@web:/var/www/hackstub.netlib.re# apache2ctl configtest
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/ports.conf:8
[Fri May 17 22:37:50.256585 2019] [alias:warn] [pid 27159] AH00671: The Alias directive in /etc/apache2/conf-enabled/acme-challenges.conf at line 1 will probably never match because it overlaps an earlier Alias.
Syntax OK
root@web:/var/www/hackstub.netlib.re# apache2ctl restart
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/ports.conf:8
[Fri May 17 22:39:53.367721 2019] [alias:warn] [pid 27265] AH00671: The Alias directive in /etc/apache2/conf-enabled/acme-challenges.conf at line 1 will probably never match because it overlaps an earlier Alias.

Et je peux tester en mettant

/etc/hosts
89.234.141.68 hackstub.netlib.re

Récupération des backups des fichiers

root@web:/var/www/hackstub.netlib.re# mkdir landpage
root@web:/var/www/hackstub.netlib.re/landpage/# wget https://web.archive.org/web/20190227114712/https://hackstub.netlib.re/landpage/ -O index.html

Puis il faut récrire les liens dans index.html et télécharger tout le reste.

Au bout d'un bon moment, on a ça : http://hackstub.netlib.re/landpage/

SSL

Comme letsencrypt demande que le DNS soit correct, on commence en http.

root@web:/var/www/hackstub.netlib.re# vi -u /home/jmlibs/.vimrc /etc/apache2/sites-available/hackstub.netlib.re.conf

→ Commenter la section 443

Homepage

root@web:/var/www/hackstub.netlib.re/landpage# rm ../index.html
root@web:/var/www/hackstub.netlib.re/landpage# cat ../index.php
<?php
header("location: /landpage/");

Autres services

En fait, contrairement à ce que j'avais compris sur IRC, ce site n'est pas simplement constitué de pages statiques. Il y a aussi des sections /mailman, /blog et /wiki

Je commente les liens vers les sections inexistantes et remplace le lien vers mailman par un lien vers https://forum.arn-fai.net/c/hackstub

benevoles/compte_rendus/travaux-2019-05-24.txt · Dernière modification : 2021/10/11 16:07 de ljf