Hi i try to setup IM Chat in a new cloud server with Ubuntu. i follow the tutorial here all when good until i run the last command (node index.js) to start the Node.js server.

node index.js


/im/server/index.js:13         throw new Error('privateKey not found.')         ^

Error: privateKey not found.     at Object. (/im/server/index.js:13:15)     at Module._compile (module.js:652:30)     at Object.Module._extensions..js (module.js:663:10)     at Module.load (module.js:565:32)     at tryModuleLoad (module.js:505:12)     at Function.Module._load (module.js:497:3)     at Function.Module.runMain (module.js:693:10)     at startup (bootstrap_node.js:188:16)     at bootstrap_node.js:609:3

this is my settings in config.js

module.exports = {     port: 3000,     is_hosted: false,     chat_server_key: "stringkey_blabla",     secure: true, // use ssl ?     privateKey: "./opt/psa/var/modules/letsencrypt/etc/archive/mydomain.com/privkey.pem", // path to private key ?     cert: "./opt/psa/var/modules/letsencrypt/etc/live/mydomain.com/cert.pem",  // path to cert key ?     firebase: {         serverKey: "",         senderId: ""     },     redis: {         host: 'my.host.I.P',         port: 6379,         password: 'my_host_password'     } };

i use plesk panel with Lets Encrypt for certificate, is that could be the problem that my certificate form is in *.pem and not in *.crt  ????

Instant Messaging Settings

Provide your Node JS server: http://my.host.I.P:3000
Provide your Node JS server key: stringkey_blabla

Last update on July 15, 2019 by Hellas.
Be the first person to like this.

Hi Hellas,

Could you please submit a ticket to get the support from PHPFox? 




Be the first person to like this.
Paul Kellow

Hi Hellas,

According to the error message, I can see that the config for the private key is wrong. Perhaps it is having redundant dot "." at the beginning. You can remove to remove the dot.

Anyway, you can contact your hosting provider for help to get the correct path of SSL certs and private key.

Be the first person to like this.

Hi YouNetCo Thank you for the respont i have submit a ticket...

------------------------------------------------------- -------------------------------------

Hi Paul Kellow 

i have remove the dot and is not help i have the same output error message and the path of my private key is correct...

Only one question.. the path of private key is for my domain server ore for my cloud?? 

i use my domain server private key path

Be the first person to like this.
Paul Kellow

That's correct. You will need to configure the correct path to the SSL files ( cert and private key ) of your domain. Please also make sure that these files can be read by the webserver user.

Be the first person to like this.

ok Paul Kellow thank for the advice i will giv a try...

Be the first person to like this.