Apache Cheat Sheet
Apache Cheat Sheet
Setup a Virtual Domain
NameVirtualHost *
DocumentRoot /web/example.com/wwwServerName www.example.comServerAlias example.comCustomLog /web/example.com/logs/access.log combinedErrorLog /web/example.com/logs/error.log
Include another conf file
Include /etc/apache/virtual-hosts/*.conf
Hide apache version info
ServerSignature OffServerTokens Prod
Custom 404 Error message
ErrorDocument 404 /404.html
Create a virtual directory (mod_alias)
Alias /common /web/common
Perminant redirect (mod_alias)
Redirect permanent /old http://example.com/new
Create a cgi-bin
ScriptAlias /cgi-bin/ /web/cgi-bin/
Process .cgi scripts
AddHandler cgi-script .cgi
Add a directory index
DirectoryIndex index.cfm index.cfm
Turn off directory browsing
Options -Indexes
Turn [...]
Apache Cheat Sheet
Apache Cheat Sheet
Setup a Virtual Domain
NameVirtualHost *DocumentRoot /web/example.com/wwwServerName www.example.comServerAlias example.comCustomLog /web/example.com/logs/access.log combinedErrorLog /web/example.com/logs/error.log
Include another conf file
Include /etc/apache/virtual-hosts/*.conf
Hide apache version info
ServerSignature OffServerTokens Prod
Custom 404 Error message
ErrorDocument 404 /404.html
Create a virtual directory (mod_alias)
Alias /common /web/common
Perminant redirect (mod_alias)
Redirect permanent /old http://example.com/new
Create a cgi-bin
ScriptAlias /cgi-bin/ /web/cgi-bin/
Process .cgi scripts
AddHandler cgi-script .cgi
Add a directory index
DirectoryIndex index.cfm index.cfm
Turn off directory browsing
Options -Indexes
Turn [...]