jailkit configuration

Discussion in 'Installation/Configuration' started by nhybgtvfr, Feb 14, 2019.

  1. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    has anyone managed to get nodejs and npm working for jailkit ssh users?

    i'm having trouble getting a working config.
    I've got close, as root, I've apt-get install nodejs and npm. and with this set in the jk_init.ini file:

    comment = NodeJS
    executables = /usr/bin/npm, /usr/bin/node, /usr/bin/nodejs, /usr/local/bin/elmi-to-json
    directories = /usr/share/npm, /usr/lib/nodejs, /usr/local/lib/node_modules

    and as the jailkitted ssh user, logged in, and run nodejs -v (returns v8.10.0) and npm -v (returns 3.5.2), (server is ubuntu 18.04)

    as this user, I've then changed to the web folder, and tried npm install to install the required additional local node modules.
    it initially had problems connecting to the registry using https, stating that it couldn't get the local issuer certificate.
    I can fix that by using the --registry option and specifying the url with an http connection, eg npm install --registry http://registry.npmjs.org/
    but then some dependencies fail because it's trying to get them from other urls, eg https://github.com/stoeffel/..... , again with unable to get the local issuer certificate. but I can find no way of changing this part to use http instead.

    I know it's not an ispconfig problem, just hoping someone has come across the issue before and can point me in the right direction.

    if I can resolve the jailkit user being able to get the local issuer certificate, that *might* fix everything.

    the customer wants more sites using nodejs and npm. I know it'll be simple if they just have their own vps, would be nice getting it working on shared hosting, especially as the big hosting companies don't seem to offer it.
  2. Chag

    Chag New Member

    How did you manage to add npm to your jailkit user ?
    I edited my /etc/jailkit/jk_init.ini to add 2 sections (python and my app), then edited the jailkit conf in system settings of ispconfig. But jailkt user still can't execute my app.
    did you do anything different or something more ?
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    for nodejs/npm, I installed them globally as root from the default OS repo using apt.

    then added the node section as it is in the opening post to jk_init.ini

    to solve the problem with getting the local issuer certificate, add the following line to the netutils section if jk_init.ini
    I've got this for python, although I don't know if anyone's actually used it, so it may not be right:

    if you're trying to get this working in an already existing jailkit you need to update the jailkit for that user as well.
    there are multiple threads on here about it, and I believe jesse norrell posted a script/instructons for updating them regularly in one of them.

Share This Page