To the Brass 
Cannon Webboard
Established 1986

Kevin Martin - PO Box 82783 - Portland, OR 97282

Content Site APACHE httpd.conf

(includes PHP 4.0.3 and AltaVista Search proxy support)

Items in red are PHP changes
Items in blue are AltaVista changes Items in green are virtual hosts
##
## httpd.conf -- Apache HTTP server configuration file
##

### Section 1: Global Environment
ServerType standalone
ServerRoot "/opt/apache"
#LockFile /var/lock/apache/httpd.lock
PidFile /var/lock/apache/httpd.pid
ScoreBoardFile /var/lock/apache/httpd.scoreboard
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0

BindAddress 192.168.11.40
Listen 192.168.11.40:1080
Listen 192.168.11.39:1080

#
# Dynamic Shared Object (DSO) Support
#
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 dbm_auth_module    libexec/mod_auth_dbm.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 php4_module        libexec/libphp4.so
LoadModule avsproxy_module    libexec/mod_avsproxy.so

#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_dbm.c
AddModule mod_digest.c
AddModule mod_proxy.c
AddModule mod_cern_meta.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_php4.c
AddModule mod_avsproxy.c

ExtendedStatus On

### Section 2: 'Main' server configuration
Port 1080
User nobody
Group nobody

ServerAdmin webmaster@oursite.com
ServerName 63.95.232.12  # main.oursite.com

DocumentRoot "/httpd/htdocs"

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

<Directory "/httpd/htdocs">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

DirectoryIndex index.phtml
#DirectoryIndex index.html

<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

#<Directory /home/*/public_html>
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS PROPFIND>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <LimitExcept GET POST OPTIONS PROPFIND>
#        Order deny,allow
#        Deny from all
#    </LimitExcept>
#</Directory>

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
#<IfModule mod_dir.c>
#    DirectoryIndex index.html
#</IfModule>

#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess

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

#CacheNegotiatedDocs

#
# UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a URL that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name.  With this setting off, Apache will
# use the hostname:port that the client supplied, when possible.  This
# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
#
UseCanonicalName On

#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
<IfModule mod_mime.c>
    TypesConfig /httpd/conf/mime.types
</IfModule>

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile /httpd/conf/magic
</IfModule>

HostnameLookups Off

