Changes

From SME Server
Jump to navigationJump to search
6,007 bytes removed ,  01:49, 15 November 2021
no edit summary
Line 7: Line 7:  
==smeserver-rocketchat contrib==
 
==smeserver-rocketchat contrib==
 
{{WIP box}}
 
{{WIP box}}
This contrib aims to reduce some of the setup for rocketchat and add some flexibility with settings
+
 
 +
There is no contrib for v10 as yet. I will work on it when I have time. These are just some notes for reference.
    
==Current version==
 
==Current version==
   −
3rd March 2018
+
NA
 
  −
Rocket RPM in my repo is 0.61.2
  −
 
  −
0.61.2 is likely to be the last version that can be installed direct to CentOS 6/ Koozali SME v9.x due to node module dependency requirements
     −
I have tried to build 0.62.0 so far without success see this bug https://github.com/RocketChat/Rocket.Chat/issues/9943
+
You may be able to install from source but chances are CentOS7 will be 'too old'
 
  −
https://reetspetit.com/smeserver/6/repoview/rocketchat.html
      
Latest source is here:
 
Latest source is here:
    
https://github.com/RocketChat/Rocket.Chat/tags
 
https://github.com/RocketChat/Rocket.Chat/tags
  −
{{Note box|Latest version is 0.61.2
  −
This requires node 8.x and a prebuilt module which the RPM should install}}I am currently looking at running Rocket 0.62 on docker in CentOS 6 which I do have working using the existing local Mongo DB
  −
  −
I will post a link to a new wiki page when I have it tested further and know what I am doing with Docker
      
==Required repos==
 
==Required repos==
Line 35: Line 25:     
* [[epel]]
 
* [[epel]]
* [[Centos-sclo-rh]]
   
* [[User:ReetP|reetp]]  
 
* [[User:ReetP|reetp]]  
* [[Fws]]
     −
/sbin/e-smith/db yum_repositories set epel repository \
+
Settings
Name 'Epel - EL6' \
  −
BaseURL 'http://download.fedoraproject.org/pub/epel/6/$basearch' \
  −
MirrorList 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch' \
  −
EnableGroups no \
  −
GPGCheck yes \
  −
GPGKey http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL \
  −
Exclude perl-Razor-Agent \
  −
Visible no \
  −
status disabled
     −
  /sbin/e-smith/db yum_repositories set reetp repository \
+
  config set rocketchat service TCPPort 3000 mailPort 25 mailURL localhost access public status enabled
BaseURL http://www.reetspetit.com/smeserver/\$releasever \
  −
EnableGroups no \
  −
GPGCheck no \
  −
Name "ReetP Repo" \
  −
GPGKey http://www.reetspetit.com/RPM-GPG-KEY \
  −
Visible yes status disabled
  −
 
  −
/sbin/e-smith/db yum_repositories set centos-sclo-rh \
  −
repository Name 'Centos-RH Software collections' \
  −
BaseURL 'http://mirror.centos.org/centos/$releasever/sclo/$basearch/rh/' \
  −
EnableGroups no Visible yes status disabled
  −
 
  −
/sbin/e-smith/db yum_repositories set nodejs8 \
  −
repository Name 'Node JS 8' \
  −
BaseURL https://rpm.nodesource.com/pub_8.x/el/6/x86_64 \
  −
EnableGroups no GPGCheck no Visible yes status disabled
  −
 
  −
signal-event yum-modify
     −
yum --enablerepo=nodejs8 install nodejs nodejs-devel
  −
  −
==RocketChat 0.40+==
  −
  −
From Rocketchat 0.40 onwards you require a higher version of node than the one in the SCL repos.
  −
  −
Rocket.Chat v 60.0+ requires:
  −
node: v8.9.3
  −
npm: v5.6.0
  −
  −
This can be installed from the node repo. The following is how to check and set up node versions manually - the rpm should sort this out for you.
  −
  −
===Setup node versions:===
  −
  −
Some of this is magic (to me!) and I still don't get the local and global stuff. Be careful with paths. See NPM Usage below for more.
  −
  −
The node rpm install node to /usr/bin but the npm 'n' module will install to /usr/local/bin
  −
  −
Check the version of node in /usr/bin
  −
  −
[root@test ~]# node -v
  −
v8.9.3
  −
  −
Install n version manager:
  −
npm install -g n
  −
Install specific node version (which will go in /usr/local/bin)<syntaxhighlight>
  −
n 8.9.3
  −
</syntaxhighlight>Install the LTS version<syntaxhighlight>
  −
n lts
  −
</syntaxhighlight>List available versions<syntaxhighlight>
  −
