From - Fri Jan 25 18:49:30 2002
Return-Path: <perlbug@onion.perl.org>
Received: from mimer.null.dk ([130.228.230.9]) by mailin00.sul.t-online.de
	with smtp id 16U9cY-2KZKBUC; Fri, 25 Jan 2002 17:54:34 +0100
Received: (qmail 7700 invoked by uid 1038); 25 Jan 2002 16:54:31 -0000
Delivered-To: richard@mimer.null.dk
Received: (qmail 7686 invoked by uid 1038); 25 Jan 2002 16:54:31 -0000
Delivered-To: richard-rfi-rjsf@rfi.net
Received: (qmail 7683 invoked from network); 25 Jan 2002 16:54:30 -0000
Received: from onion.valueclick.com (HELO onion.perl.org) (209.85.157.220)
  by mimer.null.dk with SMTP; 25 Jan 2002 16:54:30 -0000
Received: (qmail 17274 invoked by uid 1007); 25 Jan 2002 16:54:28 -0000
Date: 25 Jan 2002 16:54:28 -0000
Message-ID: <20020125165428.17272.qmail@onion.perl.org>
From: perlbug@onion.perl.org
To: rjsf@rfi.net
Subject: onion
X-Mozilla-Status: 8001
X-Mozilla-Status2: 00000000
X-UIDL: 9e264ad1d58b7750

:r apachectl

#!/bin/sh
#
# Apache control script designed to allow an easy command line interface
# to controlling Apache.  Written by Marc Slemko, 1997/08/23
# 
# The exit codes returned are:
#	0 - operation completed successfully
#	1 - 
#	2 - usage error
#	3 - httpd could not be started
#	4 - httpd could not be stopped
#	5 - httpd could not be started during a restart
#	6 - httpd could not be restarted during a restart
#	7 - httpd could not be restarted during a graceful restart
#	8 - configuration syntax error
#
# When multiple arguments are given, only the error from the _last_
# one is reported.  Run "apachectl help" for usage info
#
#
# |||||||||||||||||||| START CONFIGURATION SECTION  ||||||||||||||||||||
# --------------------                              --------------------
# 
# the path to your PID file
PIDFILE=/home/perlbug/spool/logs/httpd.pid
#
# the path to your httpd binary, including options if necessary
#HTTPD="/usr/local/sbin/httpd -d /home/perlbug -f /home/perlbug/config/httpd.conf" 
HTTPD="/usr/sbin/httpd -d /home/perlbug -f /home/perlbug/config/httpd.conf" # blue
HTTPD="/usr/local/sbin/httpd -d /home/perlbug -f /home/perlbug/config/httpd.conf" # onion
echo $HTTPD
#
# a command that outputs a formatted text version of the HTML at the
# url given on the command line.  Designed for lynx, however other
# programs may work.  
LYNX="lynx -dump"
#
# the URL to your server's mod_status status page.  If you do not
# have one, then status and fullstatus will not work.
STATUSURL="http://localhost:8777/server-status"
#
# --------------------                              --------------------
# ||||||||||||||||||||   END CONFIGURATION SECTION  ||||||||||||||||||||

ERROR=0
ARGV="$@"
if [ "x$ARGV" = "x" ] ; then 
    ARGS="help"
fi

