Virtual Host problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Virtual Host problem

Postby kosh » 30. June 2010 12:51

Hi All,

I have been going through David Powers yet to be published book on Dreamwever CS5 with PHP, via the Creative Edge website) and have got to the point of creating virtual hosts for my websites. I have added the lines below to httpd-vhosts.conf as stated in the book:

<Directory C:/vhosts>
Order Deny,Allow
Allow from all
</Directory>

and now Apache will not start (through XAMPP Control Panel). I rremolvbe these lines and Apache starts OK again. The Error Log contains the line:

"httpd.exe: Syntax error on line 484 of C:/xampp/apache/conf/httpd.conf: Syntax error on line 53 of C:/xampp/apache/conf/extra/httpd-vhosts.conf: </Directory> without matching <Directory> section"

I have tried a few things (including changing the C:/ to C:\) but top no effect. The exact same lines above are also in his previous book, Dreamweaver CS4 with CSS, Ajax and PHP, so it cannot be a typing error.

I am stuck, any ideas ?

I am using Windows 7 Home Premium 64-bit with XAMPP 1.7.3.

Cheers,
Alan Taylor
England
kosh
 
Posts: 2
Joined: 30. June 2010 12:37

Re: Virtual Host problem

Postby JonB » 30. June 2010 17:55

Look in the examples in /apache/conf/extra/httpd-vhosts.conf

This is from my server, the directory location is a quoted string:

Code: Select all
<Directory "C:/xampp/sites">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>
:shock:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Virtual Host problem

Postby BigWetDog » 02. July 2010 14:13

The syntax for the lines you've posted are correct. Can you post more of your httpd-vhosts.conf (namely everything after about line 44)?
User avatar
BigWetDog
 
Posts: 148
Joined: 25. February 2010 15:54

Re: Virtual Host problem

Postby JonB » 02. July 2010 15:47

I missed this the first time around - you know - that error message is quoting two source problems:

There is 1st a problem in httpd.conf at line 484 --- then there is a problem in the httpd-vhosts.conf. They may well be related.

:shock:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Virtual Host problem

Postby BigWetDog » 02. July 2010 15:51

Jon,
It's kind of like a stack trace. If you check your httpd.conf you'll find that about line 484 is the include for extra/httpd-vhosts.conf so the error is in httpd-vhosts.conf. We just need to see line 53 of that file in context in order to help.
User avatar
BigWetDog
 
Posts: 148
Joined: 25. February 2010 15:54

Re: Virtual Host problem

Postby kosh » 03. July 2010 00:01

Thanks for all the ideas. I tried the quotes without success and a few other things but then i thought i may have made an error ealier on, so i decided to re-install XAMPP from scratch and repeat all the changes and test at each stage. Then, of course, it all worked fine !!!

Frustrating, as not knowing the error means i can't learn from it, but at least the virtual hosts are working at the moment.

Many thanks for all your help and suggestions.

Cheers,
Kosh
kosh
 
Posts: 2
Joined: 30. June 2010 12:37


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 55 guests