The only information I got from Hetzner is how to install Node.js Server on my account. Installation was successful. But now I don’t know what to do next.
Hetzner sadly is one of the unique control panels I avoid like the plague, as it is different to everyone and everything else around, I will take a little look though as I have some Hetzner accounts and see if i can work it out for you.
You should place the node app outside of the public_html folder, if you place it in there then all files are accessible over the internet and they could download all the files that contain your credentials.
The public_html folder a folder from the apache/nginx server where it serves it files from, the node app has it’s own server and public folder.
Same thing as Patrick says, you need to be outside the /public_html/ folder rather.
And the restart.txt thing, im still not sure, because i finally got mine working by altering the home directory name from /app/ to /nodejsapp/ rather to avoid situations where wappler is trying to access /home/paul/app/app/api/ and now mine is working perfectly every time, however doing the exact same procedure on Brians project still has the same issue, so very strange, can not quite see how or why.
What I don’t understand is that I have to install fs-extra (npm install fs-extra) because otherwise I get an error on starting the server. Is this a known issue?
I installed Ruby once upon a time on Hetzner and also had to install an additional fs(file system) thing, so I think it is normal, as Apache automatically wants to look at the public_html directory, so the file system extra needs to bypass that as far as I know.
Oh and congratulations on getting this working.
Just that restart.txt thing we all seem to be fiddling with, except for me now, because mine suddenly works, haha.
No, it does work with index.js. I don’t get the restart.txt error if I stop my local Node.js first.
What I’m struggling at the moment is how to start the Node.js server. If I start it manually in the terminal with node index.js it works, but if I close the terminal it stops working
In cPanel it is always started, the only time I have had to do something like what you are experiencing was with docker, something like
$ docker-cloud service set — autorestart ALWAYS (name or uuid)
But with Node I have not had that issue, maybe hetzner tech support will have to answer that one because their control panel is pretty different and I imagine finding the right command may be tricky.
Edit: index.js holds this
const server = require('./lib/server');
server.start();
Which is to do with starting the Node Server, maybe just as a test duplicate index.js and rename the duplicate to app.js.
My Node server will not start without doing this.
if it’s any consolation I have the same error. FTP works OK, i can publish to the live site without problem but when saving server actions i get the same error message
Not a problem now we know what the issue is, would be nice to kill the server automatically on target switch if possible but then again it would then have to be restarted every time someone switches back to the local server
Just happy the issue was figured out, I must have spent 5 hours trying different things, felt like playing level 1228 of candy crush soda saga for 2 weeks all over again.