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.
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