n ls
  −
</syntaxhighlight>Install latest version of npm:
  −
npm install -g npm
  −
  −
Install specific npm version:
  −
npm install -g npm@5.6.0
  −
Show the npm version<syntaxhighlight>
  −
[root@test ~]# npm --version
  −
5.6.0
  −
</syntaxhighlight>
  −
  −
=== Install required rpms ===
  −
<syntaxhighlight>
  −
yum --enablerepo=centos-sclo-rh,epel install scl-utils rh-python34-python rh-mongodb26-mongodb rh-mongodb26-mongodb-server \
  −
GraphicsMagick
  −
</syntaxhighlight>
  −
  −
You should be able to install the smeserver-rocketchat RPM now
  −
  −
yum --enablerepo=reetp install smeserver-rocketchat
  −
  −
Don't post-upgrade yet.
  −
  −
config set rocketchat service TCPPort 3000 mailPort 25 mailURL localhost access public status enabled
  −
config set rh-mongodb26-mongod service TCPPort 27017 mongoURL localhost access private status enabled
      
  signal-event post-upgrade;signal-event reboot
 
  signal-event post-upgrade;signal-event reboot
   −
Now we should be able to install rocketchat itself - it is better to specify a version here in case a newer version breaks anything:
  −
yum --enablerepo=reetp install rocketchat-0.59.6
  −
  −
Check the progress:
  −
tailf /var/log/rocketchat.log
      
  System ➔ startup
 
  System ➔ startup
Line 162: Line 63:  
       exit<
 
       exit<
   −
Restart Rocket.Chat to be sure:
     −
service rocketchat restart
+
===Errors===
   −
You should now be able to register a new account and get a confirmation email. Check /var/log/qpsmtpd/current for any errors.
     −
If you have not set the From address you are likely to get:
+
NA
 +
   −
Mail with no From header not accepted here
+
===Apache SSL with Proxypass===
 +
{{Note box|This is still experimental and there may be issues with SSL only for the Primary iBay and Letsencrypt. You will need a minimum version of smeserver-rocketchat-0.1-5 }}
   −
===Errors===
+
It is recommended to add Letsencrypt support as detailed below (see here for my contrib https://wiki.contribs.org/Letsencrypt)
   −
If you have issues make sure you stop the rocket chat service
+
Make a copy of the ProxyPassVirtualHosts dir
   −
  service rocketchat stop
+
  cp -e /etc/e-smith/templates/etc/httpd/conf/httpd.conf/ProxyPassVirtualHosts /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/ProxyPassVirtualRocketchat
   −
Check /var/log/rocketchat.log
+
Edit this file:
   −
Try running main.js manually:<syntaxhighlight>
+
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/ProxyPassVirtualRocketchat/50Content
export PORT=3000
  −
export MAIL_URL=smtp://localhost:25
  −
export MONGO_URL=mongodb://localhost:27017/rocketchat
  −
export ROOT_URL=http://my.smeserver.net/opt/Rocket.Chat
  −
node main.js
  −
</syntaxhighlight>
     −
===SSL with Proxypass===
+
Replace the existing code with this:
{{Note box|This is still experimental and there may be issues with SSL only for the Primary iBay and Letsencrypt. You will need a minimum version of smeserver-rocketchat-0.1-5 }}
     −
It is recommended to add Letsencrypt support as detailed below (see here for my contrib https://wiki.contribs.org/Letsencrypt)
+
    ProxyPreserveHost on
 +
    SetEnv proxy-nokeepalive 1
 +
    ProxyPass /.well-known/acme-challenge/ !
 +
 +
    DocumentRoot /home/e-smith/files/ibays/Primary/html
 +
 +
    <IfModule mod_proxy_wstunnel.c>
 +
      ProxyPassMatch ^/sockjs/(.*)/websocket ws://localhost:3000/sockjs//websocket
 +
      ProxyPass /websocket ws://localhost:3000/websocket
 +
    </IfModule>
 +
 +
    ProxyPass / http://localhost:3000/
 +
    ProxyPassReverse / http://localhost:3000/
 +
 +
    <Location />
 +
        Require all granted
 +
    </Location>
 +
 +
    <Location /.well-known/acme-challenge/>
 +
        Require all granted
 +
    </Location>
   −
We need some extra settings to enable SSL with ProxyPass.
     −
Add the FWS repo:
+
Save, and then run
   −
  db yum_repositories set fws repository \
+
  signal-event webapps-update
BaseURL http://repo.firewall-services.com/centos/\$releasever \
  −
EnableGroups no GPGCheck yes \
  −
Name "Firewall Services" \
  −
GPGKey http://repo.firewall-services.com/RPM-GPG-KEY \
  −
Visible yes status disabled
     −
Update the repos:
  −
signal-event yum-modify
     −
Install proxy pass rpm:
  −
yum --enablerepo=fws install mod_proxy_wstunnel
  −
  −
Regenerate httpd.conf
  −
signal-event remoteaccess-update
      
Now we need to setup our subdomain for the reverse proxy
 
Now we need to setup our subdomain for the reverse proxy
Line 257: Line 158:  
Look for bugs :-) As the contrib is not in CVS please report them in the forum and I will try and keep an eye out.
 
Look for bugs :-) As the contrib is not in CVS please report them in the forum and I will try and keep an eye out.
   −
