From fb9b0c37405ff564fde81c5bc5cb975b2c4a23aa Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Nov 26 2011 03:59:46 +0000 Subject: Update `webenv.conf'. --- diff --git a/Scripts/Python/centos-web/webenv.conf b/Scripts/Python/centos-web/webenv.conf index 60efdcb..0857a5b 100644 --- a/Scripts/Python/centos-web/webenv.conf +++ b/Scripts/Python/centos-web/webenv.conf @@ -1,77 +1,98 @@ -# This file provides the apache configuration you need to copy under +# 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. The configuration provided in this file is -# described in two sections, one for aliases and other for virtual -# domains. +# `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$ # ------------------------------------------------------------------ # ------------------------------------------------------------------ -# Configuration Through Aliases: +# 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 made before commit them -# up to central repository. +# and also be able of testing the changes you make before committing +# them up to the central repository. # -# As possible solution, you need to create the following directory -# structure in your home directory: +# For this configuration to work, you need to create the following +# directory structure in your home directory: # -# ~/user -# |-- cgi-bin (1) -# | `-- centos-web (2) -# | |-- apps -# | `-- centos-web.cgi -# `-- public_html (3) -# |-- images -# `-- stylesheet.css +# /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. +# (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 cgi-bin location where it is -# stored in the central repository and download it here. Notice that -# both central repository and home directory structure used for -# organize cgi script are different and you need to accomodate it in -# your home directory, not in the central repository. +# (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 cgi -# scripts need (e.g., images and css files). +# (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 configure Apache HTTP server to serve pages in -# the `public_html' directory stored in your home directory. This is -# done by enabling the UserDir option inside Apache's main -# configuration file (i.e., `/etc/httpd/conf/httpd.conf'). +# 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/*/cgi-bin/$1/$1.cgi" +ScriptAliasMatch ^/(.+)/(.*)$ "/home/centos/cgi-bin/$1/$1.cgi" AliasMatch ^/public/(.*)$ "/home/centos/public_html" # ------------------------------------------------------------------ -# Configuration Through Virtual Domains +# Using Virtual Domains # # This configuration assumes you are a system administrator whom needs -# to put the `webenv.cgi' script in production. For example, if you -# administer the `centos.org' domain, this configuration would let you -# to run the `webenv.cgi' script with an URL like -# `http://www.centos.org/'. +# 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 and copy this file (i.e., `webenv.conf') -# into the `/etc/httpd/conf.d/' directory. Once you've done this, -# reload the httpd service (e.g., /sbin/service httpd reload) and use -# the URL you set up to reach the application. +# 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'). # -# Notice that, in this configuration you don't make changes inside the -# `webenv.cgi' script source code. In this configuration, the -# application's source code would be in a place accesable by apache -# and root users only (e.g., `/var/www/cgi-bin') with the only purpose -# of being productive there. Of course, you as system administrtors -# can update the `webenv.cgi' source code in this location when web -# developers do release new version of it. +# 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 # @@ -82,6 +103,6 @@ AliasMatch ^/public/(.*)$ "/home/centos/public_html" # # # ServerName www.centos.org -# ScriptAliasMatch ^/[^public](.*)$ "/var/www/cgi-bin/webenv.cgi" +# ScriptAliasMatch ^/[^public](.*)$ "/var/www/cgi-bin/centos-web.cgi" # Alias /public "/var/www/html" #