yunohost_dans_lxc
Ceci est une ancienne révision du document !
Table des matières
Un conteneur LXC pour Yunohost
Objectif : Migrer le serveur (VPS) de duniter.be vers un conteneur LXC sur un serveur plus costaud.
(Attention, Yunohost n'est actuellement disponible que pour Debian Stretch et pas encore pour Debian Buster!)
# lxc-create -t download -n yunohost -- --dist debian --release stretch --arch amd64 # cat /var/lib/lxc/yunohost/config lxc.start.auto = 1 # Distribution configuration lxc.include = /usr/share/lxc/config/common.conf lxc.arch = linux64 # Container specific configuration lxc.rootfs.path = dir:/var/lib/lxc/yunohost/rootfs lxc.uts.name = yunohost # Network configuration lxc.net.0.type = veth lxc.net.0.link = lxcbr0 lxc.net.0.flags = up lxc.net.0.hwaddr = 00:16:3e:9e:94:00 # cat /etc/lxc/dnsmasq.conf (...) dhcp-host=yunohost,10.0.3.6 # systemctl restart lxc-net # lxc-start yunohost # lxc-ls -f NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED yunohost RUNNING 1 - 10.0.3.6 - false
Installation de Yunohost
Documentation : Installing YunoHost manually
# lxc-attach yunohost root@yunohost:/# apt install curl root@yunohost:/# curl https://install.yunohost.org | bash (...) [ OK ] YunoHost installation completed ! =============================================================================== You should now proceed with Yunohost post-installation. This is where you will be asked for : - the main domain of your server ; - the administration password. (...)
On lance la “post-installation” :
root@yunohost:/# yunohost tools postinstall Domaine principal : artanux.be Vous êtes maintenant sur le point de définir un nouveau mot de passe d’administration. Le mot de passe doit comporter au moins 8 caractères – bien qu’il soit recommandé d’utiliser un mot de passe plus long (c’est-à-dire une phrase secrète) et/ou d’utiliser différents types de caractères (majuscules, minuscules, chiffres et caractères spéciaux). Nouveau mot de passe d’administration : Confirmez : nouveau mot de passe d’administration : Info : L'installation de YunoHost est en cours … (...) Succès ! YunoHost a été configuré Attention : La post-installation est terminée mais YunoHost a besoin d’au moins un utilisateur pour fonctionner correctement. Vous devez en ajouter un en utilisant 'yunohost user create $nomdutilisateur' ou bien via l’interface d’administration web.
On ajoute donc un utilisateur :
root@yunohost:/# yunohost user create nomutilisateur Prénom : prenom Nom : nom Adresse de courriel : ******@artanux.be Vous êtes maintenant sur le point de définir un nouveau mot de passe utilisateur. Le mot de passe doit comporter au moins 8 caractères — bien qu’il soit recommandé d’utiliser un mot de passe plus long (c’est-à-dire une phrase secrète) et/ou d’utiliser différents types de caractères (majuscules, minuscules, chiffres et caractères spéciaux). Mot de passe : Confirmez : mot de passe : Creating directory '/home/nomutilisateur'. Succès ! La configuration de SSOwat a été générée Succès ! L’utilisateur a été créé fullname: prenom nom mail: *******@artanux.be username: nomutilisateur
Configuration DNS Chez OVH
Il y a une commande yunohost qui donne la configuration par défaut :
root@yunohost:/# yunohost domain dns-conf artanux.be Info : Cette page montre la configuration *recommandée*. Elle ne configure *pas* le DNS pour vous. Il est de votre responsabilité que de configurer votre zone DNS chez votre fournisseur/registrar DNS avec cette recommandation. ; Basic ipv4/ipv6 records @ 3600 IN A 37.187.127.107 * 3600 IN A 37.187.127.107 ; XMPP _xmpp-client._tcp 3600 IN SRV 0 5 5222 artanux.be. _xmpp-server._tcp 3600 IN SRV 0 5 5269 artanux.be. muc 3600 IN CNAME @ pubsub 3600 IN CNAME @ vjud 3600 IN CNAME @ ; Mail @ 3600 IN MX 10 artanux.be. @ 3600 IN TXT "v=spf1 a mx ip4:37.187.127.107 -all" mail._domainkey 3600 IN TXT "v=DKIM1; h=sha256; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDuAgB7uHn1gy0pix2P1sfVtB9NQpMAVAi9UcuiGficw9a9xFIGbccPsgdVo79Ktt2O+G+HCq+WJln5iftr1+W4QMj8BNlClG6t26QQqK5G20NLaKappYmEKNgTBI40h00M59nVebIUlCMQiI4r7kD0sWPfQIIs/y/K1ouZSpDirwIDAQAB" _dmarc 3600 IN TXT "v=DMARC1; p=none" ; Extra @ 3600 IN CAA 128 issue "letsencrypt.org"
On ne peut pas copier telle quelle cette configuration dans les zones DNS chez OVH. J'ai du remanier un peu :
$TTL 3600 @ IN SOA dns101.ovh.net. tech.ovh.net. (2020010808 86400 3600 3600000 300) IN NS dns101.ovh.net. IN NS ns101.ovh.net. IN MX 10 artanux.be. IN A 37.187.127.107 IN CAA 128 issue "letsencrypt.org" 600 IN TXT "v=spf1 a mx ip4:37.187.127.107 -all" * IN CNAME artanux.be. _dmarc IN TXT "v=DMARC1; p=none;" _xmpp-client._tcp IN SRV 0 5 5222 artanux.be. _xmpp-server._tcp IN SRV 0 5 5269 artanux.be. mail._domainkey IN TXT ( "v=DKIM1; h=sha256; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDuAgB7uHn1gy0pix2P1sfVtB9NQpMAVAi9UcuiGficw9a9xFIGbccPsgdVo79Ktt2O+G+HCq+WJln5iftr1+W4QMj8BNlClG6t26QQqK5G20NLaKappYmEKNgTBI40h00M59nVebIUlCMQiI4r7kD0sWPfQIIs/y/K1ouZSpDirwIDAQAB" ) muc IN CNAME artanux.be. pubsub IN CNAME artanux.be. vjud IN CNAME artanux.be.
(Je me suis inspiré de ciney.xyz pour la syntaxe qui ne correspond pas trop à ce que la commande initiale donne.)
Reverse Proxy Nginx
yunohost_dans_lxc.1578522114.txt.gz · Dernière modification : 2020/08/09 12:59 (modification externe)