==Manual config of templates==
  −
expand-template /etc/rc.d/init.d/rocketchat
  −
expand-template /etc/profile.d/scls-rh-mongodb26.sh
  −
expand-template /etc/profile.d/scls-rh-python34.sh
  −
expand-template /etc/profile.d/scls-rh-java-common.sh
  −
expand-template /etc/opt/rh/rh-mongodb26/mongod.conf
  −
  −
/etc/rc.d/init.d/rocketchat start
  −
/etc/rc.d/init.d/rh-mongodb26-mongos start
  −
  −
==Mongod fails to start after reboot==
  −
  −
Sometimes it appears that mongo fails to start after a reboot.
  −
  −
I believe that this may be caused due to rocketchat being run by the forever service which means that rocketchat tries to keep running as the server shuts down despite mongod being stopped. This leaves lock files and prevents mongod from restarting properly. I think I probably need to look at the shutdown/start order of scripts.
  −
  −
A simple cure is as follows:
  −
  −
/etc/rc.d/init.d/rh-mongodb26-mongod stop
  −
  −
Remove the following files if they exist:
  −
  −
rm /var/opt/rh/rh-mongodb26/lib/mongodb/mongod.lock
  −
rm /var/opt/rh/rh-mongodb26/run/mongodb/mongod.pid
  −
  −
Restart the mongod service:
  −
  −
/etc/rc.d/init.d/rh-mongodb26-mongod start
  −
  −
Restart the rocketchat service:
  −
  −
service rocketchat restart
  −
  −
The following is simpler and appears to work:
  −
  −
service rocketchat stop
  −
/etc/rc.d/init.d/rh-mongodb26-mongod restart
  −
service rocketchat start
      
==Mongo DB examples==
 
==Mongo DB examples==
Line 391: Line 254:     
==Node usage==
 
==Node usage==
 +
 +
* This should go to a new Node page for reference
    
Use n, an extremely simple Node version manager that can be installed via npm (See http://stackoverflow.com/questions/7718313/how-to-change-to-an-older-version-of-node-js)
 
Use n, an extremely simple Node version manager that can be installed via npm (See http://stackoverflow.com/questions/7718313/how-to-change-to-an-older-version-of-node-js)
Line 442: Line 307:  
     status=enabled
 
     status=enabled
   −
rh-mongodb26-mongod=service
+
 
    TCPPort=27017
  −
    access=private
  −
    mongoURL=localhost
  −
    status=enabled
      
==Koozali SME v10==
 
==Koozali SME v10==
Line 468: Line 329:     
I'll add more later, and try and make a full contrib in due course
 
I'll add more later, and try and make a full contrib in due course
  −
===Apache===
  −
  −
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/RocketVirtualHost
  −
  −
nano /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/RocketVirtualHost/50Content
  −
  −
Paste this:
  −
  −
    ProxyPreserveHost on
  −
    SetEnv proxy-nokeepalive 1
  −
    ProxyPass /.well-known/acme-challenge/ !
  −
  −
    DocumentRoot /home/e-smith/files/ibays/Primary/html
  −
  −
    <IfModule mod_proxy_wstunnel.c>
  −
      ProxyPassMatch ^/sockjs/(.*)/websocket ws://localhost:3000/sockjs/$1/websocket
  −
      ProxyPass /websocket ws://localhost:3000/websocket
  −
    </IfModule>
  −
  −
    ProxyPass / http://localhost:3000/
  −
    ProxyPassReverse / http://localhost:3000/
  −
  −
    <Location />
  −
        Order deny,allow
  −
        Deny from all
  −
        Allow from all
  −
    </Location>
  −
  −
    <Location /.well-known/acme-challenge/>
  −
        Allow from all
  −
    </Location>
  −
  −
Save, and then run
  −
  −
signal-event webapps-update
 

Navigation menu