for ARG in $@ $ARGS
do
    # check for pidfile
    if [ -f $PIDFILE ] ; then
	PID=`cat $PIDFILE`
	if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then
	    STATUS="httpd (pid $PID) running"
	    RUNNING=1
	else
	    STATUS="httpd (pid $PID?) not running"
	    RUNNING=0
	fi
    else
	STATUS="httpd (no pid file) not running"
	RUNNING=0
    fi

    case $ARG in
    start)
	if [ $RUNNING -eq 1 ]; then
	    echo "$0 $ARG: httpd (pid $PID) already running"
	    continue
	fi
	if $HTTPD ; then
	    echo "$0 $ARG: httpd started"
	else
	    echo "$0 $ARG: httpd could not be started"
	    ERROR=3
	fi
	;;
    stop)
	if [ $RUNNING -eq 0 ]; then
	    echo "$0 $ARG: $STATUS"
	    continue
	fi
	if kill $PID ; then
	    echo "$0 $ARG: httpd stopped"
	else
	    echo "$0 $ARG: httpd could not be stopped"
	    ERROR=4
	fi
	;;
    restart)
	if [ $RUNNING -eq 0 ]; then
	    echo "$0 $ARG: httpd not running, trying to start"
	    if $HTTPD ; then
		echo "$0 $ARG: httpd started"
	    else
		echo "$0 $ARG: httpd could not be started"
		ERROR=5
	    fi
	else
	    if $HTTPD -t >/dev/null 2>&1; then
		if kill -HUP $PID ; then
		    echo "$0 $ARG: httpd restarted"
		else
		    echo "$0 $ARG: httpd could not be restarted"
		    ERROR=6
		fi
	    else
		echo "$0 $ARG: configuration broken, ignoring restart"
		echo "$0 $ARG: (run 'apachectl configtest' for details)"
		ERROR=6
	    fi
	fi
	;;
    graceful)
	if [ $RUNNING -eq 0 ]; then
	    echo "$0 $ARG: httpd not running, trying to start"
	    if $HTTPD ; then
		echo "$0 $ARG: httpd started"
	    else
		echo "$0 $ARG: httpd could not be started"
		ERROR=5
	    fi
	else
	    if $HTTPD -t >/dev/null 2>&1; then
		if kill -USR1 $PID ; then
		    echo "$0 $ARG: httpd gracefully restarted"
		else
		    echo "$0 $ARG: httpd could not be restarted"
		    ERROR=7
		fi
	    else
		echo "$0 $ARG: configuration broken, ignoring restart"
		echo "$0 $ARG: (run 'apachectl configtest' for details)"
		ERROR=7
	    fi
	fi
	;;
    status)
	$LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
	;;
    fullstatus)
	$LYNX $STATUSURL
	;;
    configtest)
	if $HTTPD -t; then
	    :
	else
	    ERROR=8
	fi
	;;
    *)
	echo "usage: $0 (start|stop|restart|fullstatus|status|graceful|configtest|help)"
	cat <<EOF

start      - start httpd
stop       - stop httpd
restart    - restart httpd if running by sending a SIGHUP or start if 
             not running
fullstatus - dump a full status screen; requires lynx and mod_status enabled
status     - dump a short status screen; requires lynx and mod_status enabled
graceful   - do a graceful restart by sending a SIGUSR1 or start if not running
configtest - do a configuration syntax test
help       - this screen

EOF
	ERROR=2
    ;;

    esac

done

exit $ERROR

# ====================================================================
# Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer. 
# 
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 
# 3. All advertising materials mentioning features or use of this
#    software must display the following acknowledgment:
#    "This product includes software developed by the Apache Group
#    for use in the Apache HTTP server project (http://www.apache.org/)."
# 
# 4. The names "Apache Server" and "Apache Group" must not be used to
#    endorse or promote products derived from this software without
#    prior written permission. For written permission, please contact
#    apache@apache.org.
# 
# 5. Products derived from this software may not be called "Apache"
#    nor may "Apache" appear in their names without prior written
#    permission of the Apache Group.
#
# 6. Redistributions of any form whatsoever must retain the following
#    acknowledgment:
#    "This product includes software developed by the Apache Group
#    for use in the Apache HTTP server project (http://www.apache.org/)."
# 
# THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of the Apache Group and was originally based
# on public domain software written at the National Center for
# Supercomputing Applications, University of Illinois, Urbana-Champaign.
# For more information on the Apache Group and the Apache HTTP server
# project, please see <http://www.apache.org/>.
# 

ServerRoot "/home/perlbug"
DocumentRoot "/home/perlbug/public_html"
PidFile /home/perlbug/spool/logs/httpd.pid
LockFile /home/perlbug/spool/httpd.lock
ErrorLog /home/perlbug/spool/logs/error_log
ScoreBoardFile /home/perlbug/spool/logs/httpd.scoreboard
Timeout 300
KeepAlive Off
MinSpareServers 2
MaxSpareServers 5
StartServers 4
MaxClients 7
MaxRequestsPerChild 500
User perlbug 
Group perlbug
# Listen 127.0.0.1:8777
# Port 8777
Listen 8777
serveradmin richard@perl.org
ServerName bugs.perl.org 

