I have a virtual machine running Apache 2 and am having the worst time attempting to set up multiple name based virtual hosts. Basically as soon as I upload and enable a new virtual host file in the sites-enabled folder the entire web server stops responding. It won't start, I can't connect to it from a web browser, and it won't start back up again until I remove the file. Here are the steps I am following:
- Creating a new VirtaualHost file and uploading it to etc/apache2/sites-enabled, VirtualHost file looks like the code below and is named www.glutenfreaks.com:
ServerAdmin firstname.lastname@example.org ServerName www.glutenfreaks.com ServerAlias glutenfreaks.com
# Indexes + Directory Root. DirectoryIndex index.php DocumentRoot /var/www/glutenfreaks/ # CGI Directory ScriptAlias /cgi-bin/ /var/www/glutenfreaks/cgi-bin <Location /cgi-bin> Options +ExecCGI </Location> # Logfiles ErrorLog /var/www/glutenfreaks/logs/error.log CustomLog /var/www/glutenfreaks/logs/access.log combined
From the command line I'm then executing "a2ensite www.glutenfreaks.com"
Then I reload the server: "/etc/init.d/apache2 reload"
And then everything goes boom and nothing works anymore.