title: Where to install GlassFish on Linux?
body: <p><strong>DISCLAIMER:</strong> I'm relatively new to Linux. I debated putting this on SuperUser or ServerFault because the answer <em>does</em> require an explanation of Linux as a system (and not a specific programming problem), however I'm interested in this from a Java developer's perspective, and I argue that this is a specific problem because where I install GlassFish greatly impacts my Java configuration, and ultimately, app configuration. Not to mention posting this question on those other sites probably won't garnish any attention from a Java developer, more over system admins, who may not know enough about Java to weigh-in fully on this decision.</p>
  
  <p>I'm trying to decide where to install GlassFish and it seems to me I have (realistically) 4 viable options:</p>
  
  <ul>
  <li><code>/opt/glassfish/</code></li>
  <li><code>/usr/local/glassfish/</code></li>
  <li><code>/home/myUsers/glassfish/</code> (which is what all the OGS docs show in their examples)</li>
  <li><code>/home/ogs/glassfish</code> (as its own user, similar to how Apache web server is sometimes setup)</li>
  </ul>
  
  <p>I'm wondering what the pros (taking into consideration the nature of how Linux treats these directories differently, the FHS, etc.) and cons of each approach are.</p>
  
  <p>I've read that there are mounting/paritioning benefits to installing it under <code>opt/</code>. However, I normally install 3rd party software to <code>usr/local/</code>, so I'm a little unsure about that as a strategy.</p>
  
  <p>The Oracle GlassFish Server (OGS) docs all demonstrate (but never outright recommend) GlassFish being installed under your home directory (<code>home/myUser/</code>).</p>
  
  <p>Then again, I've read that it is fairly common to install daemon-type services (which is what I would <em>imagine</em> I would be using GlassFish as - where I start it once and it only comes down for routine maintenance or crashes) as their own user (<code>home/ogs/glassfish/</code>).</p>
  
  <p>I'm <strong>sure</strong> this decision is also impacted by how I'm going to use GlassFish, so let me qualify this question with a few constraints:</p>
  
  <ul>
  <li>I intend to deploy 4 OGS instances across 4 VMs on the same physical machine and cluster them into the same domain (1 of the 4 server instances will be the admin server for the domain)</li>
  <li>Several applications will be deployed to this cluster (all 3 non-admin nodes) at the same time, and should be running 24/7/365 except for when they crash (hopefully not often!) or when I need to maintenance or tune them</li>
  <li>Each application will be farily large and I would like to configure them with <strong>real admin</strong>, not "bare bones" de minimis, default settings</li>
  </ul>
  
  <p>If these don't provide specific-enough information to help make this choice, please ask and I can be more specific.</p>
  
  <p>I guess, when the dust settles at the end of the day, I'm looking (more or less) for a matrix with each of the four directory options (plus any other obvious ones I've omitted) compared against their respective pros &amp; cons.</p>