Apache on Debian Squeeze Notes
# ls /etc/apache2 apache2.conf envvars magic mods-enabled sites-available conf.d httpd.conf mods-available ports.conf sites-enabled
Content is placed in sites-available and is made live by creating a link to it in sites-enabled.
/etc/init.d/apache2 restartApache Name-based Virtual Hosts on Debian Squeeze
Name-based virtual hosting allows multiple hosts to share the same IP address.
Enabling name-based virtual hosts
Name-based virtual hosting is enabled for each IP address and port in /etc/apache2/ports.conf
NameVirtualHost *:80 Listen 80
You could also create a file in /etc/apache2/conf.d as Apache reads all files in here on startup.
Configuring virtual hostsCreate a file for each in /etc/apache2/sites-available and enable them by...
For example /etc/apache2/sites-available/alasdairsmith.com
<VirtualHost *:80> ServerName alasdairsmith.com ServerAlias www.alasdairsmith.com DocumentRoot /var/www/alasdairsmith.com/public_html/ </VirtualHost>
Enabling and disabling sites
Sites are enabled by creating a symbolic link in sites-enabled/ to the file in sites-available/. The Debian Apache package provides two utilities a2ensite and a2dissite to do this for you.
Reload or restart Apache
Reload /etc/init.d/apache2 reload or restart /etc/init.d/apache2 restart Apache for the changes to take effect