- مراحل را درون محیط LXD دنبال خواهیم کرد.
- ابتدا سیستم را آپدیت کنید.
|
1 2 3 4 |
# apt-get update # apt-get dist-upgrade # apt autoremove # apt-get clean |
در ادامه :
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# apt-get install -y build-essential curl software-properties-common npm nginx graphicsmagick wget curl git vim # curl -sL https://deb.nodesource.com/setup_12.x | bash - # apt-get install -y nodejs # wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - # add-apt-repository 'deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse' # apt-get update # apt-get -y install mongodb-org # systemctl enable mongod.service # systemctl start mongod.service # curl -L https://releases.rocket.chat/latest/download -o rocket.chat.tgz # tar xvf rocket.chat.tgz # cd bundle/programs/server # npm install # cd ../../.. # mv bundle /opt/Rocket.Chat # useradd -M rocketchat # usermod -L rocketchat # chown -R rocketchat:rocketchat /opt/Rocket.Chat |
در ادامه :
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
cat << EOF | tee /etc/systemd/system/rocketchat.service [Unit] Description=The Rocket.Chat server After=network.target remote-fs.target nss-lookup.target mongod.target [Service] ExecStart=/usr/bin/node /opt/Rocket.Chat/main.js StandardOutput=syslog StandardError=syslog SyslogIdentifier=rocketchat User=rocketchat Environment=MONGO_URL=mongodb://localhost:27017/rocketchat ROOT_URL=http://localhost:3000/ PORT=3000 [Install] WantedBy=multi-user.target EOF |
در ادامه :
|
1 2 3 |
# systemctl daemon-reload # systemctl restart rocketchat # systemctl enable rocketchat |
در ادامه :
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
cat << EOF | tee /etc/nginx/conf.d/rocketchat.conf upstream rocket_backend { server 127.0.0.1:3000; } server { listen 80; server_name <span style="color: #ff0000;"><strong>rocketchat.example.com</strong></span>; access_log /var/log/nginx/rocketchat-access.log; error_log /var/log/nginx/rocketchat-error.log; location / { proxy_pass http://rocket_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; } } EOF |
- در ادامه
|
1 |
# nginx -t |
- در صورت عدم وجود مشکل سرویس nginx را راهاندازی مجدد کنید.
|
1 2 |
# systemctl enable nginx.service # systemctl restart nginx |