ErrorLog /var/log/apache/error_log
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#CustomLog /var/log/apache/access_log common
#CustomLog /var/log/apache/referer_log referer
#CustomLog /var/log/apache/agent_log agent
CustomLog /var/log/apache/access_log combined

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (error documents, FTP directory listings,
# mod_status and mod_info output etc., but not CGI generated documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature On

#
# Aliases: Add here as many aliases as you need (with no limit). The format is 
# Alias fakename realname
#
<IfModule mod_alias.c>
    Alias /icons/ "/opt/apache/icons/"
    <Directory "/opt/apache/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    ScriptAlias /cgi-bin/ "/httpd/cgi-bin/"
    <Directory "/httpd/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

</IfModule>
# End of aliases.

<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
    #AddDescription "GZIP compressed document" .gz
    #AddDescription "tar archive" .tar
    #AddDescription "GZIP compressed tar archive" .tgz
    ReadmeName README
    HeaderName HEADER
    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

</IfModule>
# End of indexing directives.

#
# Document types.
#
<IfModule mod_mime.c>
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz

    AddLanguage en .en
    AddLanguage fr .fr
    AddLanguage es .es

    <IfModule mod_negotiation.c>
        LanguagePriority en es fr
    </IfModule>

    AddType application/x-httpd-php .phtml .php
    AddType application/x-httpd-php-source .phps

    AddType application/x-tar .tgz

</IfModule>
# End of document types.

#MetaDir .web
#MetaSuffix .meta

#ErrorDocument 500 "The server made a boo boo.
#  n.b.  the (") marks it as text, it does not get output
#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>

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from .ct.oursite.com
    Allow from 192.168.3.153 # kevin's PC - no reverse dns
</Location>

<Location /server-info>
    SetHandler server-info
    Order deny,allow
    Deny from all
    Allow from .ct.oursite.com
    Allow from 192.168.3.153 # kevin's PC - no reverse dns
</Location>

# THIS DIRECTIVE establishes the PATH for all PHP includes:
php_value include_path \
   "/httpd/php_oursite:/httpd/php_common:/httpd/php:."
# See important "Problem" notes below!!  - KM 11/02/00


### Section 3: Virtual Hosts
NameVirtualHost 192.168.11.40:1080

<VirtualHost 192.168.11.40:1080>
 ServerName main.oursite.com
 DocumentRoot "/httpd/htdocs"
 DirectoryIndex index.phtml
# NOTE: This php_value directive is the same as the one 
# above, which has global scope:
# php_value include_path \
#   "/httpd/php_oursite:/httpd/php_common:/httpd/php:."
 ErrorLog /var/log/apache/error_log
 CustomLog /var/log/apache/access_log common
</VirtualHost>

# Problem: It appears that the VirtualHost container
# does not limit the scope of a php_value statement, 
# so the first one encountered is applied globally.
# To avoid confusion, I have placed the directive
# outside the container.
#
# However, we can still run multiple virtual sites
# that do not use PHP, or that use only the common 
# PHP path.
#
# Because of the above, we have to run a separate 
# httpd "mother" process for the prototype site, 
# and give it a different IP.  To do that, I uncomment
# the block below and start httpd with the -f switch
# (to point it to its own separate httpd.conf file):
#
#<VirtualHost 192.168.11.39:1080>
# ServerName prototype.oursite.com
# DocumentRoot "/httpd/prototype"
# DirectoryIndex index.phtml
# php_value include_path \
#   "/httpd/php_prototype:/httpd/php_common:/httpd/php:."
# ErrorLog /var/log/apache/prototype-error_log
# CustomLog /var/log/apache/prototype-access_log common
#</VirtualHost>

# Sample Virtual pages to demo a shared IP - these work
# when included as part of the "main" site's httpd.conf:
# Wombat & Marsupial Credit Union
<VirtualHost 192.168.11.38:1080>
 ServerName wombat.oursite.com
 DocumentRoot "/httpd/htdocs/wombat"
 DirectoryIndex index.html
 ErrorLog /var/log/apache/error_log
 CustomLog /var/log/apache/access_log common
</VirtualHost>

# Joe's Bar & Grill (and Tax Service)
<VirtualHost 192.168.11.38:1080>
 ServerName joes.oursite.com
 DocumentRoot "/httpd/htdocs/joes"
 DirectoryIndex index.html
 ErrorLog /var/log/apache/error_log
 CustomLog /var/log/apache/access_log common
</VirtualHost>
#
# Note that we had to include "Listen" directives for 
# both these addresses in order for 'main' to work!
# End of 11/02/00 notes.

# AltaVista query stuff:
AvsProxyMhttpd main.oursite.com 9000
AvsProxyBasehost main.oursite.com:1080/
<Location /cgi-bin/query>
SetHandler avsproxy
</Location>
<Location /cgi-bin/newurl>
SetHandler avsproxy
AuthType Basic
AuthName "AltaVista Search Management Interface"
AuthUserFile /httpd/conf/avs.htpasswd
AuthGroupFile /httpd/conf/avs.htgroup
require group mgt
</Location>
<Location /mui>
SetHandler avsproxy
AuthType Basic
AuthName "AltaVista Search Management Interface"
AuthUserFile /httpd/conf/avs.htpasswd
AuthGroupFile /httpd/conf/avs.htgroup
require group mgt
</Location>
<Location /av>
SetHandler avsproxy
</Location>
<Location /icons>
SetHandler avsproxy
</Location>
<Location /pix>
SetHandler avsproxy
</Location>
<Location /tmpl>
SetHandler avsproxy
</Location>
<Location /version.html>
SetHandler avsproxy
</Location>


Please Note

If a search engine dropped you directly into this document, you should go to the index page to find out what you're reading. This document is a record of a project from 1999-2000 -- it is not a current guide to installing any software product.