I'm running 4 separate Node.js apps on a Linux server with different ports and a proxy in front.
As I'm (right now) the only user in the server, it doesn't matter where I place the apps and how to run them. Currently my apps stay under my home directory (~/app1/
, ~/app2/
, etc.).
So my question is: where should I place the apps so that they can be shared between multiple users? Is there a standard place similar to /var/www
?
Introduction. Node. js is an open-source JavaScript runtime environment for building server-side and networking applications. The platform runs on Linux, macOS, FreeBSD, and Windows.
STEP 1: Go to https://www.heroku.com/ and register. Before Proceeding any further, make sure you have installed the latest version of Git on your PC. STEP 3: Go to Getting Started on Heroku with Node. js and download the Heroku Cli for your system.
I use https://github.com/visionmedia/deploy to deploy my apps. It will create a /var/www/productname
directory. Inside that directory you have source, current and shared. The shared directory has the log
and pid
files.
I found that a good directory structure so that's what I am using for all my projects.
I run Apache in addition to Node.js on the same server, so I don't really like having applications for Apache and Node.js in the same directory. My Apache hosted applications go in the traditional /var/www/ path, and I put my Node.JS applications under /var/node/. This is due to some automation I have setup in both Apache (Dynamic Virtual Hosts) and Node.JS.
More information on my setup and automating Proxy and Apache deployment can be found here: How to use vhosts alongside node-http-proxy?
If you are using AWS Elastic beans stack for Node JS application on Linux server, then it should be there in /var/app/current/
directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With