{"id":27743,"date":"2018-08-14T03:49:56","date_gmt":"2018-08-14T08:49:56","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=27743"},"modified":"2022-06-03T03:34:44","modified_gmt":"2022-06-03T08:34:44","slug":"how-to-install-rocket-chat-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-rocket-chat-on-centos-7\/","title":{"rendered":"How to Install Rocket.Chat on CentOS 7"},"content":{"rendered":"
<\/p>\n
In this article we will show you how to install Rocket.Chat on\u00a0a\u00a0CentOS 7<\/a>\u00a0server and configure Apache as reverse proxy for the Rocket.Chat application. Rocket.Chat is a free team communication software, built with Meteor framework. Rocket.Chat is unlimited and open source software solution that replaces Slack and HipChat. Rocket.Chat supports audio and video communication with screen sharing, with complete access to the source code, you can fully customize, extend or add new functionality to meet your requirements.\u00a0The Installation of Rocket.Chat on CentOS 7 is fairly easy task and it shouldn’t take more then 10 minutes to complete. Let’s get started! In order to run Rocket.Chat on your CentOS 7 VPS, we need the following requirements pre-installed:<\/p>\n MongoDB<\/a> – most popular open source\u00a0NoSQL\u00a0database<\/p>\n NodeJS<\/a> – an open source\u00a0JavaScript run-time environment.<\/p>\n GraphicsMagick<\/a> –\u00a0a robust collection of tools and libraries about image processing. GraphicsMagick is a fork of ImageMagick.<\/p>\n Log in to each VPS via SSH as user root<\/p>\n Once you are logged, run the following command to make sure that all installed RPM packages are up to date<\/p>\n We need to install EPEL\u00a0repository:<\/p>\n The default CentOS 7 repository does not contain a package for MongoDB, so we will need to use the official MongoDB repository to install MongoDB package.<\/p>\n At the time of writing this tutorial, the latest stable version of MongoDB is 4.0, so create a new file in the \/etc\/yum.repos.d\/ directory named ‘mongodb-org-4.0.repo’:<\/p>\n Then, add the following lines:<\/p>\n Install MongoDB using the following commands:<\/p>\n Enable the MongoDB service to start automatically on boot:<\/p>\n Start the MongoDB service:<\/p>\n Download and set nodejs version 8.9.3:<\/p>\n Check the node.js version:<\/p>\n Install GraphicsMagick using the following command:<\/p>\n Download the latest stable version of Rocket.Chat and extract it in the \/opt directory on your server:<\/p>\n Run the following command to test the installation:<\/p>\n You should be able to access Rocket.Chat at http:\/\/your-domain.com:3000\/ We can configure Apache as reverse proxy so it can handle and pass the requests to Rocket.Chat and hide the port number in the URL.<\/p>\n Edit the ‘\/etc\/httpd\/conf\/httpd.conf’ Apache configuration file and uncomment the following line:<\/p>\n Then, add the following virtual host at the end:<\/p>\n Make sure the mod_proxy module is enabled and restart the Apache service for the changes to take effect using the following command:<\/p>\n Create a new systemd service:<\/p>\n Add the following lines:<\/p>\n Do not forget to replace ‘your-domain.com’ with the actual domain name.<\/p>\n Enable the Rocket.Chat service to start automatically on boot:<\/p>\n Start the Rocke.Chat service:<\/p>\n Open your favorite web browser and access the Rocket.Chat application by opening http:\/\/your-domain.com . Create a new<\/p>\n admin account and click on ‘Continue’ button. On the next page, enter the organization information, on the next page select ‘keep standalone’,\u00a0 and on the last page, click on ‘Go to your workspace’ button. Then, log in to Rocket.Chat with the newly created admin account, create new members and channels, manage their permissions, and customize Rocket.Chat according to your needs. Also, Rocket.Chat provides an extendable Webhook integration framework, so we can integrate Rocket.Chat with many other applications, through incoming and outgoing Webhook scripts.<\/p>\n <\/p>\n That is it. Rocket.Chat has been successfully installed on your CentOS 7 VPS.<\/p>\n Of course, you don\u2019t have to install Rocket.Chat on CentOS 7, if you use one of our Managed CentOS Hosting<\/a> plans, in which case you can simply ask our expert Linux admins to install Rocket.Chat on CentOS 7 for you. They are available 24\u00d77 and will take care of your request immediately. For additional updates, you can also check our guide on How to Install Rocket.Chat on CentOS 8<\/a>.<\/p>\n PS<\/strong><\/span>. If you liked this post on how to install Rocket.Chat on CentOS 7, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this article we will show you how to install Rocket.Chat on\u00a0a\u00a0CentOS 7\u00a0server and configure Apache as reverse proxy for … <\/p>\n
\n<\/p>\nRequirements<\/strong><\/h3>\n
Step 1: Log in via SSH on the CentOS server:
\n<\/strong><\/h3>\nssh roo@IP_Address -p Port_number<\/pre>\n
Step 2: Update all packages and install Development tools<\/strong><\/h3>\n
sudo yum clean all\nsudo yum update\nsudo yum groupinstall \u2018Development Tools'<\/pre>\n
Step 3: Install EPEL and MongoDB repositories:<\/strong><\/h3>\n
yum install epel-release<\/pre>\n
vi \/etc\/yum.repos.d\/mongodb-org-4.0.repo<\/pre>\n
[mongodb-org-4.0]\nname=MongoDB Repository\nbaseurl=https:\/\/repo.mongodb.org\/yum\/redhat\/$releasever\/mongodb-org\/4.0\/x86_64\/\ngpgcheck=1\nenabled=1\ngpgkey=https:\/\/www.mongodb.org\/static\/pgp\/server-4.0.asc<\/pre>\n
Step 4: <\/strong>Install MongoDB<\/h3>\n
sudo yum update\nsudo yum install mongodb-org-server mongodb-org mongodb-org-mongos mongodb-org-shell mongodb-org-tools<\/pre>\n
sudo systemctl enable mongod<\/pre>\n
sudo systemctl start mongod<\/pre>\n
Step 5:\u00a0<\/strong>Install node.js and npm<\/h3>\n
sudo yum install nodejs npm<\/pre>\n
npm install -g inherits n<\/pre>\n
sudo n 8.9.3<\/pre>\n
# node --version\nv8.9.3<\/pre>\n
Step 6: <\/strong>Install GraphicsMagick<\/h3>\n
yum install GraphicsMagick<\/pre>\n
Step 7: <\/strong>Install Rocket.Chat<\/h3>\n
cd \/opt\ncurl -L https:\/\/releases.rocket.chat\/latest\/download -o rocket.chat.tar\ntar -xvf rocket.chat.tar\nmkdir -p \/var\/www\/html\/rocket.chat\ncd bundle\nmv * .[^.]* \/var\/www\/html\/rocket.chat\/\ncd \/var\/www\/html\/rocket.chat\/programs\/server\nnpm install\ncd ..\/..\/\nexport ROOT_URL=http:\/\/your-server_IP:3000\/\nexport MONGO_URL=mongodb:\/\/localhost:27017\/rocketchat\nexport PORT=3000<\/pre>\n
node main.js<\/pre>\n
\nStop Rocket.Chat using CTRL+C.<\/p>\n#NameVirtualHost *:80<\/pre>\n
<VirtualHost *:80>\nServerName your-domain.com\nDocumentRoot \/var\/www\/html\/rocket.chat\nServerAlias www.your-domain.com\n\nProxyRequests Off\n<Proxy *>\nOrder deny,allow\nAllow from all\n<\/Proxy>\n\nProxyPass \/ http:\/\/your-server_IP:3000\/\nProxyPassReverse \/ http:\/\/your-server_IP:3000\/\n<Location \/>\nOrder allow,deny\nAllow from all\n<\/Location>\nErrorLog \/var\/log\/httpd\/rocket.chat-error_log\nCustomLog \/var\/log\/httpd\/rocket.chat-access_log common\n<\/VirtualHost><\/pre>\n
systemctl restart httpd\n\n<\/pre>\n
vi \/usr\/lib\/systemd\/system\/rocketchat.service<\/pre>\n
[Unit]\n Description=The Rocket.Chat server\n After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target\n [Service]\n ExecStart=\/usr\/local\/bin\/node \/var\/www\/html\/rocket.chat\/main.js\n StandardOutput=syslog\n StandardError=syslog\n SyslogIdentifier=rocketchat\n User=root\n Environment=MONGO_URL=mongodb:\/\/localhost:27017\/rocketchat ROOT_URL=http:\/\/your-domain.com:3000\/ PORT=3000\n [Install]\n WantedBy=multi-user.target<\/pre>\n
sudo systemctl enable rocketchat.service<\/pre>\n
sudo systemctl start rocketchat.service<\/pre>\n
\n