Blob Blame History Raw
# This file provides the Apache configuration you need to copy under
# `/etc/httpd/conf.d/' directory, in order to execute the
# `centos-web.cgi' script correctly. By default, this file implements
# a configuration through aliases, but a configuration through virtual
# domains is also available for you to use.
#
# The configuration discribed here, both for aliases and virtual
# domains, limits the number of location you can use to store public
# contents (e.g., only one `public_html' directory can be used in your
# home directory and only one `/var/www/html' directory can exist in
# your file system).  This limitation is necessary in order to refer
# public contents from cgi scripts in a portable way. Thus, it would
# be very convenient that all cgi scripts be written to reuse the same
# public information (e.g., images and css files).  Another limitation
# is that, by default, this configuration is set to work with the
# `centos' user name only.  However, if you want to run this
# configuration under a different user name, you can change the
# default path information provided in this configuration by that one
# you want to run this configuration under.
# ------------------------------------------------------------------
# $Id$
# ------------------------------------------------------------------

# ------------------------------------------------------------------
# Using Aliases:
#
# This configuration assumes you are a web developer whom needs to
# download a working copy of `centos-web' tree into your workstation
# and also be able of testing the changes you make before committing
# them up to the central repository.
#
# For this configuration to work, you need to create the following
# directory structure in your home directory:
#
#       /home/centos
#       |-- cgi-bin                 (1)
#       |   `-- centos-web          (2)
#       |       |-- apps
#       |       `-- centos-web.cgi
#       `-- public_html             (3)
#           |-- images
#           `-- stylesheet.css
#
#       (1): This directory must be created with a
#       `httpd_sys_script_exec_t' selinux context. This directory
#       organizes cgi scripts and related executable files.
#
#       (2): This directory must be created using subversion's `co'
#       command. For example, consider the location of `cgi-bin'
#       directory of a specific application (e.g., centos-web) inside
#       the central repository and download it here, from there.
#       Notice that both central repository and home directory
#       structure used for organize cgi script are different one
#       another and you need to accomodate it in your home directory,
#       not in the central repository.
#
#       (3): This directory must be created with a
#       `httpd_sys_content_t' selinux context. This directory contains
#       all public files the cgi scripts need (e.g., images and css
#       files) and must be created using the subversion's `co'
#       command. For example, consider the `public' directory of
#       specific cgi application (e.g., centos-web) inside the central
#       repository and download it here, from there.
#
# Finally, be sure to copy this configuration file to
# `/etc/httpd/conf.d' directory and reload the apache http daemon
# (e.g., `/sbin/service httpd reload'), in order for the layout
# described here to take effect.

ScriptAliasMatch ^/(.+)/(.*)$ "/home/centos/cgi-bin/$1/$1.cgi"
AliasMatch       ^/public/(.*)$ "/home/centos/public_html"

# ------------------------------------------------------------------
# Using Virtual Domains
#
# This configuration assumes you are a system administrator whom needs
# to put the `centos-web.cgi' script on production (i.e., no
# unpredictable changes are introduced to cgi script source code). For
# example, if you administer the `centos.org' domain, this
# configuration would let you to run the `centos-web.cgi' script with
# an URL like `http://www.centos.org/'.
#
# This configuration requires that you set up your DNS to point such
# URLs to the same IP address (e.g., by using CNAME), copy this file
# to `/etc/httpd/conf.d/' directory, and reload the apache httpd
# daemon (e.g., `/sbin/service httpd reload').
#
# In this configuration you don't use subversion's `co' commands but
# the tagged revisions (a.k.a. final releases or update releases)
# published by web developers in the central repository. In this
# configuration, the cgi source code would be stored in a special
# place accesable by apache and root users only (e.g.,
# `/var/www/cgi-bin'). On the other hand, the public contents required
# by cgi scripts would be stored in a special world-wide readable
# place (e.g., `/var/www/html').

#NameVirtualHost *:80
#
#<VirtualHost *:80>
#    ServerName  projects.centos.org
#    DocumentRoot /var/www/html
#</VirtualHost>
#
#<VirtualHost *:80>
#    ServerName  www.centos.org
#    ScriptAliasMatch ^/[^public](.*)$ "/var/www/cgi-bin/centos-web.cgi"
#    Alias /public "/var/www/html"
#</VirtualHost>