Skip to main content

Node Messaging Server Setup

Use the same SSL certificates for the webservers. Privkey is obtained from the .domain.key file; fullchain is obtained from the .domain.crt file (not the issuer file). 

Convert them to PEM format using the following:

openssl x509 -in /opt/bitnami/letsencrypt/certificates/_.desertedchateau.com.crt -out /opt/bitnami/letsencrypt/node-server-certs/fullchain.pem -outform PEM
openssl ec -in /opt/bitnami/letsencrypt/certificates/_.desertedchateau.com.key -out /opt/bitnami/letsencrypt/node-server-certs/privkey.pem -outform PEM
cp /opt/bitnami/letsencrypt/certificates/_.desertedchateau.com.json /opt/bitnami/letsencrypt/node-server-certs/_.desertedchateau.com.json

If needed, change ownership and permissions:

chown -R root:root /opt/bitnami/letsencrypt/node-server-certs/
chmod -R 755 /opt/bitnami/letsencrypt/node-server-certs/

Add IP address of the Node server to the VPC security group, allowing port 6379 for Redis access

Install nodemon (requires root privileges). Log out from root afterwards.

sudo su
npm install -g nodemon
exit

Restart Apache to ensure it is using the correct certificates:

sudo /opt/bitnami/ctlscript.sh restart apache

Start the node server:

cd /opt/bitnami/apache/htdocs/
nohup nodemon -I public/index.js > nohup.out 2>&1 &