STEP 1: ADD THIS TO YOUR HTTPD.CONF AT THE VERY BOTTOM:
Include /etc/apache2/virtualhosts.conf
Include /etc/apache2/virtualhosts/*.conf
STEP 2: mkdir /etc/apache2/virtualhosts/
STEP 3: create /etc/apache2/virtualhosts.conf file with the following:
-- start --
# virtualhosts.conf file for virtual web hosting customers
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
NameVirtualHost *:80
-- end --
STEP 4: create a virtualhost in the /etc/apache2/virtualhosts/ directory for your web site:
I have created: /etc/apache2/virtualhosts/lab.whatever.com.conf
NOTE: you need the .conf on the end because the include in the httpd.conf looks for all the files in virtualhosts directory that end in .conf
-- start /etc/apache2/virtualhosts/lab.whatever.com.conf --
DocumentRoot /websites/lab.whatever.com/
ServerName lab.whatever.com
ServerAdmin support@whatever.com
LogFormat combined
ErrorLog /var/log/httpd/lab.whatever.com-error.log
TransferLog /var/log/httpd/lab.whatever.com.log
HostNameLookups off
Options All
AllowOverride All FileInfo
Order allow,deny
Allow from all
-- end --