Webapp-Config: Difference between revisions
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Under Gentoo, installing a | Under Gentoo, installing a typical web application is actually a two-step process: | ||
<br> | <br> | ||
*you '''emerge''' the application, which typically installs the app under '''/usr/share/webapps/'''''<pkg_name>''<br> | |||
*you then perform a second-stage installation to your web-server doc-root, using '''webapp-config''' | |||
<br> | <br> | ||
Why? To support virtual-hosting, and multiple sites being served from a given host, where they may each require different package-versions. | |||
<br> | <br> | ||
<br> | <br> | ||
=QuickStart for Impatient People= | |||
*Install '''webapp-config''': | |||
<font color=red>hostname</font> <font color=blue>~ #</font> '''emerge -v webapp-config''' | |||
*Install your desired package onto your system; we'll use '''awstats''' as an example here: | |||
<font color=red>hostname</font> <font color=blue>~ #</font> '''emerge -v awstats''' | |||
*Secondarily-install your package onto the webserver's root: | |||
<font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -I -h localhost -d /awstats awstats 6.7-r2''' | |||
*configure the package, as necessary. | |||
*Restart your web-server: | |||
<font color=red>hostname</font> <font color=blue>~ #</font> '''/etc/init.d/apache2 restart''' | |||
<br> | <br> | ||
== Setting up Webapp-Config == | == Setting up Webapp-Config == | ||
Line 25: | Line 34: | ||
<font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -I -h localhost -d /gallery gallery 2.2.3''' | <font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -I -h localhost -d /gallery gallery 2.2.3''' | ||
<font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -I -h localhost -d /awstats awstats 6.5-r1''' | <font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -I -h localhost -d /awstats awstats 6.5-r1''' | ||
<font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -I -h localhost -d /apcupsd apcupsd 3.12.4''' ''most stuff winds up under /var/www/localhost/cgi-bin/, with only an empty-dir /var/www/localhost/htdocs/apcupsd'' | |||
== Upgrading Installed Applications == | == Upgrading Installed Applications == | ||
Line 34: | Line 43: | ||
<font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -U -d /mediawiki mediawiki 1.11.2''' | <font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -U -d /mediawiki mediawiki 1.11.2''' | ||
<font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -U -d /awstats awstats 6.7-r2''' | <font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config -U -d /awstats awstats 6.7-r2''' | ||
== Other webapp-config Commands == | == Other webapp-config Commands == | ||
<font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config --list-installs''' ''can optionally follow this with <pkg_name | <font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config --list-installs''' ''can optionally follow this with <pkg_name>, or <pkg_name pkg_version>'' | ||
<font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config --list-unused-installs''' ''can optionally follow this with <pkg_name | <font color=red>hostname</font> <font color=blue>~ #</font> '''webapp-config --list-unused-installs''' ''can optionally follow this with <pkg_name>, or <pkg_name pkg_version>'' | ||
<br> | <br> |
Latest revision as of 17:22, 4 December 2008
Under Gentoo, installing a typical web application is actually a two-step process:
- you emerge the application, which typically installs the app under /usr/share/webapps/<pkg_name>
- 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.
QuickStart for Impatient People
- Install webapp-config:
hostname ~ # emerge -v webapp-config
- Install your desired package onto your system; we'll use awstats as an example here:
hostname ~ # emerge -v awstats
- Secondarily-install your package onto the webserver's root:
hostname ~ # webapp-config -I -h localhost -d /awstats awstats 6.7-r2
- configure the package, as necessary.
- Restart your web-server:
hostname ~ # /etc/init.d/apache2 restart
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 hostname ~ # webapp-config -I -h localhost -d /apcupsd apcupsd 3.12.4 most stuff winds up under /var/www/localhost/cgi-bin/, with only an empty-dir /var/www/localhost/htdocs/apcupsd
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>