Skip to content

Instantly share code, notes, and snippets.

@tylerflint
Created August 31, 2011 23:12
Show Gist options
  • Save tylerflint/1185015 to your computer and use it in GitHub Desktop.
Save tylerflint/1185015 to your computer and use it in GitHub Desktop.
web1 httpd.conf
#############################################
# Base Apache Server Configuration #
#############################################
User apache
Group apache
ServerAdmin root@localhost
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 300
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
StartServers 10
MinSpareServers 8
MaxSpareServers 150
ServerLimit 256
MaxClients 512
MaxRequestsPerChild 4000
Listen *:443
Listen *:8080
#############################################
# Dynamic Apache Modules #
#############################################
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule mime_module modules/mod_mime.so
LoadModule dir_module modules/mod_dir.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule headers_module modules/mod_headers.so
LoadModule alias_module modules/mod_alias.so
LoadModule actions_module modules/mod_actions.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule mysql_auth_module modules/mod_auth_mysql.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule status_module modules/mod_status.so
# Load config files from the config directory "/etc/httpd/conf.d".
Include conf.d/*.conf
#############################################
# Default Server Configuration #
#############################################
UseCanonicalName On
DocumentRoot "/var/www/html"
DirectoryIndex index.php index.html
AccessFileName .htaccess
TypesConfig /etc/mime.types
DefaultType text/plain
HostnameLookups Off
# add gzip compression
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/x-javascript
# add far future expires to header; cache for 480 weeks; remove last modified header
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2015 20:00:00 GMT"
Header set Cache-Control "max-age=290304000, public"
Header unset Last-Modified
</FilesMatch>
# unset header Etags
Header unset ETag
FileETag None
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
DirectoryIndex index.php index.html
</Directory>
<Directory "/var/www/html">
AllowOverride None
Order deny,allow
Deny from all
Allow from 24.116.177.210 98.189.32.110 76.172.186.233 174.133.130.18
</Directory>
<Directory "/var/www/demos">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/test">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/pear">
AllowOverride All
Options +Indexes
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/blog">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/delorum-cart">
AllowOverride All
order allow,deny
Allow from all
</Directory>
<Directory "/var/www/dev-tinybrick">
AllowOverride All
order allow,deny
Allow from all
</Directory>
<Directory "/var/www/pagecachedemo">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/demo13">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/demo14">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/demo14punch">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/speedbooster-demo">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Location>
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
<IfModule mod_userdir.c>
UserDir disable
</IfModule>
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
#############################################
# Logging Configuration #
#############################################
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 combined
#############################################
# Language/Charset Configuration #
#############################################
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
ForceLanguagePriority Prefer Fallback
AddDefaultCharset UTF-8
#############################################
# MIME Type/Handler Configuration #
#############################################
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler type-map var
#############################################
# Browser Response Configuration #
#############################################
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
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
#############################################
# VirtualHost Configuration #
#############################################
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot /var/www/html
ServerName web1.delorum.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/demos
ServerName demos.delorum.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/test
ServerName test.delorum.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/pear
ServerName pear.delorum.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/blog
ServerName blog.delorumcommerce.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/redmarble-blog
ServerName redmarble-blog.delorum.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/delorum-cart
ServerName store.delorumcommerce.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/demo13
ServerName lightspeed-demo.delorumcommerce.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/demo13
ServerName demo13.delorumcommerce.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/demo14
ServerName demo14.delorumcommerce.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/demo14punch
ServerName demo14punch.delorumcommerce.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/speedbooster-demo
ServerName speedbooster-demo.delorumcommerce.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/pagecachedemo
ServerName pagecachedemo.delorumcommerce.com
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXP:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/bin/store.delorumcommerce.com.crt
SSLCertificateKeyFile /usr/bin/store.delorumcommerce.key
SSLCertificateChainFile /usr/bin/gd_bundle.crt
ServerAdmin admin@delorumcommerce.com
DocumentRoot /var/www/delorum-cart
ServerName store.delorumcommerce.com
ErrorLog /var/log/httpd/store.delorumcommerce.com-ssl-error_log
CustomLog /var/log/httpd/store.delorumcommerce.com-ssl-access_log common
<Directory "/var/www/delorum-cart">
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /var/www/dev-tinybrick
ServerName dev.tinybrick.com
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment