How do I get httpd-vhosts.conf to work?

Discussion in 'Apache' started by barney_dpf, Jun 16, 2009.

  1. #1
    I'm trying to set a development domain on a local box - 192.168.x.x - but nothing I've tried seems to work.

    Using Apache 2.2.x on Windows, when I try to implement httpd-vhost.conf, nothing I try works.

    Last edit was
    
    NameVirtualHost *:80
    
    <VirtualHost *:80>
        ServerAdmin webmaster@win7rc3ggw.
        DocumentRoot C:/www/htdocs.
        ServerName win7rc3ggw.
        ServerAlias www.win7rc3ggw.
        ErrorLog logs/win7rc3ggw.-error_log
        CustomLog logs/win7rc3ggw.-access_log common
        <Directory />
    	Options FollowSymLinks
    	AllowOverride All
        </Directory>
        <Directory c:/www/htdocs>
    	Options Indexes FollowSymLinks
    	AllowOverride All
    	Order allow,deny
    	Allow from all
        </Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerAdmin webmaster@ldbhome.dev.
        DocumentRoot C:/www/ldbhome.dev/public_html
        ServerName ldbhome.dev
        ServerAlias www.ldbhome.dev
        ErrorLog logs/ldbhome.dev.-error_log
        CustomLog logs/ldbhome.dev.-access_log common
        <Directory />
    	Options FollowSymLinks
    	AllowOverride All
        </Directory>
        <Directory c:/www/ldbhome.dev/public_html>
    	Options Indexes FollowSymLinks
    	AllowOverride All
    	Order allow,deny
    	Allow from all
    	Satisfy all
        </Directory>
    </VirtualHost>
    
    Code (markup):
    which is nearly a direct copy of a .conf that was supposedly working. All I changed was servername & docroot.

    HOSTS file points 127.0.0.1 to both named directories.
    Httpd.conf is set to load httpd-vhosts.conf.
    The conf shown give me 403 Forbidden on ldbhome.dev,
    and index of / on win7rc3ggw & localhost.
    Prior to this, all I could get was server not found.

    I'm missing something, but at a loss as to what it might be.

    Virtual hosts was working on Apache 1.x, but cannot get it working on any flavour of 2.x.

    Any suggestions?
     
    barney_dpf, Jun 16, 2009 IP