Operating System - HP-UX
1832396 Members
3297 Online
110041 Solutions
New Discussion

Best Location for Applications

 
SOLVED
Go to solution
Jane Lecian
Valued Contributor

Best Location for Applications

I am setting up a new system (11.0), and, seeing as I like things neat, I am wondering about the best locations for the application software I am installing. (These are applications that all users of the system should be able to run.) I would like to put all of them in /opt. Most programs that I am installing agree with me, and put themselves in /opt, but I have run across a few applications that don't agree. As an example, one commerical applicaton wants to go in /usr/local. Could I be causing myself future trouble by over-riding a software default installation point, and choosing /opt instead?

Also I am wondering about the best location to put links to the executables so that users can run the programs conveniently. Some programs want to create links in /usr/local/bin while others use /usr/contrib/bin. I have noticed that /usr/local/bin in not in the default /etc/PATH that is created with a new installation. Is it better to add /usr/local/bin to /etc/PATH or force all applications to use /usr/contrib/bin? On a related issue, some applications don't set up links to executables at all. Is it better to add the path to the program to /etc/PATH or create a link to the executable in /usr/contrib/bin? Unfortunately the installation instructions that came with the software don't provide any guidance.

Thank you for your help,

Jane
9 REPLIES 9
Krishna Prasad
Trusted Contributor

Re: Best Location for Applications

I would create a new volume group, new logical volume, new filesystem, new directory and install in something like /app/oracle or /"software name"
Positive Results requires Positive Thinking
Mark Vollmers
Esteemed Contributor

Re: Best Location for Applications

Jane-

Concerning the links, you can always accept the default and move them to what you want, or just override the defaults. the links shouldn't affect anything with the program, as long as the permissions are correct.

As far as I know, you can override the default locations without problems. I have pulled a few programs out (where the software wanted to use /opt but I wanted it in /home due to space) without problems. You might end up with more folders, though (the cifs server, which is samba, wants to be in /var, but samba likes /opt, so I have paths that now read like /etc/opt/....). Doesn't affect my performance at all.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Sandip Ghosh
Honored Contributor

Re: Best Location for Applications

Hi Jane,

I would create a bigger filesystem and mount it on some directory under /opt, say app. So it will not effect /opt filesystem and you will get all the application under /opt/app.

Sandip
Good Luck!!!
harry d brown jr
Honored Contributor

Re: Best Location for Applications

We put all applications on /opt/appl, their logs on /var/appl, and they are seperate mounted filesystems.

Rule of good unix admins := keep all NON-root out of VG00, where NON-root means things that are really applications and data.

live free or die
harry
Live Free or Die
S.K. Chan
Honored Contributor

Re: Best Location for Applications

As an example, one commerical applicaton wants to go in /usr/local. Could I be causing myself future trouble by over-riding a software default installation point, and choosing /opt instead?
==> I guess my question is when you install the application, does it gives you the option to install it in other location ? If the answer is yes, then you would be fine. If the application is well written it would capture the installation $HOME and would know how to setup the correct variable during install. A good thing to do (in my opinion) if you want to maintain consistency (ie all apps should be in /opt), you can create a symlink from /opt/appsA to say /usr/local/appsA, to handle cases whereby the appilication has to be loaded in /usr/local.
Ralph Grothe
Honored Contributor
Solution

Re: Best Location for Applications

I cannot tell what's the *best* directory for applications, but only where *I* install programms that aren't part of the Unix System Resources (i.e. /usr).

For instance I install a lot of OpenSource stuff.
Since most of that comes from the FSF or is GNU (Gnu's Not Unix ;-) I usually create a separat logical volume (or even in a different volume group) that I mount under
e.g.

/dev/vg01/lvol1 /opt/gnu

Then I create subdirs for each application

mkdir /opt/gnu/openssl-0.9.6c-source

(the *source is to distinguish from precompiled versions)

And because of sometimes playing with different versions I do create symlinks
(gives you some flexibility)

e.g.
cd /opt
ln -s /opt/gnu/openssl-0.9.6-source openssl

After that I do the installation.
If it's a precompiled depot I usually read the description to find out the installation target (most times /opt/).
Whereas when I install from source I am free to chose a --prefix=/opt/ during the configure run.

Most times I would think it's legitimate to set symlinks accross filesystems.
(when the filesystems they refer to aren't mounted they just become stale)
For instance I included in /etc/PATH the /usr/local/bin, and create symlinks of binaries from /opt//bin/

For the manpages, since it would be too cumbersome to manually create all symlinks, I do the following

cd /usr/share/man
for d in /opt/*/man/man?; do cd ${d##*/}; ln -s $d/* .; cd ..; done

But you can also append the man subdirs of the applications in /etc/MANPATH
as you like.

Sometimes though, some precompiled binaries insist on being installed in distinct places (i.e. the --prefix option during their build).
Then it's probably wiser to give in ;-)

Madness, thy name is system administration
A. Clay Stephenson
Acclaimed Contributor

Re: Best Location for Applications

Hi:

/usr/local/bin was the old standard (more or less) location for applications. The new standard is /opt and I tend to install there.
For no particular reason, I do still use /usr/local/bin for utility scripts (shell, perl, awk) but it is very common to have a directory (e.g. /utils) for those. /opt does not have to be in vg00 and I suggest that you copy everything over to another filesystem in another volume group and rename the new file system as /opt. I really prefer to have a lean boot disk with /stand, /, primary swap, and /usr on it. The only things which must be on the boot disk are /stand, primary swap, and /.
If it ain't broke, I can fix that.
Jane Lecian
Valued Contributor

Re: Best Location for Applications

Thanks for the great answers. This is my first time installing a system. I have always just administered systems that someone else set up so I am a little unsure of myself on some issues. On the applications that want a different location, I'm going to install them to /opt.

The one thing I had not even considered was getting /opt out of the root volume group. I am now investigating creating a second volume group to move /opt to. I currently have it as part of vg00. I'm lucky in that I have a couple weeks to play with the machine before it has to go into production.

Thanks again,

Jane
Ralph Grothe
Honored Contributor

Re: Best Location for Applications

Jane,

it's good idea to separate /opt even from the root vg00 altogether.

Just one warning, should you run an MC/SG cluster on this box, that you shouldn't forget to list all non-cluster-shared volume groups (except vg00) in the custom_vg_activation() function in the file /etc/lvmrc.
I forgot this the first time, and was wondering why init hadn't mounted my /opt after a reboot, because the script /sbin/lvmrc hadn't activated the underlying volume group ;-)
Madness, thy name is system administration