Show Menu

Apache 2+ for Unix Cheat Sheet (DRAFT) by

Commands and httpd.conf basics for dummies

This is a draft cheat sheet. It is a work in progress and is not finished yet.

apachectl (Control Interface)

[ start|­res­tar­t|g­rac­efu­l|stop ]
List compiled modules.
Lists configured vhosts.
Test config file syntax.
Show version number.

ab (Apache Bench)

-n [number]
Number of requests to perform.
-c [number]
Number od concur­rents requests.
-v [number]
Level of verbosity.
Out result in html.
Out result in CSV.
This binary has the function to make a perfor­mance test of your apache instal­lation.

Virtua­lHost section

ServerName "­Vir­tua­lHo­stN­ame­"
DNS name for Virtua­lHost.
Docume­ntRoot "­/pa­th/­to/­htd­ocs­"
Path to virtual host web files.
An Apache can serve many web sites thanks to the Virtual Hosts.

httpd.conf parameters

ServerRoot "­/pa­th/­to/­apa­che­"
Where are the instance of Apache installed.
Listen [port]
Enables the listening of port by Apache.
PidFile "­/pa­th/­to/­fil­e"
File that content the PID of Apache process.
Timeout [number]
Timeout for apache connec­tions
LoadModule [mod_file]
Load of Apache module
Server­Admin "­mai­l@a­ddr­es.i­s"
Set the admin mail address to show in Apache errors.
Docume­ntRoot "­/pa­th/­to/­htd­ocs­"
Set the folder that contain the web files, wwwroot in IIS.
Direct­ory­Index "­fil­e.e­xte­nsi­on"
Set the by default Index file in case of not exists (commonly index.php or index.h­tml)
ErrorLog "­pat­h/t­o/e­rro­r_l­og"
Set the error log file.
Server­Sig­nature Off
Doesn't appears the Apache version in http headers.
NameVi­rtu­alHost "­Vir­tua­lHo­st"
Enable the Virtua­lHost, it needs a Virtua­lHost section before.
Can find all Apache2+ directives in the official Apache2 docume­ntation site: http:/­/ht­tpd.ap­ach­e.o­rg/­docs/