Web application package guidelines

This page describes how to package web applications.

Arch package guidelines

32-bitCLRCMakeCrossDKMSEclipseElectronFontFree PascalGNOMEGoHaskellJavaKDEKernelLispMesonMinGWNode.jsNonfreeOCamlPerlPHPPythonRRubyRustShellVCSWebWine

Separate user

For security reasons, every web application should be run as a separate (unprivileged) user (i.e. $pkgname).

Note: Traditionally, many web applications were run as the http user/group, which can be considered unsafe, as in such a scenario applications can read each other's files.

Refer to the systemd-sysusers(8), sysusers.d(5), systemd-tmpfiles(8) and tmpfiles.d(5) man pages for details on how to create users and deal with ownership of files and folders for that user in a package.

Directory structure

The layout follows the FHS.

  • /usr/share/$pkgname: The application's data directory holds the files of the web application. Files are owned by root and are therefore readonly to the application user and group $pkgname.
  • /etc/$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 $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).
  • : 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.
gollark: Particularly the whole "chaos guardian" thing, which is just ridiculous - it's a boss with an attack which *instantly kills you*, except DE armour can magically save you from death for a lot of power, so you're forced to use that.
gollark: It's just "what if we take things, and make them have bigger numbers?!??!!¡ ̇¡ ̇¡ ̇⅛ ̇" ̇!¡ ̇¡ ̇?!!".
gollark: I actually dislike Draconic Evolution. It's where the "it's balanced because it takes effort" thing comes from.
gollark: It's balanced because it doesn't take effort.
gollark: Hmm, you have me beaten by 0.7 years.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.