Hopefully a simple VirtualHost problem...

Alles, was den Apache betrifft, kann hier besprochen werden.

Hopefully a simple VirtualHost problem...

Postby Ash...Housewares » 06. September 2009 20:49

I'm a bit of an Apache n00b and am just looking to create some local pages for the sake of testing.

A few months back I created some virtual hosts that worked just great, however now I have gone back and tried to add a couple more and I can't get them to work. It seems like I'm just forgetting a setting somewhere, but I can't seem to figure out what it would be from the docs.

The 2 hosts listed below that work are "prairie" and "bell"

Some things I've tried:
httpd.exe -S -w --- Recognizes all 4 of them as virtual hosts
Switching the DocumentRoot of a working VirtualHost to the brav DocumentRoot works correctly (so my folder structure and permissions must be okay)
Clearing my browser cache doesn't seem to make a difference

Is there maybe another place besides httpd-vhosts.conf where I need to define my virtual host name?
If anyone knowledgeable could lend a hand I'd greatly appreciate it.

Code: Select all
<Directory "C:/bell">
  Order Deny,Allow
  Allow from all
</Directory>
<Directory "C:/Brav">
  Order Deny,Allow
  Allow from all
</Directory>
<Directory "C:/Prairie">
  Order Deny,Allow
  Allow from all
</Directory>
<Directory "C:/p">
  Order Deny,Allow
  Allow from all
</Directory>

NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
   DocumentRoot C:/apache/htdocs
   ServerName localhost
</VirtualHost>

<VirtualHost 127.0.0.1:80>
   DocumentRoot C:/bell
   ServerName bell
</VirtualHost>

<VirtualHost 127.0.0.1:80>
   DocumentRoot C:/Brav
   ServerName brav
</VirtualHost>

<VirtualHost 127.0.0.1:80>
   DocumentRoot C:/Prairie
   ServerName prairie
</VirtualHost>

<VirtualHost 127.0.0.1:80>
   DocumentRoot C:/p
   ServerName p
</VirtualHost>
Ash...Housewares
 
Posts: 4
Joined: 06. September 2009 20:23

Re: Hopefully a simple VirtualHost problem...

Postby Wiedmann » 06. September 2009 21:16

The 2 hosts listed below that work are "prairie" and "bell"

And what's the problem with "localhost", "brav" and "p"?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Hopefully a simple VirtualHost problem...

Postby Ash...Housewares » 06. September 2009 22:03

Thanks for your reply.
Sorry, localhost also works correctly.

"p" and "brav" both give a "cannot find server error"
Ash...Housewares
 
Posts: 4
Joined: 06. September 2009 20:23

Re: Hopefully a simple VirtualHost problem...

Postby Wiedmann » 06. September 2009 22:54

"p" and "brav" both give a "cannot find server error"

OK. So that's a message from your browser. Did you have entries for these two in your hosts file?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Hopefully a simple VirtualHost problem...

Postby Ash...Housewares » 07. September 2009 07:26

Yeah, the lines from above came out of my httpd-vhosts.conf file (which I have included inside of my httpd.conf file). Or am I misunderstanding your question? Is there another hosts file where I need to update this information?
Ash...Housewares
 
Posts: 4
Joined: 06. September 2009 20:23

Re: Hopefully a simple VirtualHost problem...

Postby Nobbie » 07. September 2009 09:47

Ash...Housewares wrote:Or am I misunderstanding your question?


Yes.

Ash...Housewares wrote:Is there another hosts file where I need to update this information?


There is no "another" hosts file, there is only one hosts file. The name of the file is "hosts". It is the file of your operating system, where domain names are assigned to an IP.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Hopefully a simple VirtualHost problem...

Postby Ash...Housewares » 07. September 2009 15:22

Thanks so much! That was it. I knew it was going to be something stupidly simple. I COMPLETELY forgot about that... How embarrassing.

Thanks again!
Ash...Housewares
 
Posts: 4
Joined: 06. September 2009 20:23


Return to Apache

Who is online

Users browsing this forum: No registered users and 30 guests