As I'm a programmer and not an admin I hope you can help me out:

Currently I'm writing a web application that uses (XML) config files that the user will be able to also edit them through the application (in a web interface) itself.
So the application needs read and write permissions on them.

And when the application package get's updated on the system it should, of course, use the preexisting config files that the older version was already using. (As the format of the config files might change slightly from version to version the update process might modify/update the config files as well)

So where is the official (Debian) and the highly official (LSB/FHS) location for these files?

  • /etc/myWebApp/config/ (with a symlink WEBROOT/myWebApp/config -> /etc/myWebApp/config/)?
  • WEBROOT/myWebApp/config/?
  • somewhere else?

And how should the update process be organized? Just rename the old config files to config_*.xml.160207 and translate their content to the new format at config_*.xml? Or use a config directory for each version?
How should a downgrade of the package (e.g. when a PPA is created for beta testers and the user want's to drop out from the beta test and revert to the stable versions) be handled? Automatic inverse renaming or leave it to the user to fix it himself?

Note: A "user" is in this case the admin of the web app. So he has all the power to change the config files. (But not necessary much Linux know how and is often not root). The "end user" would then be the real user of the app and it's configured content.


It depends on your project. Configuration files may be in /etc/, /var/www, /opt, but they shouldn't be in /usr/, /sys/, ...

If configuration files are in /etc, package manager will ask you what to do on update.

Usually configuration files from package has postfix .sample (e.g. /etc/project/config.xml.sample). And user must copy it to config.xml and customize. In this way they will not be rewritten on update.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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