Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

  1. 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 evomoore@gmail.com 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

  1. From the command line I'm then executing "a2ensite www.glutenfreaks.com"

  2. Then I reload the server: "/etc/init.d/apache2 reload"

And then everything goes boom and nothing works anymore.

Help??

Thanks,

Evan

share|improve this question
add comment

2 Answers 2

what happens when you do apache2ctl configtest ? and what do you see in /var/log/apache2/error.log

share|improve this answer
1  
I'm assuming you took out the necessary stuff with <VirtualHost> </VirtualHost> from your paste.. –  Vid Luther Jul 22 '10 at 2:53
add comment

Your apache not responding because he can`t load his config-file.

The first thing you must do - remember if you do something else mentioned here.

The next one - #tail /var/log/apache2/error.log, if you enabled apache error log. If you don`t, enable it and start apache.

BTW, the Syntax of VirtualHost directive is <VirtualHost addr[:port] [addr[:port]] ...>...</VirtualHost> - ie <VirtualHost 10.1.2.3>...</VirtualHost>. Maybe you need write the right host?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.