Hello Community, Please I need your help to make n8n run on a subdomain managed by Plesk Obsidian Panel.
I Folowed this documentation how is run with node index.js possible? · Issue #9 · n8n-io/n8n · GitHub
But unfortonly it did not work with me , I dont know if I did a mistake or no ! But i will tell you
what I did exactly and I hope you help to resolve the problem!
So I started from scratch by creating new VPS on Digitalocean.
1) I start by creating fresh Droplet (Debian 9 64bit).
2) I Installed New Plesk Obsidian 18.0 on the VPS. (Via SSH)
3) Using Plesk I added the main Domain (besthotelguides . com).
4) I Created subdomain (n8n . besthotelguides . com) Using Plesk.
5) I Installed SSL on both ; Main Domain and Subdomain.
6) I Installed Nodejs from (Plesk tools->update->Add New Component).
Plesk 18 Already has the NodeJs v 12.4.0 Like used on the documentation of @sutidor
7) I disabled PHP & FastCGI of the subdomain from the Hosting Setting of Plesk Panel.
8) I created New MySql Database n8n (I pass the PostgreSql Installation because I try 5 Time installing it and no Result , So I decide in the new VPS to use MySql, because I read that lastest version of n8n is compatible with MAriaDB/MySql)
9) Via SSH and folowing the documentation
9.1) cd /var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/
9.2) npm init --yes
here i got an error (-bash: npm: command not found)
So I fix it By Installing npm with those commands:
9.2.1) curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
9.2.2) apt-get update && sudo apt-get install yarn
9.2.3) apt-get install nodejs npm
9.2.4) npm -v
and the result is 6.14.4. so here npm is installed.
Backing to the step 9.2 executing the command npm init --yes
and the result is :
{
"name": "n8n.besthotelguides.com",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
9.3) npm install n8n
After excuting this command this is the result
`npm WARN deprecated [email protected]: This version of pg-promise is obsolete. You should update to a newer version.
> [email protected] install /var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/node_modules/mmmagic
> node-gyp rebuild
make: Entering directory '/var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/node_modules/mmmagic/build'
CC(target) Release/obj.target/libmagic/deps/libmagic/src/apprentice.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/apptype.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/ascmagic.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/cdf.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/cdf_time.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/compress.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/der.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/encoding.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/fsmagic.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/funcs.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/is_tar.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/magic.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/print.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/readcdf.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/readelf.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/softmagic.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/fmtcheck.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/strlcat.o
CC(target) Release/obj.target/libmagic/deps/libmagic/src/strlcpy.o
AR(target) Release/obj.target/deps/libmagic/magic.a
COPY Release/magic.a
CXX(target) Release/obj.target/magic/src/binding.o
SOLINK_MODULE(target) Release/obj.target/magic.node
COPY Release/magic.node
make: Leaving directory '/var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/node_modules/mmmagic/build'
> [email protected] install /var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
[sqlite3] Success: "/var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node" is installed via remote
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of request@^2.34 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of request@^2.34 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
+ [email protected]
added 510 packages from 707 contributors and audited 1292 packages in 47.133s
8 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities`
9.4) executing the command npm install sqlite3 --save
and this is the result of this command
> [email protected] install /var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
[sqlite3] Success: "/var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node" is installed via remote
npm WARN [email protected] requires a peer of request@^2.34 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of request@^2.34 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
+ [email protected]
updated 1 package and audited 1389 packages in 6.606s
8 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
9.5) Fixing Permession
9.5.1) to see permessions I executed the command : cd /var/www/vhosts/besthotelguides.com/
then the command ls -l
and the result is
total 16
drwxr-xr-x 2 kais psacln 4096 Apr 28 21:28 error_docs
drwxr-x--- 3 kais psaserv 4096 Apr 28 21:29 httpdocs
drwx------ 3 kais root 4096 Apr 28 22:21 logs
drwxr-x--- 3 kais psaserv 4096 Apr 28 23:57 n8n.besthotelguides.com
9.5.2) executing the command : chown kais:psacln -R /var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/
9.5.3) executing the command : chown kais:psaserv /var/www/vhosts/besthotelguides.com/n8n.besthotelguides.com/
10) Adjusting NodeJS Setting From Plesk Panel
The screenshot below showing how I set the configuration and of Environnement variable
I dont know if this correct or no !
11 I disabled the Proxy Mode From the Apache/Nginx Configuration
12 I access to the new subdomain , but the App did not work
I get an erro page , of Phusion Passenger
Also, I back to check the MySQl Database and I find it empty , I dont know if environnement thati set it is valid or no, as well I dont know if I miss other commands or other steps to start n8n or only the Plesk configuration is satisfisant !!
So , Please help me how can I run n8n on a subdomain managed by Plesk Panel.
Thanks in advance .