Last active
February 9, 2017 08:17
-
-
Save timaschew/1a1f54afc358ce94c848085f35753151 to your computer and use it in GitHub Desktop.
rocketchat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org curl graphicsmagick | |
{ | |
"info2" : "no configuration explicitly specified -- making one", | |
"me" : "localhost:27017", | |
"info" : "Config now saved locally. Should come online in about a minute.", | |
"ok" : 1 | |
} | |
export MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=001-rs | |
curl -L https://rocket.chat/releases/latest/download -o rocket.chat.tgz | |
mv bundle Rocket.Chat | |
cd Rocket.Chat/programs/server | |
npm install | |
cd ../.. | |
export ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000/ | |
export MONGO_URL=mongodb://localhost:27017/rocketchat | |
export PORT=3000 | |
node main.js | |
export MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=001-rs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Upstreams | |
upstream backend { | |
server 127.0.0.1:3000; | |
} | |
# HTTPS Server | |
server { | |
listen 443; | |
server_name your_hostname.com; | |
error_log /var/log/nginx/rocketchat.access.log; | |
ssl on; | |
ssl_certificate /etc/nginx/certificate.crt; | |
ssl_certificate_key /etc/nginx/certificate.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don’t use SSLv3 ref: POODLE | |
location / { | |
proxy_pass http://backend/; | |
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment