Virtual hosts have stopped working, WinXP, Apache 2

Discussion in 'Apache' started by barney_dpf, Nov 20, 2008.

  1. #1
    Last month - October, 2008 - I set up virtual hosting according to the instructions here: http://wamp.corephp.co.uk/index.php.

    It worked.

    Now it doesn't.

    And I cannot determine why.

    I'm on a WinXP Media Center box with SP3 installed. I'm trying to use virtual hosting to make moving files between the development box and a remote hosting server simpler by having my PHP scripts recognize where they are and setting path, URL, and other such items according to that location. Apache, PHP and MySQL are working fine as long as I use the main host, but any attempt to use a virtual host fails.

    Apache 2.2.10
    PHP 5.2.6
    MySQL 5.0.67
    MySQL client 5.0.51a

    My hosts file has
    127.0.0.1	localhost	
    127.0.0.1	sandbox.dev	
    127.0.0.1	www.sandbox.dev	
    
    Code (markup):
    httpd.conf has
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
    
    Code (markup):
    httpd-vhosts.conf has
    
    NameVirtualHost *:80
    
    <VirtualHost *:80>
    	DocumentRoot C:/www
    	ServerName 3ggwxpm
    	ServerAlias localhost
    	ErrorLog C:/www/www_logs/error_log.txt
    	CustomLog C:/www/www_logs/access_log.txt common
    	php_value error_log "C:/www/php_error_log.txt"
    	<Directory "C:/www">
    	 	AllowOverride All
    	 	Options Indexes FollowSymLinks
    	 	Order allow,deny
    	 	Allow from all
    	</Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
    	DocumentRoot C:/www/sandbox.dev/public_html
    	ServerName sandbox.dev
    	ServerAlias sandbox.dev *.sandbox.dev
    	ErrorLog C:/www/sandbox.dev/www_logs/error_log.txt
    	CustomLog C:/www/sandbox.dev/www_logs/access_log.txt common
    	php_value error_log "C:/www/sandbox.dev/php_error_log.txt"
    	<Directory "C:/www/sandbox.dev/public_html">
    	 	AllowOverride All
    	 	Options Indexes FollowSymLinks
    	 	Order allow,deny
    	 	Allow from all
    	</Directory>
    </VirtualHost>
    
    Code (markup):
    Everything I've been able to find on the problem indicates this configuration should work. And it did when I first set it up. But when I try to use it now, I get an error. If I use
    http://sandbox.dev/
    Code (markup):
    , the error is:
    I've checked the Apache docs, performed several different Google searches, but everything I've found says this should be working, and none of the fixes that I've found in any of the vhost posts has helped.

    I've been banging on this all week, to the exclusion of other work, but nothing seems to be effective.

    Oh, yeah ... the only thing that has changed anent the server was an [unsuccessful] attempt to get PHP-GTK2 working so I could install ZIM. However, I cannot see any changes that attempt made that should affect this.

    Does anyone have some straw I might grasp? Now that this has ceased to function, I really want to find out why, and fix it.
     
    barney_dpf, Nov 20, 2008 IP
  2. bubbakush

    bubbakush Guest

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you can try to debug your vhosts using this command

    also look into your error logs to see if there something that may give you an idea of whats not working.
    cheers
     
    bubbakush, Nov 21, 2008 IP