Apache virtual hosting with aliases
For Debian/Ubuntu default installation no need to add NameVirtualHost directive.
working configuration:
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/path
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from none
ErrorLog ${APACHE_LOG_DIR}/error-yourdomain.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel error
CustomLog ${APACHE_LOG_DIR}/access-yourdomain.log combined