I'm looking for some information and insight into running Nodejs on my ISPConfig server running Nginx. I have multiple sites currently running from the server and I am in need of deploying a new Nuxt.js application. Firstly, will this be possible? If so what will I have to do in order to get it working correctly. Secondly will it be possible to run multiple apps and sites using node.js, simultaneously? I believe I'd have to do a reverse proxy but honestly I'm unsure. Any help and guidance on this matter will be greatly appreciated.
I don't know about nginx, never really used it. but multiple websites running nodejs shouldn't be a problem. doing that with ispconfig on apache with no problems. I just install composer, nodejs and npm as root using apt, (everyone wanting nodejs/npm so far has always wanted composer as well) and make them available in jailkit. so ssh users can use them however they want. add to /etc/jailkit/jk_init.ini Code: [node] 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 [composer] comment = composer executables = /usr/bin/composer directories = /usr/share/doc/composer then just add composer and nodejs to the jailkit app list in the ispconfig server config area, and create the ssh user or update existing jailkit. I've never had to do anything with apache to allow any nodejs/npm stuff to work, but as I've already said, I don't know anything about nginx, so someone else will have to say if anything needs to be done there.
Great Stuff, thank you for the detailed reply and information. Finally getting around to implementing this on my server, so fingers crossed its as straight forward on nginx as it is on apache.
Hello, I followed these steps and now I have the problem that I get the following error message when I do an "npm -v" in the jailed environment. internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module 'semver' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/usr/share/npm/lib/utils/unsupported.js:2:14) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) I'm running ubuntu 20.04 and my jk_init section looks as follows Code: [node] comment = NodeJS executables = /usr/bin/npm, /usr/bin/node, /usr/bin/nodejs, /usr/bin/semver directories = /usr/share/npm, /usr/share/nodejs, /usr/share/node-mime, /usr/lib/nodejs
yeah, i've noticed the same thing on 20.04 and using ispconfig 3.2.* not sure if it's any changes in nodejs/npm packages and file/folder locations, or any differences in the newer jailkit init config. not got anyone actively using npm at the moment and i've got other things i need to work on, so trying to work out this issue hasn't been a priority for me.
not anything that i've had a chance to try yet. everything i've looked at suggests uninstalling / purging node and npm and re-installing..
I have spend quite some time looking into this today. This seems to work, but I have not got it to work fully: - move /usr/share/nodejs/npm/node_modules/* to /usr/local/lib/node_modules/ - symlink /usr/share/nodejs/npm/node_modules to /usr/local/lib/node_modules - jk_update, then jk_init the jail But now I am looking at another error, I suspect because the NPM version in the Debian repo is out-of-date, but I'm not sure...
Hi all I faced the same issue, and came to the conclusion that it is only a problem with the node version installed with ubuntu 20.04. If you just follow this guide: https://senormedia.com/install-node-and-npm-debian-buster-10-ispconfig-jailkit/ (I took the latest version setup_14 - not lts. then everything works fine in jails... Maybe this helps you.
Those sections now exist by default in the jailkit init file, but are not added to the jails by default. They are needed if you want to use them from a jail of course.
Dear Thom, could you recommend me some decent literature about Jails? As we know, i am originally russian... and it's much actual for the country at the moment
Okay, just original documentation... As i see, for my user, which belongs to the website, was created jk_lsh.ini at /var/www/websites/client0/domain1/etc/jailkit But inside of it everything is commented-out: Code: ## example for a user #[test] #paths= /usr/lib/ #executables= /usr/lib/sftp-server #allow_word_expansion = 0 #umask = 002 # ##example for a group, there should be only 1 space inbetween the words! #[group users] #paths = /usr/bin #executables = /usr/bin/cvs #allow_word_expansion = 0 #environment= HELIX_PATH=/opt/RealPlayer/, TMP=/tmp/ And have you noticed, subdomains are invisible to a user, which was placed to Chroot Shell - Jailkit? and chroot() is just the procedure or function - written on C and enabled to all unix-like systems - to change root directory, nothing else, am i right? - we change a default directory and make limitations to the used services Can you help me with that? Do you think, it depends on the jail or not?