Blame Scripts/Python/centos-web/centos-web.conf

fb9b0c
# This file provides the Apache configuration you need to copy under
bc8d3b
# `/etc/httpd/conf.d/' directory, in order to execute the
fb9b0c
# `centos-web.cgi' script correctly. By default, this file implements
fb9b0c
# a configuration through aliases, but a configuration through virtual
fb9b0c
# domains is also available for you to use.
fb9b0c
#
fb9b0c
# The configuration discribed here, both for aliases and virtual
fb9b0c
# domains, limits the number of location you can use to store public
fb9b0c
# contents (e.g., only one `public_html' directory can be used in your
fb9b0c
# home directory and only one `/var/www/html' directory can exist in
fb9b0c
# your file system).  This limitation is necessary in order to refer
fb9b0c
# public contents from cgi scripts in a portable way. Thus, it would
fb9b0c
# be very convenient that all cgi scripts be written to reuse the same
fb9b0c
# public information (e.g., images and css files).  Another limitation
fb9b0c
# is that, by default, this configuration is set to work with the
fb9b0c
# `centos' user name only.  However, if you want to run this
fb9b0c
# configuration under a different user name, you can change the
fb9b0c
# default path information provided in this configuration by that one
fb9b0c
# you want to run this configuration under.
d864eb
# ------------------------------------------------------------------
d864eb
# $Id$
d864eb
# ------------------------------------------------------------------
d864eb
869a58
# ------------------------------------------------------------------
fb9b0c
# Using Aliases:
869a58
#
869a58
# This configuration assumes you are a web developer whom needs to
bc8d3b
# download a working copy of `centos-web' tree into your workstation
fb9b0c
# and also be able of testing the changes you make before committing
fb9b0c
# them up to the central repository.
869a58
#
fb9b0c
# For this configuration to work, you need to create the following
fb9b0c
# directory structure in your home directory:
869a58
#
fb9b0c
#       /home/centos
fb9b0c
#       |-- cgi-bin                 (1)
fb9b0c
#       |   `-- centos-web          (2)
fb9b0c
#       |       |-- apps
fb9b0c
#       |       `-- centos-web.cgi
fb9b0c
#       `-- public_html             (3)
fb9b0c
#           |-- images
fb9b0c
#           `-- stylesheet.css
bc8d3b
#
fb9b0c
#       (1): This directory must be created with a
fb9b0c
#       `httpd_sys_script_exec_t' selinux context. This directory
fb9b0c
#       organizes cgi scripts and related executable files.
bc8d3b
#
fb9b0c
#       (2): This directory must be created using subversion's `co'
fb9b0c
#       command. For example, consider the location of `cgi-bin'
fb9b0c
#       directory of a specific application (e.g., centos-web) inside
fb9b0c
#       the central repository and download it here, from there.
fb9b0c
#       Notice that both central repository and home directory
fb9b0c
#       structure used for organize cgi script are different one
fb9b0c
#       another and you need to accomodate it in your home directory,
fb9b0c
#       not in the central repository.
bc8d3b
#
fb9b0c
#       (3): This directory must be created with a
fb9b0c
#       `httpd_sys_content_t' selinux context. This directory contains
fb9b0c
#       all public files the cgi scripts need (e.g., images and css
fb9b0c
#       files) and must be created using the subversion's `co'
fb9b0c
#       command. For example, consider the `public' directory of
fb9b0c
#       specific cgi application (e.g., centos-web) inside the central
fb9b0c
#       repository and download it here, from there.
bc8d3b
#
fb9b0c
# Finally, be sure to copy this configuration file to
fb9b0c
# `/etc/httpd/conf.d' directory and reload the apache http daemon
fb9b0c
# (e.g., `/sbin/service httpd reload'), in order for the layout
fb9b0c
# described here to take effect.
869a58
fb9b0c
ScriptAliasMatch ^/(.+)/(.*)$ "/home/centos/cgi-bin/$1/$1.cgi"
bc8d3b
AliasMatch       ^/public/(.*)$ "/home/centos/public_html"
d864eb
869a58
# ------------------------------------------------------------------
fb9b0c
# Using Virtual Domains
869a58
#
869a58
# This configuration assumes you are a system administrator whom needs
fb9b0c
# to put the `centos-web.cgi' script on production (i.e., no
fb9b0c
# unpredictable changes are introduced to cgi script source code). For
fb9b0c
# example, if you administer the `centos.org' domain, this
fb9b0c
# configuration would let you to run the `centos-web.cgi' script with
fb9b0c
# an URL like `http://www.centos.org/'.
869a58
#
869a58
# This configuration requires that you set up your DNS to point such
fb9b0c
# URLs to the same IP address (e.g., by using CNAME), copy this file
fb9b0c
# to `/etc/httpd/conf.d/' directory, and reload the apache httpd
fb9b0c
# daemon (e.g., `/sbin/service httpd reload').
869a58
#
fb9b0c
# In this configuration you don't use subversion's `co' commands but
fb9b0c
# the tagged revisions (a.k.a. final releases or update releases)
fb9b0c
# published by web developers in the central repository. In this
fb9b0c
# configuration, the cgi source code would be stored in a special
fb9b0c
# place accesable by apache and root users only (e.g.,
fb9b0c
# `/var/www/cgi-bin'). On the other hand, the public contents required
fb9b0c
# by cgi scripts would be stored in a special world-wide readable
fb9b0c
# place (e.g., `/var/www/html').
869a58
869a58
#NameVirtualHost *:80
869a58
#
869a58
#<VirtualHost *:80>
869a58
#    ServerName  projects.centos.org
869a58
#    DocumentRoot /var/www/html
869a58
#</VirtualHost>
869a58
#
869a58
#<VirtualHost *:80>
869a58
#    ServerName  www.centos.org
fb9b0c
#    ScriptAliasMatch ^/[^public](.*)$ "/var/www/cgi-bin/centos-web.cgi"
869a58
#    Alias /public "/var/www/html"
869a58
#</VirtualHost>