Installation de Rocket.Chat sur Debian 8.0

Installation de Rocket.Chat sur Debian 8.0
Distribution : Debian 8
1/ Installation des paquets de base :

root@server01:~# apt-get install npm lsb-release curl graphicsmagick

2/ Installation de MongoDB 3.2.* :
– Ajout de dépôt distance pour la dernière version de MongoDB :

root@server01:~# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
root@server01:~# echo "deb http://repo.mongodb.org/apt/debian "$(lsb_release -sc)"/mongodb-org/3.2 main" | tee /etc/apt/sources.list.d/mongodb.list

– Mise-à-jour de la distribution :

root@server01:~# apt-get update

– Installation de MongoDB :

root@server01:~# apt-get install mongodb-org
root@server01:~# mongod --version
db version v3.2.8

– Démarrage du serveur :

root@server01:~# service mongod start

3/ Selection de Node version 0.10.40 :

root@server01:~# npm install -g n
root@server01:~# n 0.10.40

4/ Ajout de l’utilisateur geekit :

root@server01:~# adduser geekit
root@server01:~# su geekit
geekit@server01:/root$ cd

6/ Création du répertoire des sites internet de l’utilisateur :

geekit@server01:~$ mkdir public_html
geekit@server01:~$ cd public_html/
geekit@server01:~/public_html$

7/ Téléchargement de l’archive Rocket.Chat :

geekit@server01:~/public_html$ curl -L https://rocket.chat/releases/latest/download -o rocket.chat.tgz
geekit@server01:~/public_html$ tar zxvf rocket.chat.tgz
geekit@server01:~/public_html$ mv bundle rocketchat
geekit@server01:~/public_html$ cd rocketchat/programs/server
geekit@server01:~/public_html/rocketchat/programs/server$

8/ Installation de Rocket.Chat :

geekit@server01:~/public_html/rocketchat/programs/server$ npm install
geekit@server01:~/public_html/rocketchat/programs/server$ cd ../..
geekit@server01:~/public_html/rocketchat$

9/ Configuration des variables d’environnement :

geekit@server01:~/public_html/rocketchat$ export ROOT_URL=https://rocketchat.999k.it/
geekit@server01:~/public_html/rocketchat$ export MONGO_URL=mongodb://localhost:27017/rocketchat
geekit@server01:~/public_html/rocketchat$ export PORT=3000

10/ Lancement de Rocket.Chat :

geekit@server01:~/public_html/rocketchat$ node main.js
Updating process.env.MAIL_URL
ufs: store created at
{"line":"114","file":"migrations.js","message":"Migrations: Not migrating, already at version 55","time":{"$date":1468764810467},"level":"info"}
Updating process.env.MAIL_URL
ufs: temp directory created at /tmp/ufs
Using GridFS for Avatar storage
➔ System ➔ startup
➔ +---------------------------------------------+
➔ |                SERVER RUNNING               |
➔ +---------------------------------------------+
➔ |                                             |
➔ |       Version: 0.35.0                       |
➔ |  Process Port: 3000                         |
➔ |      Site URL: https://rocketchat.999k.it/  |
➔ |                                             |
➔ +---------------------------------------------+

Puis couper le serveur : Ctrl + c
11/ Création d’un certificat Let’s Encrypt :
– Création du répertoire de travail :

root@server01:~# su geekit
geekit@server01:/root$ cd
geekit@server01:~$ mkdir LETSENCRYPT

– Téléchargement du code source :

geekit@server01:~/LETSENCRYPT$ git clone https://github.com/letsencrypt/letsencrypt
geekit@server01:~/LETSENCRYPT$ cd letsencrypt/
geekit@server01:~/LETSENCRYPT/letsencrypt$
geekit@server01:~/LETSENCRYPT/letsencrypt$ su

– Arrêt du serveur nginx :

root@server01:/home/geekit/LETSENCRYPT/letsencrypt# service nginx stop

– Création du certificat :

root@server01:/home/geekit/LETSENCRYPT/letsencrypt# ./letsencrypt-auto certonly --standalone

Configuration :

Please enter in your domain name(s) : 999k.it www.999k.it wallabag.999k.it rocketchat.999k.it

– Vérification :

root@server01:/home/geekit/LETSENCRYPT/letsencrypt# ls -l /etc/letsencrypt/live/999k.it/
total 0
lrwxrwxrwx 1 root root 31 Jul 17 16:39 cert.pem -> ../../archive/999k.it/cert1.pem
lrwxrwxrwx 1 root root 32 Jul 17 16:39 chain.pem -> ../../archive/999k.it/chain1.pem
lrwxrwxrwx 1 root root 36 Jul 17 16:39 fullchain.pem -> ../../archive/999k.it/fullchain1.pem
lrwxrwxrwx 1 root root 34 Jul 17 16:39 privkey.pem -> ../../archive/999k.it/privkey1.pem
root@server01:/home/geekit/LETSENCRYPT/letsencrypt# cd

– Liens :
http://rockstarninja.tech/generation-de-certificats-ssl-lets-encrypt/
http://rockstarninja.tech/gandiserveur-installation-de-lets-encrypt-avec-nginx-sur-ubuntu-14-04/
12/ Configuration du Serveur block ‘geekit’ :
Ouvrir :

/etc/nginx/sites-enabled/geekit

Ajouter :

# Upstreams
upstream backend {
    server 127.0.0.1:3000;
}
server {
    listen 443;
    server_name rocketchat.999k.it;
    error_log /var/log/nginx/rocketchat.access.log;
    ssl on;
    ssl_certificate /etc/letsencrypt/live/999k.it/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/999k.it/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don’t use SSLv3 ref: POODLE
    location / {
        proxy_pass http://rocketchat.999k.it:3000/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;
        proxy_redirect off;
    }
}

13/ Démarrage du serveur nginx :

root@server01:~# service nginx restart
root@server01:~# systemctl status nginx.service
root@server01:~# service nginx status

14/ Lancement d’un screen :

root@server01:~# screen -S RocketChat
root@server01:~# su geekit
geekit@server01:/root$ cd ~/public_html/rocketchat/
geekit@server01:~/public_html/rocketchat$

15/ Lancement de RocketChat :

geekit@server01:~/public_html/rocketchat$ export ROOT_URL=https://rocketchat.999k.it/
geekit@server01:~/public_html/rocketchat$ export MONGO_URL=mongodb://localhost:27017/rocketchat
geekit@server01:~/public_html/rocketchat$ export PORT=3000
geekit@server01:~/public_html/rocketchat$ node main.js

16/ Test :
https://rocketchat.999k.it/home
17/ Liens :
http://tecadmin.net/install-mongodb-on-ubuntu/

Comments are closed, but trackbacks and pingbacks are open.