#LoadModule mmap_static_module libexec/mod_mmap_static.so
#LoadModule vhost_alias_module libexec/mod_vhost_alias.so
LoadModule env_module         libexec/mod_env.so
LoadModule config_log_module  libexec/mod_log_config.so
LoadModule mime_magic_module  libexec/mod_mime_magic.so
LoadModule mime_module        libexec/mod_mime.so
LoadModule negotiation_module libexec/mod_negotiation.so
LoadModule status_module      libexec/mod_status.so
LoadModule info_module        libexec/mod_info.so
#LoadModule includes_module    libexec/mod_include.so
LoadModule autoindex_module   libexec/mod_autoindex.so
LoadModule dir_module         libexec/mod_dir.so
LoadModule cgi_module         libexec/mod_cgi.so
#LoadModule asis_module        libexec/mod_asis.so
#LoadModule imap_module        libexec/mod_imap.so
LoadModule action_module      libexec/mod_actions.so
#LoadModule speling_module     libexec/mod_speling.so
LoadModule userdir_module     libexec/mod_userdir.so
LoadModule alias_module       libexec/mod_alias.so
LoadModule rewrite_module     libexec/mod_rewrite.so
LoadModule access_module      libexec/mod_access.so
LoadModule auth_module        libexec/mod_auth.so
#LoadModule anon_auth_module   libexec/mod_auth_anon.so
#LoadModule db_auth_module     libexec/mod_auth_db.so
#LoadModule digest_module      libexec/mod_digest.so
#LoadModule proxy_module       libexec/libproxy.so
#Loadmodule cern_meta_module   libexec/mod_cern_meta.so
LoadModule expires_module     libexec/mod_expires.so
LoadModule headers_module     libexec/mod_headers.so
#LoadModule usertrack_module   libexec/mod_usertrack.so
LoadModule unique_id_module   libexec/mod_unique_id.so
LoadModule setenvif_module    libexec/mod_setenvif.so
LoadModule perl_module        libexec/libperl.so

<Directory />
    Options FollowSymLinks 
    AllowOverride None
</Directory>

<Directory "/home/perlbug/public_html">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>

# PerlModule Apache::Filter
# PerlRequire Perlbug/Interface/Web.pm
# PerlModule Perlbug/Interface/Web.pm
# PerlRequire "/home/perlbug/Live/Perlbug/Interface/Web.pm"

<Files ~ "\.cgi$">
	SetHandler perl-script
	PerlHandler Apache::Registry
    # PerlSendHeader On
	Options +ExecCGI
</Files>

ExtendedStatus On

<Location /admin/server-status>
    SetHandler server-status
    Order allow,deny
    Allow from all
</Location>

<Location /admin/server-info>
    SetHandler server-info
    Order allow,deny
    Allow from all
</Location>

<IfModule mod_dir.c>
    DirectoryIndex index index.html
</IfModule>

AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

UseCanonicalName On
DefaultType text/html
HostnameLookups Off

CustomLog /home/perlbug/spool/logs/access_log combined
LogLevel warn
LogFormat "%h %l %u %t %{site}n \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
ServerSignature On

<IfModule mod_alias.c>
    Alias /icons/ "/usr/local/share/apache/icons/"
    <Directory "/usr/local/share/apache/icons/">
	Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

</IfModule>

# Redirect old-URI new-URL

<IfModule mod_autoindex.c>
    IndexOptions FancyIndexing
    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*

    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core

    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^
    DefaultIcon /icons/unknown.gif

    ReadmeName README
    HeaderName HEADER
    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

</IfModule>

<IfModule mod_mime.c>
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz
    AddLanguage da .dk
    AddLanguage nl .nl
    AddLanguage en .en
    AddLanguage et .ee
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage he .he
    AddCharset ISO-8859-8 .iso8859-8
    AddLanguage it .it
    AddLanguage ja .ja
    AddCharset ISO-2022-JP .jis
    AddLanguage kr .kr
    AddCharset ISO-2022-KR .iso-kr
    AddLanguage no .no
    AddLanguage pl .po
    AddCharset ISO-8859-2 .iso-pl
    AddLanguage pt .pt
    AddLanguage pt-br .pt-br
    AddLanguage ltz .lu
    AddLanguage ca .ca
    AddLanguage es .es
    AddLanguage sv .se
    AddLanguage cz .cz
    AddLanguage ru .ru
    AddLanguage tw .tw
    AddCharset Big5         .Big5    .big5
    AddCharset WINDOWS-1251 .cp-1251
    AddCharset CP866        .cp866
    AddCharset ISO-8859-5   .iso-ru
    AddCharset KOI8-R       .koi8-r
    AddCharset UCS-2        .ucs2
    AddCharset UCS-4        .ucs4
    AddCharset UTF-8        .utf8
    <IfModule mod_negotiation.c>
        LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
    </IfModule>

    TypesConfig /usr/local/etc/apache/mime.types

    #AddType application/x-httpd-php .php
    #AddType application/x-httpd-php-source .phps
    #AddType  application/vnd.sun.xml.impress .sxi
    AddType application/x-tar .tgz
    AddType text/plain .pod

    AddHandler cgi-script .cgi
    #AddType text/html .shtml
    #AddHandler server-parsed .shtml

    #AddHandler send-as-is asis
    #AddHandler imap-file map

</IfModule>

#MetaDir .web
#MetaSuffix .meta
#ErrorDocument 500 "The server made a boo boo.
#ErrorDocument 404 /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
#ErrorDocument 402 http://some.other_server.com/subscription_info.html

<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule>

#NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

