/opt/Rocket.Chat/
https://your_host.com/rocketchat/
(SSL を利用する)$ wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo apt-key add - $ echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list $ sudo apt update $ sudo apt install build-essential mongodb-org nodejs graphicsmagick
$ sudo sed -i "s/^# engine:/ engine: mmapv1/" /etc/mongod.conf $ sudo sed -i "s/^#replication:/replication:\n replSetName: rs01/" /etc/mongod.conf $ sudo systemctl enable mongod && sudo systemctl start mongod $ sudo systemctl enable mongod && sudo systemctl start mongod
$ sudo apt install nodejs npm $ sudo npm install n -g $ sudo n 8.11.4 $ sudo apt purge -y nodejs npm $ exec $SHELL -l
$ sudo apt install curl
$ curl -L https://releases.rocket.chat/latest/download -o /tmp/rocket.chat.tgz $ tar -xzf /tmp/rocket.chat.tgz -C /tmp $ cd /tmp/bundle/programs/server && npm install $ sudo mv /tmp/bundle /opt/Rocket.Chat
$ sudo useradd -M rocketchat && sudo usermod -L rocketchat $ sudo chown -R rocketchat:rocketchat /opt/Rocket.Chat $ cat << EOF |sudo 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=https://example.com/rocketchat/ PORT=3100 [Install] WantedBy=multi-user.target EOF
ROOT_URL=https://example.com/rocketchat/
ROOT_URL=http://127.0.0.1:3100
$ sudo sed -i "s/^# engine:/ engine: mmapv1/" /etc/mongod.conf $sudo sed -i "s/^#replication:/replication:\n replSetName: rs01/" /etc/mongod.conf $ sudo systemctl enable mongod && sudo systemctl start mongod $ sudo systemctl enable mongod && sudo systemctl start mongod
$ sudo apt install nginx
/etc/nginx/sites-available/default
を編集する)。: : server { listen 443 ssl; listen [::]:443; server_tokens off; client_max_body_size 200M; ssl on; ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don't use SSLv3 ref: POODLE ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; : : # RocketChat location /rocketchat { proxy_pass http://127.0.0.1:3100; 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; } : : }
$ sudo systemctl restart nginx
$ sudo systemctl enable rocketchat && sudo systemctl start rocketchat