httpd-vhosts.conf
Posted by: darkling235 (---.genesis.csps.com)
Date: February 19, 2008 08:02PM

Is there something obviously wrong with my httpd-vhosts.conf I'm trying to set up subdomains but it isn't working.

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:[httpd.apache.org];
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#

<VirtualHost *:80>
ServerAdmin webmaster@wordpress.localhost
DocumentRoot "C:/wamp/www/wordpress-mu"
ServerName wordpress-mu.localhost
ServerAlias www.wordpress-mu.localhost
#ErrorLog "C:/wamp/www/docs/dummy-host2.localhost/logs/error.log"
#CustomLog "C:/wamp/www/docs/dummy-host2.localhost/logs/access_log common"
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@wordpress.localhost
DocumentRoot "C:/wamp/www/wordpress"
ServerName wordpress.localhost
ServerAlias www.wordpress.localhost
#ErrorLog "C:/wamp/www/docs/dummy-host2.localhost/logs/error.log"
#CustomLog "C:/wamp/www/docs/dummy-host2.localhost/logs/access_log common"
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "C:/wamp/www/docs/dummy-host.localhost"
ServerName dummy-host.localhost
ServerAlias www.dummy-host.localhost
#ErrorLog "C:/wamp/www/docs/dummy-host.localhost/logs/error.log"
#CustomLog "C:/wamp/www/docs/dummy-host.localhost/logs/access_log common"
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/wamp/www/docs/dummy-host2.localhost"
ServerName dummy-host.localhost2
ServerAlias www.dummy-host.localhost2
#ErrorLog "C:/wamp/www/docs/dummy-host2.localhost/logs/error.log"
#CustomLog "C:/wamp/www/docs/dummy-host2.localhost/logs/access_log common"
</VirtualHost>

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 19, 2008 08:03PM

delete everything in the file and put just this in it

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.wordpress-mu.localhost
ServerAlias wordpress-mu.localhost *wordpress-mu.localhost
DocumentRoot /www/wordpress-mu
</VirtualHost>

<VirtualHost *:80>
ServerName www.wordpress.localhost
DocumentRoot /www/wordpress
</VirtualHost>



Edited 1 time(s). Last edit at 02/19/2008 08:04PM by stevenmartin99.

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 19, 2008 08:06PM

darkling235 had a mistake in it.. edited it- its right now above



Edited 1 time(s). Last edit at 02/19/2008 08:07PM by stevenmartin99.

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: darkling235 (---.genesis.csps.com)
Date: February 19, 2008 08:09PM

Ok updated it, same results

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 19, 2008 08:12PM

are u typing in www.

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: darkling235 (---.genesis.csps.com)
Date: February 19, 2008 08:14PM

No. But firefox plugs it in anyway. I've altered my hosts file so that it should check localhost before looking online but it still fires off a 404. For some reason it just doesn't find the vhost

I've been stuck here for days and it's driving me nuts

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: darkling235 (---.genesis.csps.com)
Date: February 19, 2008 08:16PM

I.E. It checks the localhost and then tries www.foo.
It can find localhost and wordpress.localhost because I set that mistakenly to map to localhost in the hosts file but wordpress-mu.localhost it can't find so it checks the web

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 19, 2008 08:17PM

but are u typing in www.wordpress-mu.localhost

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: darkling235 (---.genesis.csps.com)
Date: February 19, 2008 08:18PM

No I wasn't but that doesn't work either

Options: ReplyQuote
Re: httpd-vhosts.conf
Posted by: darkling235 (---.genesis.csps.com)
Date: February 19, 2008 08:45PM

Ok I found out that if the docroot is an absolute path, it will find the first vhost configured in the file when you go to localhost. However it 404s the actual subdomain.domain urls.
I have no idea what this means

Options: ReplyQuote


Sorry, only registered users may post in this forum.