public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [GLEP #11] Web Application Installation - 1.2
@ 2003-08-12 13:49 Troy Dack
  2003-08-12 14:05 ` Max Kalika
  0 siblings, 1 reply; 2+ messages in thread
From: Troy Dack @ 2003-08-12 13:49 UTC (permalink / raw
  To: gentoo-dev@gentoo.org; +Cc: glep


[-- Attachment #1.1: Type: text/plain, Size: 882 bytes --]

Please find attached an updated GLEP #11 (V1.2) 

Thanks to Stuart for pointing out the errors that I had made.

For the GLEP people:
	I am unable to commit this to CVS, I get permission denied
	errors trying to open a lock file.

	Could someone please commit this for me.

Until the revision is committed to cvs the revision is available at:
	http://dev.gentoo.org/~tad/glep/glep-0011.html
	http://tkdack.bpa.nu/~troy/glep/glep-0011.txt

Thanks,

-- 
Troy Dack        "Yes, yes, I know that, Sydney ... Everybody knows that!
tad@gentoo.org    ... But look: Four wrongs squared, minus two wrongs to 
                  the fourth power, divided by this formula, do make a
                  right." -- Gary Larson

Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x4D90BE3C
Key fingerprint = 1F3D 6C15 16AA 09D5 0C96  92E5 FD89 16F9 4D90 BE3C
 

[-- Attachment #1.2: glep-0011.txt --]
[-- Type: text/plain, Size: 10435 bytes --]

GLEP: 11
Title: Web Application Installation
Version: $Revision: 1.2 $
Last-Modified: $Date: 2003/08/12 23:14:00 $
Author:	Troy Dack <tad@gentoo.org>
Discussions-To: gentoo-dev@gentoo.org
Status: Draft
Type: Standards Track
Content-Type: text/x-rst
Created: 02 August 2003
Post-History: 07 Aug 2003, 12 Aug 2003 

Credits
=======

Based on comments posted to gentoo-dev mailing list [#WebAppPost1]_
[#WebAppPost2]_ [#WebAppPost3]_ by:

	Stuart Herbert <stuart at gentoo.org>, Max Kalika <max at gentoo.org>,
	Robin H.Johnson <robbat2 at gentoo.org> and others

Definitions
===========

	*Web Application*
		an application that requires a web server to function and interacts with
		the user via a browser

	*Web Application Instance*
		An apparent install of the Web Application that is served up via the
		webserver. There may be any number of instances per Web Application.
		This is a major use for web applications. Our Gentoo Zope setup
		already provides instances and can be used for some concepts on this
		matter.

	*Web Application Setup Program*
		A script similar in function to zope-config that sets up instances.

	*Document Root*
		a location in the file system that forms the main document tree visible from
		the web

Conventions
===========

	When describing the location of a directory in the file system it
	wil be shown *with* a trailing slash, eg::

		/foo/bar/

	When describing the location of a specific file (irrespective of any
	file extention) it will shown *with out* a trailing slash, eg::

		/foo/blah

Abstract
========

To define where and how web based applications should be installed by Gentoo.

Motivation
==========

Currently there is no standard defined regarding the installation of web
based applicaitons in Gentoo.  This leads to ebuild authors creating a
variety of methods to determine:

	* where the application should be installed
	* what user and permissions the application should be given
	* where any configuration files related to the application should be
	  installed.

Due to a lack of standard install method configuration files are at
risk of being overwritten during upgrade, potentially causing system
administrators down tine as they have to reconfigure web applications
after an upgrade.

Rationale
=========

A discussion on the gentoo-dev mailing list [#WebAppPost1]_ raised the
following points regarding how Gentoo handles the installation of web based
applications:

	1. Gentoo installed web applications (eg: horde, phpbb, cacti,
	   phpmysql) should not be installed in the Document Root of a web server.
	2. Web applications should not have their configuration files installed
	   under the Document Root of a web server.

		i. Web Application must be slotted by their full version numbers to
		   further avoid downtime when true configuration changes are required.

	3. Web applications should not be owned by the same user as the web server.
	4. It should be easily possible to have multiple instances of a web
	   application without any duplication of source files.
	5. It should be immediately apparent how to control instances of a web
	   application.

Implementation
==============

Max Kalika <max at gentoo.org> stated that he has a preliminary eclass that
implements a good deal of this GLEP.

Stuart Herbert <stuart at gentoo.org> has committed::

	webapp-apache.eclass

to CVS, this is a stop-gap measure whilst this GLEP is being finalised.


1. Web Server
-------------

A common default web server should be selected.  Selection of a default web 
server will help to reduce the number of bugs that are reported.

Given the popularity of the Apache web server it is suggested that Apache be 
selected as the Gentoo default web server.

The Virtual Host Configuration tool (see below) will transparently support
different web servers, thus enabling web applications to be installed on a 
Gentoo system irrespective of the installed web server.

1.1 Default Document Root
'''''''''''''''''''''''''

The current default Document Root for Gentoo is /home/httpd/, this is
unsuitable for a couple of reasons:

	* /home/ may be exported via nfs to numerous other hosts, it is not
	  acceptable to share publically accessible files with numerous hosts.

	* there is a potential (all be it small) for a user name clash

To ensure the greatest flexibility when installing applications the following
*Document Root* locations are to be used:

	* For single host installations::

		/var/www/localhost/

	* For multiple virtual host installations::

		/var/www/<fully qualified domain name>/

		eg:
			/var/www/www.gentoo.org/

Additionally the chosen location ( /var/www/ ) appears to be becoming a defacto
standard for Linux distributions.

1.2 Apache 2
''''''''''''

All web application .ebuilds will honour any USE flags that are intended to
add support for Apache 2 as well as supporting Apache 1 installations.

2. Application Installation
---------------------------

The current accepted standard Document Root in Gentoo is /home/httpd.  The
discussion suggest that this is not the best location to install web based
applications.

2.1 Application SLOTs
'''''''''''''''''''''

All ebuilds are to set the SLOT variable as follows::

	SLOT="${PV}"

Setting the SLOT variable as shown will enable different versions of the same
web application to be served concurrently by one server.

2.2 Installation Paths
''''''''''''''''''''''

Web applications should be installed outside of the Document Root using the following
defaults:

	* for files to be served to clients::

		/usr/share/webapps/${PF}/htdocs/

		/usr/share/webapps/${PF}/cgi-bin/

	* install *site default* configuration files in::

		/etc/webapps/${PF}/

	* for documentation files (not served to clients)::

		/usr/share/doc/${PF}/

3. Virtual Host Support
-----------------------

The ability to easily configure and administer multiple virtual hosts is a
must.

3.1 New "vhost" USE Flag
''''''''''''''''''''''''

To enable support for multiple virtual host installations a new USE flag is
to be added to Portage. The use flag will be::

	vhost

When *vhost* is _set_ the installation location and configuration for the web
application will be effected, see below for more details.

3.2 VHost Configuration Tool
''''''''''''''''''''''''''''

To assist administration of multiple virtual hosts a "VHost Configuration Tool"
needs to be developed and implemented.  Initial discussion regarding the VHost
Config tool and proposed usage can be found at http://article.gmane.org/gmane.linux.gentoo.devel/10874.

It's the job of the VHost Config toolset to make a local instance of the web 
application run under a specific web server.

The VHost Configuration Utility will need to be a seperate package, maintained by Gentoo.
Apache .ebuilds will require the VHost Config tool as a dependency (DEPEND).

`Bug #26293`_ will be used to track the initial progress of the VHost
Configuration Tool.

.. _Bug #26293: http://bugs.gentoo.org/show_bug.cgi?id=26293


The vhost-config must do three main things:

	- creates directories (copies a skeleton directory for the most part).
	- create web server vhost config files.
	- HUP web server so it reads in the new config without stopping.

Initially the VHost Config tool should provide support for the Apache web
server.  As the tool matures support for other web servers can be added.

4.1 Single Host Installation
''''''''''''''''''''''''''''

For single host installations the .ebuild will make the required
configurations changes and symlinks using the VHost Config tool to ensure
that the web application is available to be served from::

	/var/www/localhost/htdocs/${PF}/

In this case it may be feasible for the VHost Config tool to simply symlink the
directories from /usr/share/webapps/${PF}/ as is appropriate.

4.2 Virtual Host Installation
'''''''''''''''''''''''''''''

For installations that support multiple virtual hosts the .ebuild will
install the web application into the default location and then leave configuration
to the user through the VHost Config tool.

In this case the web application files will be copied from
/usr/share/webapps/${PF}/ to /var/www/<FQDN>/ by the VHost Config tool.

4.3 Configuration Files
'''''''''''''''''''''''

As stated above web application *site default* configuration files are to be 
installed into::

	/etc/webapps/${PF}/

The files in this directory are then copied (not symlinked!) by the VHost
Config tool to the Document Root for each instance of the app that is installed.

This will require the VHost Config toolset to emulate Portage's CONFIG_PROTECT 
behaviour for the web applications.

5. Application Permissions
--------------------------

Installing web applications and giving the web server ownership of the files
is a security risk.  This can possibly lead to application configuration
files being accessed by unwanted third parties.

All web applications should be owned by *root* unless the application
absolutely requires write access to its installation directories at execution
time.

Backwards Compatibility
=======================

There may be some issues regarding compatibility with existing installs of
web applications.  This is particularly true if the default Document Root is
moved from what is accepted as the current standard (/home/httpd).

The main issues are:
	* transition of existing configuration files to the
	  /etc/webapps/${PF}/ directory.
	* modification/reconfiguration of applications so that they
	  are aware of the location of configuration files.
	* creating the VHost Config toolset to enable installation and
	  configuration of web applications irrespective of web server.


References
==========

.. [#WebAppPost1] http://article.gmane.org/gmane.linux.gentoo.devel/10411
.. [#WebAppPost2] http://news.gmane.org/onethread.php?group=gmane.linux.gentoo.devel&root=%3C1059843010.5023.80.camel%40carbon.internal.lan%3E
.. [#WebAppPost3] http://news.gmane.org/onethread.php?group=gmane.linux.gentoo.devel&root=%3C86960000.1060038977%40valkyrie.lsit.ucsb.edu%3E

Copyright
=========

This document has been placed in the public domain.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [gentoo-dev] [GLEP #11] Web Application Installation - 1.2
  2003-08-12 13:49 [gentoo-dev] [GLEP #11] Web Application Installation - 1.2 Troy Dack
@ 2003-08-12 14:05 ` Max Kalika
  0 siblings, 0 replies; 2+ messages in thread
From: Max Kalika @ 2003-08-12 14:05 UTC (permalink / raw
  To: Troy Dack, gentoo-dev@gentoo.org; +Cc: glep

Quoting Troy Dack <tad@gentoo.org>:

> Please find attached an updated GLEP #11 (V1.2) 

This is something I quickly spotted... Haven't seen the whole thing yet:

> 2.1 Application SLOTs
> '''''''''''''''''''''
> 
> All ebuilds are to set the SLOT variable as follows::
> 
> 	SLOT="${PV}"

This should probably be SLOT="${PV}-${PR}".  Just a thought.

--mk

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-12 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-12 13:49 [gentoo-dev] [GLEP #11] Web Application Installation - 1.2 Troy Dack
2003-08-12 14:05 ` Max Kalika

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox