Web application package guidelines
32-bit – CLR – CMake – Cross – DKMS – Eclipse – Electron – Font – Free Pascal – GNOME – Go – Haskell – Java – KDE – Kernel – Lisp – Meson – MinGW – Node.js – Nonfree – OCaml – Perl – PHP – Python – R – Ruby – Rust – VCS – Web – Wine
This page describes how to package web applications.
For security reasons, every web application should be run as a separate (unprivileged) user (i.e.
httpuser/group, which can be considered unsafe, as in such a scenario applications can read each other's files.
Refer to the, , and man pages for details on how to create users and deal with ownership of files and folders for that user in a package.
The layout follows the FHS.
/usr/share/webapps/$pkgname: The application's data directory holds the files of the web application. Files are owned by
rootand are therefore readonly to the application user and group
/etc/webapps/$pkgname: The configuration directory of the application holds configuration files for the application (symlinked to the data directory). Files located here have to go to the backup array and are owned by the user and group
/run/$pkgname: The runtime directory of the application (owned by the user and group
$pkgname). It can be used for sockets (e.g. in setups facilitating socket activation).
/runmust not be contained in a package. Use tmpfiles to add the directory with matching permissions.
/var/cache/$pkgname: The cache directory of the application (owned by the user and group
$pkgname). It (or subfolders in it) is symlinked to the data directory for applications requiring writable cache directories.
/var/lib/$pkgname: The persistent storage of the application (owned by the user and group
$pkgname). It (or subfolders in it) is symlinked to the data directory for applications requiring persistent storage directories.