Webapp-Config

From Research
Jump to navigation Jump to search

Under Gentoo, installing a typcial web application is actually a two-step process:
1) you emerge the application, which typically installs the app under /usr/share/webapps/<pkg_name>
2) you then perform a second-stage installation to your web-server doc-root, using webapp-config

Why? To support virtual-hosting, and multiple sites being served from a given host, where they may each require different package-versions. Here's how:

Setting up Webapp-Config

First, we have the configuration-file /etc/vhosts/webapp-config, which lets us specify the vhost-root (often simply /var/www/<hostname>, but sometimes /srv/www/<hostname>. The localhost will be different in the case where we actually use vhosts, which isn't too common for us; we tend to prefer individual, dedicated vserver-guests, with single-site web-serving in each).

Typical settings within the /etc/vhosts/webapp-config file:

vhost_root="/var/www/${vhost_hostname}"
vhost_hostname="localhost"
vhost_server="apache"


Installing Applications

These commands will install apps under /var/www/localhost/htdocs/<pkg_name>, with the specific version mentioned at the end of command-line:

hostname ~ # webapp-config -I -h localhost -d /mediawiki  mediawiki 1.8.5
hostname ~ # webapp-config -I -h localhost -d /gallery  gallery 2.2.3
hostname ~ # webapp-config -I -h localhost -d /awstats awstats 6.5-r1


Upgrading Installed Applications

Commands to upgrade (typical):

hostname ~ # webapp-config -U -d /gallery  gallery 2.2.5
hostname ~ # webapp-config -U -d /mediawiki mediawiki 1.11.2
hostname ~ # webapp-config -U -d /awstats awstats 6.7-r2

Other webapp-config Commands

hostname ~ # webapp-config --list-installs  can optionally follow this with <pkg_name>, or <pkg_name pkg_version>
hostname ~ # webapp-config --list-unused-installs can optionally follow this with <pkg_name>, or <pkg_name pkg_version>