[Gandi] [Serveur] [IaaS] Installation d’un serveur Minetest dans un conteneur LXC

[Gandi] [Serveur] [IaaS] Installation d’un serveur Minetest dans un conteneur LXC

1/ Connexion au serveur.

➜  ~ ssh admin@46.226.109.238
admin@46.226.109.238's password:
Linux server01lxc 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64
...
admin@server01lxc:~$

2/ Connexion en ‘root‘.

admin@server01lxc:~$ su
Password:
root@server01lxc:/home/admin#

3/ Règle iptable.

root@server01lxc:/home/admin# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 30000 -j DNAT --to-destination 10.0.3.13:30000
root@server01lxc:/home/admin# iptables -t nat -A PREROUTING -i eth0 -p udp --dport 30000 -j DNAT --to-destination 10.0.3.13:30000

4/ Vérification de la distribution installé sur le conteneur.

root@vm03:/# hostnamectl
   Static hostname: vm03
         Icon name: computer-container
           Chassis: container
        Machine ID: 03cd9b8e9a114682987b1836b6df9da4
           Boot ID: af72c3e17f3f47b488fbafe87d3b72fa
    Virtualization: lxc
  Operating System: Debian GNU/Linux 9 (stretch)
            Kernel: Linux 4.9.0-4-amd64
      Architecture: x86-64
root@vm03:/#

5/ Liste des conteneurs.

root@server01lxc:/home/admin# lxc-ls --fancy
NAME   STATE   AUTOSTART GROUPS IPV4      IPV6
vm01   RUNNING 0         -      10.0.3.11 -
vm02   RUNNING 0         -      10.0.3.12 -
vm02_1 STOPPED 0         -      -         -
vm03   RUNNING 0         -      10.0.3.13 -
root@server01lxc:/home/admin#

6/ Copie de sauvegarde du conteneur de travail.

root@server01lxc:/home/admin# lxc-stop -n vm03
root@server01lxc:/home/admin# lxc-copy -n vm03 -N vm03_1
root@server01lxc:/home/admin# lxc-start -n vm03
root@server01lxc:/home/admin# lxc-ls --fancy
NAME   STATE   AUTOSTART GROUPS IPV4      IPV6
vm01   RUNNING 0         -      10.0.3.11 -
vm02   RUNNING 0         -      10.0.3.12 -
vm02_1 STOPPED 0         -      -         -
vm03   RUNNING 0         -      10.0.3.13 -
vm03_1 STOPPED 0         -      -         -
root@server01lxc:/home/admin#

7/ Connexion au conteneur.

root@server01lxc:/home/admin# lxc-attach -n vm03

8/ Mise-à-jour dy système d’exploitation.

root@vm03:/# apt-get update && apt-get upgrade

9/ Installation des paquets de base.

root@vm03:/# apt-get install vim mc screen curl wget

10/ Installation des paquets de développement.

root@vm03:/# apt-get install build-essential git-core cmake libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libluajit-5.1-2 libluajit-5.1-dev  libncurses5-dev doxygen gettext-base libgettextpo-dev libopenal-dev libvorbis-dev gettext libleveldb-dev postgresql-client-9.6 postgresql-all postgresql-server-dev-all postgresql-server-dev-9.6

11/ Ajout de l’utilisateur ‘minetest‘.

root@vm03:/# adduser minetest
root@vm03:/# su minetest
minetest@vm03:/$ cd
minetest@vm03:~$

12/ Création du répertoire de travail.

minetest@vm03:~$ mkdir -p JEUX/MINETEST
minetest@vm03:~$ cd JEUX/MINETEST/
minetest@vm03:~/JEUX/MINETEST$

13/ Téléchargement du code source.

minetest@vm03:~/JEUX/MINETEST$ git clone https://github.com/minetest/minetest.git minetest.v0415

14/ Activation de la branche stable 0.4.15.

