Where is the conventionally accepted location of node.js/express web apps, in a linux file system?
Currently I've got a subdirectory in
/opt/ but I'd like to hear other people's view on this...
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
/opt directory is a good location for the program distribution files. The
/srv directory is used for the programs run-time data. (Please see the Filesystem Hierarchy Standard.) Unlike the
/etc directory where the standard indicates that the
/opt/<pkg> configuration files should be placed in
/etc/opt/<pkg>, there is no standardization that
/srv/opt/<pkg> should be a parallel structure (although it's probably not a bad idea).
/opt/webserver/ (your node.js application) server.js package.json node_modules/ ... /etc/opt/webserver/ config.json (configuration file for your web server) /srv/opt/webserver/ (opt subdirectory suggested, but not required) index.html images/ css/ ... /var/opt/webserver error.log request.log
Please keep in mind that this is the general case, and is not unique to express applicaitons.
The most appropriate place would be under