This has been discussed on the documentation list, and it was
recommended that the discussion be continued here if anyone intended to
do anything about it.

I've heard complaints, and had a few difficulties myself, with regard to
httpd.conf. These complaints are on two fronts:

1) Although it is great to have such copious comments that any moron can
pick up the file and figure out what they need to change, if you've been
running Apache for a few years, those comments just become a nuisance.
Wouldn't it be nice to have a trimmed-down httpd.conf file that was more
signal, less noise?

2) The organization of the file is somewhat confusing. Directives that
are related do not necessarily appear together, and the directives that
you are most likely to change in a basic installation (ServerName,
ServerAdmin, Port, etc) are buried deep in the file. Perhaps either a
reorganization, or at least a table of contents, would be helpful.

I raised these points on the docs list, and Ken was quick to point out
that the organization of the file was done after much deliberation by a
number of people who know Apache very well. (I think I used the word
"random", which was a great exaggeration.)

Suggestions that have been made are: To provide a httpd.conf.expert
file, which contains the bare minimum of comments. To provide a
/samples/ subdirectory of conf, containing examples of how one might
accomplish various things. To slightly rearrange the file to move
commonly-changed directives to the top where they are easily accessible.

I've attached a httpd.conf file which is essentially what I use on my
installations, because it removes a lot of the comments that are no
longer helpful to me, and moves some of the directives around so that
the placement makes more sense to me.

Comments?

Rich
-- 
Author: Apache Server Unleashed - www.apacheunleashed.com
Director of Web Application Development - http://www.cre8tivegroup.com/
# Global Environment

#ServerName new.host.name
UseCanonicalName On
Port 80
User nobody
Group #-1
ServerAdmin [EMAIL PROTECTED]
ServerType standalone
#Listen 3000
#Listen 12.34.56.78:80

# File paths
DocumentRoot "@@ServerRoot@@/htdocs"
ServerRoot "@@ServerRoot@@"
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_runtime_status

# Performance
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

# Server pool
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0

# Modules
# LoadModule foo_module libexec/mod_foo.so

#ExtendedStatus On

# Per-directory settings

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

AccessFileName .htaccess

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

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

<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>

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

# Mime types
<IfModule mod_mime.c>
    TypesConfig conf/mime.types
</IfModule>

DefaultType text/plain

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

# Logging
HostnameLookups Off
ErrorLog logs/error_log
LogLevel warn

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 logs/access_log common
#CustomLog logs/referer_log referer
#CustomLog logs/agent_log agent
#CustomLog logs/access_log combined

ServerSignature On

# Aliases
<IfModule mod_alias.c>
    Alias /icons/ "@@ServerRoot@@/icons/"
    <Directory "@@ServerRoot@@/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

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

</IfModule>

# Redirects
# Redirect old-URI new-URL
#

# Directory indexes
<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>

# Document types
<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>

    #AddType application/x-httpd-php3 .php3
    #AddType application/x-httpd-php3-source .phps
    #AddType application/x-httpd-php .php
    #AddType application/x-httpd-php-source .phps
    AddType application/x-tar .tgz

    #AddHandler cgi-script .cgi
    #AddType text/html .shtml
    #AddHandler server-parsed .shtml
    #AddHandler send-as-is asis
    #AddHandler imap-file map
    #AddHandler type-map var
</IfModule>

# Custom error messages
#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

# Customize behaviour based on the browser
<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>

# Server status and information
#<Location /server-status>
#    SetHandler server-status
#    Order deny,allow
#    Deny from all
#    Allow from .your_domain.com
#</Location>

#<Location /server-info>
#    SetHandler server-info
#    Order deny,allow
#    Deny from all
#    Allow from .your_domain.com
#</Location>

# Proxy server
#<IfModule mod_proxy.c>
#    ProxyRequests On

#    <Directory proxy:*>
#        Order deny,allow
#        Deny from all
#        Allow from .your_domain.com
#    </Directory>

#    ProxyVia On
#    CacheRoot "@@ServerRoot@@/proxy"
#    CacheSize 5
#    CacheGcInterval 4
#    CacheMaxExpire 24
#    CacheLastModifiedFactor 0.1
#    CacheDefaultExpire 1
#    NoCache a_domain.com another_domain.edu joes.garage_sale.com
#</IfModule>

# Virtual Hosts

#NameVirtualHost *

#<VirtualHost *>
#    ServerAdmin [EMAIL PROTECTED]
#    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>

Reply via email to