Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
servidores:general:rocketchat [2020/03/25 15:18] fmolinuevo [Instalación y configuración] |
servidores:general:rocketchat [2020/03/29 20:58] (actual) fmolinuevo [Introducción] |
||
---|---|---|---|
Línea 1: | Línea 1: | ||
====== Instalando Rocket.Chat 3 en Debian 9 Stretch ====== | ====== Instalando Rocket.Chat 3 en Debian 9 Stretch ====== | ||
+ | |||
+ | |||
+ | //Por Félix Molinuevo, [[axrglobal>|AXR Global]]// **:::** //Fecha creación: **20200327**// | ||
===== Introducción ===== | ===== Introducción ===== | ||
Línea 7: | Línea 10: | ||
Se lo instalará en esta receta sobre Debian Stretch debido a que es difícil instalar MongoDB en las nuevas versiones de Debian por las dependencias de los paquetes. | Se lo instalará en esta receta sobre Debian Stretch debido a que es difícil instalar MongoDB en las nuevas versiones de Debian por las dependencias de los paquetes. | ||
- | ===== Instalación y configuración ===== | + | ===== Instalación de las dependencias ===== |
- | Se seguirá la configuración descrita en el sitio de Rocket.Chat ((https://rocket.chat/docs/installation/manual-installation/debian/)) con algunas pequeñas adaptaciones. | + | Se seguirá la configuración descrita en el sitio de Rocket.Chat ((https://rocket.chat/docs/installation/manual-installation/debian/)) con algunas pequeñas adaptaciones. Se realizará la instalación ingresando como usuario root. |
Primero se debe configurar APT para obtener MongoDB de los repositorios oficiales. | Primero se debe configurar APT para obtener MongoDB de los repositorios oficiales. | ||
- | apt-get install -y dirmngr && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 | + | apt-get -y update && apt-get install -y dirmngr curl && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 |
+ | |||
+ | echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list | ||
+ | |||
+ | Luego configurar Node.js para ser instalado a través del manejador de paquetes: | ||
+ | |||
+ | curl -sL https://deb.nodesource.com/setup_12.x | bash - | ||
+ | |||
+ | Instalar herramientas de compilación, MongoDB, nodejs y graphicsmagick: | ||
+ | |||
+ | apt-get install -y build-essential mongodb-org nodejs graphicsmagick | ||
+ | |||
+ | Ahora, usando npm se debe instalar inherits y n, y la versión de node requerida para Rocket.Chat: | ||
+ | |||
+ | npm install -g inherits n && n 12.14.0 | ||
+ | |||
+ | ===== Instalación de Rocket.Chat ===== | ||
+ | |||
+ | Se debe descargar y descomprimir la última versión de Rocket.Chat: | ||
+ | |||
+ | curl -L https://releases.rocket.chat/latest/download -o /tmp/rocket.chat.tgz | ||
+ | tar -xzf /tmp/rocket.chat.tgz -C /tmp | ||
+ | |||
+ | Instalar los archivos de Rocket.Chat en /opt: | ||
+ | |||
+ | cd /tmp/bundle/programs/server && npm install | ||
+ | mv /tmp/bundle /opt/Rocket.Chat | ||
+ | |||
+ | Configurar ahora el servicio Rocket.Chat, crear el usuario específico, configurar los permisos sobre la carpeta Rocket.Chat y crear el archivo del servicio Rocket.Chat: | ||
+ | |||
+ | useradd -M rocketchat && usermod -L rocketchat | ||
+ | chown -R rocketchat:rocketchat /opt/Rocket.Chat | ||
+ | |||
+ | <code bash> | ||
+ | cat << EOF | tee -a /lib/systemd/system/rocketchat.service | ||
+ | [Unit] | ||
+ | Description=The Rocket.Chat server | ||
+ | After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target | ||
+ | [Service] | ||
+ | ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js | ||
+ | StandardOutput=syslog | ||
+ | StandardError=syslog | ||
+ | SyslogIdentifier=rocketchat | ||
+ | User=rocketchat | ||
+ | Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 ROOT_URL=http://localhost:3000/ PORT=3000 | ||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | EOF | ||
+ | </code> | ||
+ | |||
+ | Si se desea, se puede cambiar el puerto de escucha de Rocket.Chat editando el archivo del servicio y modificando en la línea correspondiente el host y el puerto para acceder a Rocket.Chat, ya que por defecto es localhost y puerto 3000: | ||
+ | |||
+ | Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 ROOT_URL=http://localhost:3000/ PORT=3000 | ||
+ | |||
+ | Finalmente, configurar el motor de almacenamiento y replicación de MongoDB, y habilitar e iniciar los servicios MongoDB y Rocket.Chat: | ||
+ | |||
+ | <code bash> | ||
+ | sed -i "s/^# engine:/ engine: mmapv1/" /etc/mongod.conf | ||
+ | sed -i "s/^#replication:/replication:\n replSetName: rs01/" /etc/mongod.conf | ||
+ | systemctl enable mongod && systemctl start mongod | ||
+ | </code> | ||
+ | |||
+ | mongo --eval "printjson(rs.initiate())" | ||
+ | |||
+ | systemctl enable rocketchat && systemctl start rocketchat | ||
+ | |||
+ | ===== Configurar Rocket.Chat ===== | ||
+ | |||
+ | Utilizando un navegador web, ingresar a la URL indicada en la configuración de Rocket.Chat (http://direccion-del-servidor:3000). | ||
+ | |||
+ | Se debe seguir los pasos de configuración para crear un usuario administrador, e ingresar los datos de su servidor y organización. | ||