So, it's a bit opinionated, but I prefer the webapp location policy from before December 2021:
Web applications which serve static and PHP files via NGINX should go in /var/www/$app
Web applications which rely on NGINX to proxy their own webserver running as a service should go in /opt, usually /opt/yunohost/$app
Supporting documentation:
/var contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.
(source : https://www.pathname.com/fhs/2.2/fhs-5.1.html)
From that phrasing, I feel no binary should be installed in there, only data file. (Remains the case of composer, I know...)
/opt is reserved for the installation of add-on application software packages.
A package to be installed in /opt must locate its static files in a separate /opt/ directory tree, where is a name that describes the software package.
If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app".
If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app"
So, it's a bit opinionated, but I prefer the webapp location policy from before December 2021:
/var/www/$app
/opt
, usually/opt/yunohost/$app
Supporting documentation:
(source : https://www.pathname.com/fhs/2.2/fhs-5.1.html) From that phrasing, I feel no binary should be installed in there, only data file. (Remains the case of
composer
, I know...)(source: https://www.pathname.com/fhs/2.2/fhs-3.12.html) "add-on application software packages" being a verbose way of saying non-system, user-installed software.
(source: our own
example_ynh
https://github.com/YunoHost/example_ynh/blob/master/scripts/install#L59-L60)This may be thrown out in the future, especially if we move to storing all apps in a dedicated
.../yunohost
directory.