Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:34:26+00:00 2026-05-26T10:34:26+00:00

I’m trying to get dynamic virtual hosts to work, followed the documentation but it

  • 0

I’m trying to get dynamic virtual hosts to work, followed the documentation but it didn’t quite work.

These are the domains from my HOSTS file:

127.0.0.1 walestourism.local.co.uk
127.0.0.1 www.walestourism.local.co.uk
127.0.0.2 walestourism.local.co.uk
127.0.0.2 www.walestourism.local.co.uk

and this is from httpd.conf:

NameVirtualHost 127.0.0.2
<VirtualHost 127.0.0.2>
ServerName www.walestourism.local.co.uk
ServerAlias walestourism.local.co.uk
DocumentRoot /www/walestourism.local.co.uk
ScriptAlias /cgi-bin/ /www/walestourism.local.co.uk/cgi-bin
</VirtualHost>

In all my other ones it was always *:80 for the VirtualHost part of the above code.

I have this code in my httpd.conf:

<Directory C:/www/vhosts>   
Order Deny,Allow   
Allow from all 
AllowOverride All
</Directory>
<Directory C:/www/vhosts1>   
Order Deny,Allow   
Allow from all 
AllowOverride All
</Directory>
<Directory C:/www/vhosts.www>   
Order Deny,Allow   
Allow from all 
AllowOverride All
</Directory>
<Directory C:/www/test2>   
Order Deny,Allow   
Allow from all 
AllowOverride All
</Directory>
<Directory C:/www/>   
Order Deny,Allow   
Allow from all 
AllowOverride All
</Directory>

How should I fix this error, as when I type the domain in it takes me to the contents of http://localhost ? That’s the basic problem I get when I try to add domains using dynamic virtual hosts.

Also, if I point my browser to “http://localhost/&#8221;, I get the default “It Works!” page, so I know that my server is running and that this is definitely something to do with the vhosts configuration.

I checked my error log – no errors as a result of this, so why does every domain direct to localhost even when there’s a folder configured for them (/www/ in this case is C:/www, my Apache/webserver’s directory).

I’m new to this area of Apache, and despite an afternoon of Googling, I’m not sure how to fix this.

I decided to try this to avoid doing cmd > httpd -k restart every time I add a new virtualhost for testing, but have I done anything wrong?

I’m on Apache 2.2, using Windows 7, with PHP 5.28 [mentioning specifications here].

What should I do?

All advice is very much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:34:26+00:00Added an answer on May 26, 2026 at 10:34 am

    As you are using named based virtual hosting, don’t use 127.0.0.2 … just keep it all to 127.0.0.1 … failing that, check the error_log for apache (defined in your httpd.conf) to trouble shoot why it is failing.

    Additionally, get Apache2 working on Windows with VHosts before you get going with PHP …

    As per http://httpd.apache.org/docs/2.0/vhosts/examples.html:

     # Ensure that Apache listens on port 80
     Listen 80
    
     # Listen for virtual host requests on all IP addresses
     NameVirtualHost *:80
    
     <VirtualHost *:80>
     DocumentRoot /www/example1
     ServerName www.example1.com
     # Other directives here
     </VirtualHost>
    
     <VirtualHost *:80>
     DocumentRoot /www/example2
     ServerName www.example2.org
     # Other directives here
     </VirtualHost>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.