2

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.

0

3 Answers 3

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

2

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/

1
  • .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. Commented Feb 7, 2011 at 18:03
0

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.

3
  • Yes, each user's home directory is server by Samba from the Linux machine. Commented Feb 7, 2011 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? Commented Feb 7, 2011 at 18:12
  • /var/lib/stevedore sounds best then for those data files. Both repo and live can be there together.
    – Steven
    Commented Feb 7, 2011 at 18:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .