0

/etc?

/srv?

/home?

Apps in these languages shouldn't be under document root (which, in my opinion, goes under /srv/www). But, otherwise, I can't think of a location/scheme that's best practice to store them.

Ideas?

eastydude5
  • 103
  • 1

2 Answers2

1

Somewhere under /srv. Unless their package installs them somewhere else, in which case the configuration should still be under /srv.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • But /srv/www should be document root for the web server, no? And /srv/ should be organized by protocol, ideally, right? (/srv/www, /srv/ftp, etc). – eastydude5 Jun 06 '11 at 20:21
  • There is no fixed organization for `/srv`. Even the [FHS](http://www.pathname.com/fhs/pub/fhs-2.3.html#SRVDATAFORSERVICESPROVIDEDBYSYSTEM) admits this. – Ignacio Vazquez-Abrams Jun 06 '11 at 20:22
  • /srv is for data. /opt is for software packages. – Rik Schneider Jun 06 '11 at 20:57
  • 1
    Honestly... that's 100% a matter of preference. Each platform has their own recommended best practices. Some suggest /var/www/{engine}/{application} others suggest /www... and even others would suggest creating user accounts for each customer (or application) and placing the application inside the users' home directory... i.e. /home/customer/application It's really mostly a matter of picking a standard across your environment and sticking with it. – TheCompWiz Jun 06 '11 at 21:07
0

I would put them in /opt/. The is what the standard implies in the FHS document.

There are still 2 schools of thought about this.

The first will use /opt the same way many distributions use /usr, putting application scripts under under /usr/share and the libraries in /usr/lib. The paths in this case will be /opt/bin, /opt/lib, and /opt/share.

The second will put each app in its own directory. You will end up with /opt/app1/bin, /opt/app1/lib, /opt/app1/share, /opt/app2/bin,/opt/app2/lib/ etcetera.

You can do this as a hybrid with the apps installed in /opt/app-name and sym links in /opt/share, opt/lib, etcetera pointing at the files in the application path.

It doesn't really matter which you choose as long as you document it and stick with it.

Ideally you would document the choice as in your configuration management tool, in your documentation, and in policy.

Take Care, Rik

Rik Schneider
  • 2,479
  • 14
  • 19