Explanation of Linux' Directory Hierarchy

Where should I dump my 3rd party tools? I'm using go app engine and LiteIDE. I ended up dumping them into $HOME, for ease of reference, but idk if that's where they belong. I've added both programs to the PATH variable, so where they are doesn't really matter to me.

Are they in your distros repos?

3rd party tools usually go in /opt for optional software and is the best place for programs that don't have a normal install path for your distro.

Nope, they are not in my distros repo. I'll move them to /opt then, thanks.

Worth pointing out. You'd normally put then there if your have multiple users. If its just you there's nothing really wrong with it in your home dir. But /opt will keep it tidier and its all in the one folder then.

I have Minecraft in my home directory cause I'm lazy.

This was excellent, I was always curious about the directory hierarchy and I learned quite a bit today.

I'm not sure if this is the place for this type of question since I'm not sure if this post was more related to desktop distros but on a few servers I've seen some different locations for their /www folders, some place it in the /var folder and some clients have placed it in the /opt folder. Where exactly would be the best place for hosting your website? Does it truly matter?

Regardless if my question can be answered, I can say that I should have an easier time debugging on my future Linux machines thanks to this guide, thank you very much!

/var/www Most systems default to that directory for initial configuation.

/opt would be the wrong place for it, its normally reserved fro 3rd party or propitiatory software.

however /var/www isnt the right place either, following the FHS the correct place would be /srv

FHS - 3.0

Purpose

/srv contains site-specific data which is served by this system.

Rationale

This main purpose of specifying this is so that users may find the location of the data files for a particular service, and so that services which require a single tree for readonly data, writable data and scripts (such as cgi scripts) can be reasonably placed. Data that is only of interest to a specific user should go in that users' home directory. If the directory and file structure of the data is not exposed to consumers, it should go in /var/lib.

The methodology used to name subdirectories of /srv is unspecified as there is currently no consensus on how this should be done. One method for structuring data under /srv is by protocol, eg. ftp, rsync, www, and cvs. On large systems it can be useful to structure /srv by administrative context, such as /srv/physics/www, /srv/compsci/cvs, etc. This setup will differ from host to host. Therefore, no program should rely on a specific subdirectory structure of /srv existing or data necessarily being stored in /srv. However /srv should always exist on FHS compliant systems and should be used as the default location for such data.

Distributions must take care not to remove locally placed files in these directories without administrator permission. [20]

Another place sometimes used where users of a system would have webpages is traditionally /home/[user]/public_html which would end up being serves by http://example.com/~user

2 Likes

Thank you so much for the excellent and timely reply!

I'll have to talk to my coworkers about making the adjustment, I'd hate for us to not properly host our content.

I've seen the /home/[user]/public_html set up at my University which was used for students to create their own online portfolio, or projects. I'm not sure if that was ever abused or not now that I think about it, it would seem like something that could be easily exploited. I suppose only the web design kids were the only ones aware of it and were too busy with other projects to use it for file sharing or something stupid.

I made a wallpaper of the directory hierarchy some time ago. Here it is:

2 Likes

Thats quite good, what did you use to make it?

Just gimp :P