Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am creating a new application. I currently have all of the server code, configuration, log and data files in directories that do not follow any kind of standard. Looking at the Wikipedia article on Filesystem Hierarchy Standard I have come up with this new arrangement:

/opt/stevedore/                     Server Code
/etc/stevedore/steve_site_config.pl Server Configuration
/var/log/stevedore/                 Server Logs
/srv/stevedore/                     Server Site Data (Document tree)

Having used Apache were the data files are located in /var/www/ the pattern would seem to indicate that the data files should be located here instead:

/var/stevedore/                     Server Site Data (Document tree)

Additionally, the users check out local copies of documents for editing which are located in these directories:

~/MyStevedore/                      User - Editable files
~/MyStevedore/CheckOut/             User - Files to CheckOut
~/MyStevedore/CheckInToPublish/     User - Files to CheckIn To Publish
  1. Which is better for a default and why: /srv/stevedore/ vs /var/stevedore/?
  2. How about ~/MyStevedore/ for standard user specific directories?

For more details on the application see the Stevedore Web Site and the code at the time of this posting.

share|improve this question
add comment

migrated from serverfault.com Feb 12 '11 at 20:10

This question came from our site for professional system and network administrators.

3 Answers

  1. If you plan on inclusion in distributions, use the standard buckets (bin, sbin, etc) and avoid /opt *.

  2. I'd be really annoyed to have enforced folders in my home dir. I've just cleaned that stuff up! ;-) Sure you don't want to use /srv/stevedore/users/(user)? It's a document server, right?

Other rationales:

The webdata can be put in /usr/share/stevedore/web too. System administrators likely have a custom Apache setup, and the last thing you'd like to see is files in /var/www/htdocs/appname. Rather, just make sure they are available (and share fits that purpose really well) so the admins can make an Alias in Apache and link the webapp in the proper websites.

You can pick /var/stevedore, or /srv/storedore, that's fine as long as it's configurable. You can expect Debian users to like /var/*, and SUSE users to prefer /srv/*. If you go for that route, make sure it's configurable for packagers.

The same also applies to the install root. That can be /usr, /usr/local, or something else the administrator or packager desires, or it has to be configurable.

Using /var/log/stevedore for logs makes perfect sense.

The packagers want your package to fit in with the rest. The packagers also make sure your application links to their specific versions of the libraries, so you don't have to ship those as well.


[*] When you put your software in /opt, I'd expect the whole system to be there. For example,

/opt/stevedore/bin/
/opt/stevedore/doc/
/opt/stevedore/etc/
/opt/stevedore/lib/
/opt/stevedore/share/
/opt/stevedore/sbin/

This is typically used for third party installers, or commercial games. Those packages usually come in binary format only, and ship all their required libraries with them. Even the config files are shipped in that folder.

share|improve this answer
add comment

Ultimately, if you're planning on getting people to package this for their distributions, what you'll want to do is establish either a compile-time or configured location for each of these things. For instance, using autoconf/automake/configure to set macros for --prefix, --bindir, --datadir and so on.

In general, I think most distributions don't use /opt/ for packaged executables (these would go into /usr/bin or /usr/sbin as appropriate). It seems that users would be expected to use the files in ~/MyStevedore/ on a regular basis, so not creating it as ~/.MyStevedore/ is forgivable, but some distributions may use a file manager that expects everything in ~/MyDocuments/MyStevedore/ or ~/Desktop/MyStevedore/

share|improve this answer
    
.MyStevedore is not used as the directory name because MyStevedore is the user's interface to the server which uses inotify to monitor user actions. –  C.W.Holeman II Feb 7 '11 at 18:03
add comment

There really isn't much of a difference between /srv/stevedore/ and /var/stevedore/. What kind of data is it? If its data files being sent over the webserver, /var/www might be better. At this point its mostly personal preference among those three. If the data is the state of your program, then /var/lib/stevedore is even better; just like databases keep their data files there.

As for the user directories, do users actually get a local unix account? If so, ~ is fine. If not, then its not a good idea. It would be too easy for someone to think those users no longer exist, so their home directories can be removed. A better place would be /var/lib/stevedore/username.

share|improve this answer
    
Yes, each user's home directory is server by Samba from the Linux machine. –  C.W.Holeman II Feb 7 '11 at 17:40
    
/srv/stevedore/SteveTrunks/ has steveLive/ which contains the published edition (.html or .pdf) and steveRepo/ which contains the bazaar source (.odt). The users never access steveRepo/, just the sever while the steveLive/ edition of the documents are accessed by the user via Samba. Would this distinction be a cause for locating steveLive/ and steveRepo/ in different locations? –  C.W.Holeman II Feb 7 '11 at 18:12
    
/var/lib/stevedore sounds best then for those data files. Both repo and live can be there together. –  Steven Feb 7 '11 at 18:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.