Help needed - nodejs and docker - Nodebb forum running in Nethserver

v7

(liviu) #1

Hello everyone,

I need some help in choosing what fits best with nethserver.

I have to host on my nethserver server a forum app. I decide to go with nodebb. Checking the requirements of nodebb it seems that i have 2 options:

Option 1: install nodejs and redis or mongodb (this is the recomended version according to nodebb)
Option 2: install docker (it seems there is a docker image for nodebb officialy supported). This one seems interesting because it seems that if i test nodebb and it doesn’t fit my needs i can use docker to install discourse, which i belive it’s the forum system used by nethserver community.

So, if anybody can give me an idea of what to choose it would be great.


(Markus Neuberger) #2

Hi @liviu,

I’d recommend the direct install way, nodejs and redis should be available at least via epel, there’s a package nethserver-redis. I recommend a VM for testing, it makes life easier, just revert to snapshot when something goes wrong…

Found some install help (nodejs is installed from source in this example but older version from epel may also fit):

Docker would be really nice but there are still some problems:


(liviu) #3

Thank you @mrmarkuz for your quick response!!! I’ll go as you recommended me.

Just one more question… Do you think that i should go with nethserver-redis or is it a better option to install redis from centos repos?


(Markus Neuberger) #4

nethserver-redis requires the redis package. It’s just to have some settings via db:

http://docs.nethserver.org/projects/nethserver-devel/en/v7/redis.html


(liviu) #5

Thank you very much @mrmarkuz! Tomorrow i’ll try and i’ll share here how it’s working in case anyone else will need to use nodebb on top of nethserver.


(liviu) #6

It looks i have a problem accesing my newly forum. I set up nethserver reverse proxy but it looks like i can’t access my forum.

I didn’t want to install nginx (is it safe to have both apache and nginx?) to use it as a reverse proxy. I used the reverse proxy from nethserver (apache… i think) and i set it up like this: in name box i wrote my domain (which is also set as a virtualhost), in the target url box i wrote “http://127.0.0.1:4567” and i also checked the ssl box.

But it looks there is at least one mistake because accesing the url in browser i only get the default nethserver page.


(liviu) #7

I tested a little more and it seems it is a problem with the reverse proxy module. It just doesn’t work. I tried to “redirect” to an expernal IP - no result. I removed the domain from the virtualhosts (including server alias) - no result.


(Stéphane de Labrusse) #8

docker will/should be the next community job, next after rspamd :slight_smile:


(liviu) #9

I managed to get my forum started. It’s working but i don’t know how to use it over ssl.
To get it running i created a reverse proxy with apache with this content:

<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName mysite.com
ServerAlias www.mysite.com
ProxyPass / http://localhost:1111/
ProxyPassReverse / http://localhost:1111/

But i don’t know how to use it over ssl. I tried to change in the file above the port with 443 but all i get is the default nethserver page but if i write the mysite.com:443 i can access my site over port 443 (of course without SSL).

So, clearly, there is something i am not doing right.

Any ideas?

UPDATE: Adding this to my conf file i am redirected to https which is of course the default nethserver page…

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://mysite.com [R,L]


(Giacomo Sanchietti) #10

You’r virtual must listen also in port 443, so replicate the whole config and for port 443:

<VirtualHost *:443>
...
</VirtualHost>


(liviu) #11

I already tried that and all i get is… this page can’t be accessed


(liviu) #12

It looks that i found a way to go with ssl (i found a tutorial on web - https://www.centosblog.com/configure-apache-https-reverse-proxy-centos-linux/) but i have one more problem. In my conf file i have to specify the path to the certificates
SSLCertificateFile /path/to/your/certificate.crt
SSLCertificateKeyFile /path/to/your/certificate.private_key
SSLCertificateChainFile /path/to/your/certificate/chainfile.crt

Going with only the two first lines i get a certificate error.

My question is: where is the location of the certificate chain file? I know it’s a silly question for you… but for me it’s not.


(Markus Neuberger) #13

The SSLCertificateChainFile directive is not used in /etc/httpd/conf.d/ssl.conf.
This should be enough:

SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

(liviu) #14

Perfect… it’s just perfect…
Big thanks to you @mrmarkuz
I was using the files on the same path but instead of localhost.crt and localhost.key i was using some other keys/certs (nsrv.crt and nsrv.key in my setup).


(liviu) #15

In order to summarize. NodeBB works just fine with nethserver.

Nodebb requires redis and nodejs. Both are or can be installed in nethserver via epel. @mrmarkuz gave a link with the instructions above. Anybody who wants just follow that tutorial except for 2 things:

  1. Don’t install forever because it will make your nodebb crash (If you don’t install forever after each restart of your server you will have to start nodebb manually or you could use this tutorial https://hostpresto.com/community/tutorials/how-to-install-nodebb-forum-on-centos-7/ to have nodebb run as a service - i didn’t try this so i don’t know if it works or not).
  2. In the final step, when you must configure nodebb, in the field of the URL used to access NodeBB, you must write the actual domain of your nodebb (http://yourdomain.yourtld:4567).

The next thing you must do is to configure reverse proxy like in this tutorial: https://www.centosblog.com/configure-apache-https-reverse-proxy-centos-linux/ but keep in mind @mrmarkuz post about the certificates.

That should be all.


(Alessio Fattorini) #16

Would you mind wrapping all it up and writing a new howto?


(liviu) #17

Sure, I’ll do that!