0

I have a stand-alone web app, it's an executable file. At this point it doesn't require nginx or apache in front of it because it has a built-in webserver. Where should I put it on a server? In the directory of my user? Or in /opt/something or somewhere else?

Also, it's controlled by systemd.

Oskar K.
  • 551
  • 1
  • 6
  • 18
  • Wherever you decide, it can be very useful to write a small script or makefile target that does the installation, including any chmod and so on, so you have a starting point for later re-use, or even better package it as an rpm or .deb, no matter how small it is. – meuh Apr 17 '16 at 14:10

2 Answers2

2

Traditionally, the location for this would be /usr/local (resp. /usr/local/bin if this is just one executable). See What is /usr/local/bin? and What is the difference between /opt and /usr/local? .

Guido
  • 4,114
  • actually, it has a few config files as well. – Oskar K. Apr 17 '16 at 10:56
  • Then I'd suggest /usr/local/bin for the executable, and a subdirectory /usr/local/etc/yourappname for the config files. Alternatively, executable and config files in a subdirectory /usr/local/yourappname – Guido Apr 17 '16 at 12:01
0

Since it's a packaged app, I would say opt.

My understanding is that /usr/local is more like an overlay to / whereas /opt is a place to put applications that fit in a single subdirectory.

Rolf
  • 759
  • 2
  • 8
  • 16