Struggling with deploying Node Express app

#1
Hi,

I am very new to hosting and purchased a VPS to host a 1 page Node website. This will expand in time to a full website.

In the meantime I have been trying to get this hosted for over 1 month now and am really getting frustrated. I initially had a VPS setup with Ubuntu and Cyberpanel with Openlitespeed.

I felt that it was too much and overcomplicating this so I decided to stick with just an Ubuntu VPS with Openlitespeed and Node.

But I am still really struggling!

I have tried to use the instructions here: https://openlitespeed.org/kb/running-node-js-apps-with-openlitespeed/ to adapt to how to deploy my website but nothing. Also tried following these instructions to setup https://openlitespeed.org/kb/setting-up-name-based-virtual-hosting-on-openlitespeed/ but still nothing.

I also tried editing the 'Example' virtual host and upload my files to that structure but when I visit my domain, the page just loads and loads until it timesout.

I think it may be to do with the locations of my directories but I am absolutely lost on this.

My 'app.js' file only contains the settings and config for the app. My routes (only 1 for now) are stored in a separate folder so not sure if it could be that.

Here is my app folder structure:
1685471909030.png

Any help would be greatly appreciated. If let's say I take the already created 'Example' virtual host, which of my files do I place in which of the already created directories on the VPS server?

Thanks,
Jerry
 
#3
Hi @Cold-Egg thanks for your reply. The issue isn't whether Node works or not. When I setup my VPS with Openlitespeed, I assigned my domain during startup and when I visit my domain, it does display the "Hello World" text from the already created 'Example' virtual host on my Openlitespeed console:

1685552714773.png

I think the issue is where I should place my folder and file structure that I have (screenshot appears in my post above) and getting the correct Document Root locations correct but I have tried everything but somehow doesn't like my setup.

When I upload my files and then run 'node app.js' in the terminal, it does appear to run but just doesn't show on my browser.

Anyway, I will give your link a go but like I said, Node seems to be running fine with the sample virtual host. It's just when I try and upload my folders is where things don't work.
 
#7
i'm really sorry, im new to VPS, what do you mean launching OpenLiteSpeed NodeJS from server? The I installed an ubuntu distribution with NodeJS already installed in it. I use PuTTY to get into the server.

I really apreciate the time that you are taking to answer me.
 
#8
Any help would be greatly appreciated.
the disk image with Node JS installed is available on different cloud portals

(the truth is where I am, the release date of the image is 2020/12/24)

You need to look carefully from the inside. And maybe there will be fewer questions. (I'm considering another disk image this way) here's a list of them.

https://marketplace.alibabacloud.com/store/3246085.html
2023-10-15_16-08-38.png

i'm really sorry, im new to VPS, what do you mean launching OpenLiteSpeed NodeJS from server? The I installed an ubuntu distribution with NodeJS already installed in it. I use PuTTY to get into the server.

I really apreciate the time that you are taking to answer me.
What is the server in your VPS system ? -

- openlitespeed
--nginx
- apache

Or show the link where did you get the finished image from ?

I wanted to set up several wordpress and NodeJS on my VPS . I'm reading now - so that I don't have to ask too much yet because I'm new to this field.
 
Last edited:
Top