Virtual Hosts still not working

Discussion in 'Apache' started by Adam65, May 4, 2008.

  1. #1
    I have installed Apache 2.2

    I found a web site explaining the entries into the host file in c:\windows\system32\drivers\etc

    I have four domain names on nameservers at zoneedit.com all pointing to my static IP address: 121.223.214.219. (the domains are: hailpoker.com, attackinfo.com.au, nrpoker.com.au and hailpoker.com.au)

    My host file looks like this: (where 10.0.0.2) is the IP address result I get from IPconfig

    127.0.0.1 localhost

    10.0.0.2 www.hailpoker.com
    10.0.0.2 www.attackinfo.com.au
    10.0.0.2 www.nrpoker.com.au

    My virtual hosts now look like this:

    NameVirtualHost 121.223.214.219

    <VirtualHost 121.223.214.219:80>
    DocumentRoot "C:\webserver\www\htdocs\hailpoker"
    ServerName www.hailpoker.com
    ServerAlias hailpoker.com *.hailpoker.com
    </VirtualHost>

    <VirtualHost 121.223.214.219:80>
    DocumentRoot "C:\webserver\www\htdocs\attackinfo"
    ServerName www.attackinfo.com.au
    ServerAlias attackinfo.com.au *.attackinfo.com.au
    </VirtualHost>

    <VirtualHost 121.223.214.219:80>
    DocumentRoot "C:\webserver\www\htdocs\nrpoker"
    ServerName www.nrpoker.com.au
    ServerAlias nrpoker.com.au *.nrpoker.com.au
    </VirtualHost

    <VirtualHost 121.223.214.219:80>
    DocumentRoot C:\webserver\www\htdocs
    ServerName localhost
    </VirtualHost>


    Here’s some more configuration info:
    Listen 80
    ServerAdmin admin@hailpoker.com
    ServerName localhost:80
    DocumentRoot "C:/webserver/www/htdocs"
    <Directory "C:/webserver/www/htdocs">

    I should show my directory structure so you can see how I have set it all up:

    C:\webserver\www is where I installed Apache

    So c:\webserver\www\htdocs is my web servers root directory

    I have created directory’s in htdocs called:
    c:\webserver\www\htdocs\hailpoker
    c:\webserver\www\htdocs\attackinfo
    c:\webserver\www\htdocs\nrpoker

    In each of these directories I have created html files:
    index.html (obviously different for each directory)
    attackinfo.html
    hailpoker.html
    nrpoker.html

    Results:

    When I type http://localhost/ into a browser I get the index.html file located in my htdocs directory: It Works!

    When I type http://www.hailpoker.com/ into a browser I get the index.html file located in my htdocs directory: It Works!

    When I type http://www.attackinfo.com.au/ into a browser I get the index.html file located in my htdocs directory: It Works!

    hailpoker.com or attackinfo.com.au return "Cant find this page" (without the www.)


    I have asked my brother to check them in a browser at his home and he gets the same from his end.

    Now… all I have to do is get the virtual hosts working so that the index file from the appropriate directory is served instead of the index.html (It Works!) from the main document root directory (ie: Instead of c:\webserver\www\htdocs\index.html how do I get c:\webserver\www\htdocs\attackinfo\index.html)

    At present the only way I can get the right index.html file showing up in my browser is by typing:

    http://localhost/attackinfo/
    (pulling up the index.html file from the C\..\htdocs\attackinfo directory)
     
    Adam65, May 4, 2008 IP
  2. Adam65

    Adam65 Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just thought I should add a test I just did:

    commented out DirectoryIndex and all vhosts

    same result, everytime I enter either localhost, www.hailpoker.com, or attackinfo.com.au i get the same file up in the browser:

    c:\webserver\www\htdocs\index.html.

    So I guess this proves that the virtual host stuff isnt being seen at all.

    please help!
     
    Adam65, May 4, 2008 IP