minetest@vm03:~/JEUX/MINETEST/minetest.v0415$ git checkout tags/0.4.15
minetest@vm03:~/JEUX/MINETEST/minetest.v0415$ git checkout -b 0.4.16
minetest@vm03:~/JEUX/MINETEST/minetest.v0415$ git branch
* 0.4.16
  master

15/ Configuration de la compilation.

minetest@vm03:~/JEUX/MINETEST/minetest.v0415$ cmake . -DRUN_IN_PLACE=TRUE -DBUILD_SERVER=TRUE -DENABLE_LUAJIT=TRUE -DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=TRUE -DENABLE_CURL=TRUE -DENABLE_GLES=TRUE -DCMAKE_BUILD_TYPE=Release

16/ Compilation.

minetest@vm03:~/JEUX/MINETEST/minetest.v0415$ make

17/ Téléchargement du jeu de base.

minetest@vm03:~/JEUX/MINETEST/minetest.v0415$ cd ..
minetest@vm03:~/JEUX/MINETEST$ git clone https://github.com/minetest/minetest_game.git
minetest@vm03:~/JEUX/MINETEST$ cd minetest_game/
minetest@vm03:~/JEUX/MINETEST/minetest_game$

18/ Changement de branche.

minetest@vm03:~/JEUX/MINETEST/minetest_game$ git checkout tags/0.4.15
minetest@vm03:~/JEUX/MINETEST/minetest_game$ git checkout -b 0.4.16

19/ Installation du jeu de base.

minetest@vm03:~/JEUX/MINETEST/minetest_game$ cd ../minetest.v0415/games/
minetest@vm03:~/JEUX/MINETEST/minetest.v0415/games$ ln -s ../../minetest_game/

20/ Fichier de configuration.

minetest@vm03:~/JEUX/MINETEST/minetest.v0415/games$ cd minetest_game
minetest@vm03:~/JEUX/MINETEST/minetest.v0415/games/minetest_game$ cp minetest.conf.example minetest.conf

Ouvrir :

minetest.conf

Chercher :

#creative_mode = false

Remplacer par :

creative_mode = true

Ajouter :

default_privs = interact, shout, fast, fly

21/ Lancement du serveur.

minetest@vm03:~/JEUX/MINETEST/minetest.v0415/games/minetest_game$ cd ../../bin/
minetest@vm03:~/JEUX/MINETEST/minetest.v0415/bin$ ./minetestserver --gameid minetest_game

22/ Lancement du serveur sous ‘screen‘.

– Lancement de screen :

minetest@vm03:~/JEUX/MINETEST/minetest.v0415/bin$ exit
root@vm03:/# script /dev/null
Script started, file is /dev/null
root@vm03:/# screen

– Lancement du serveur ‘minetest‘ :

root@vm03:/# su minetest
minetest@vm03:/$ cd /home/minetest/JEUX/MINETEST/minetest.v0415/bin/
minetest@vm03:~/JEUX/MINETEST/minetest.v0415/bin$ ./minetestserver --gameid minetest_game

– Détacher le ‘screen‘ :
[Ctrl] + [A] [D]

[detached from 12833.pts-4.vm03]
root@vm03:/#

– Quitter ‘screen‘ :

root@vm03:/# exit
exit
Script done, file is /dev/null
root@vm03:/# exit
exit

– Quitter ‘root‘ :

root@server01lxc:/home/admin# exit
exit
admin@server01lxc:~$

– Quitter le serveur :

admin@server01lxc:~$ logout
Connection to 46.226.109.238 closed.
➜  ~

23/ Liens.

http://jeulibre.saventurier.science/installation-dun-serveur-minetest-stable-0-4-16-sur-un-serveur-gandi-iaas/
http://rockstarninja.saventurier.science/gandi-serveur-iaas-installation-de-etherpad-dans-un-conteneur-lxc/

Comments are closed, but trackbacks and pingbacks are open.