NameVirtualHost * <VirtualHost *> DocumentRoot /web/example.com/www ServerName www.example.com ServerAlias example.com CustomLog /web/example.com/logs/access.log combined ErrorLog /web/example.com/logs/error.log </VirtualHost>
Include /etc/apache/virtual-hosts/*.conf
ServerSignature Off ServerTokens Prod
ErrorDocument 404 /404.html
Alias /common /web/common
Redirect permanent /old http://example.com/new
ScriptAlias /cgi-bin/ /web/cgi-bin/
AddHandler cgi-script .cgi
DirectoryIndex index.cfm index.cfm
Options -Indexes
<Location /images> Options +Indexes </Location>
htpasswd -c /etc/apacheusers
AuthName "Authentication Required" AuthType Basic AuthUserFile /etc/apacheusers Require valid-user
Order Deny,Allow Deny from all Allow from 127.0.0.1
Order Deny,Allow Deny from all Allow from 176.16.0.0/16
mod_rewrite
RewriteEngine On
RewriteRule ^/news/([0-9]+)$ /news.cfm?id=$1 [PT,L]
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://example.com$1 [R=301,L]
This is a work in progress - Questions, comments, criticism, or requests can be directed Here
Copyright © 2005 Peter Freitag (http://www.petefreitag.com/), All Rights Reserved.
This document may be printed freely as long as this notice stays intact.