#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    36
    Rep Power
    6

    Problem setting up Virtual Hosts on Wampserver


    I'm trying to set up Virtual Hosts on Wampserver.

    Here's what I have.

    In etc file I have this:

    ::1 localhost
    127.0.0.1 localhost
    127.0.0.1 mysite

    *********************

    I have this line uncommented in httpd.conf:

    Include conf/extra/httpd-vhosts.conf

    *********************

    In httpd-vhosts.conf I have this:

    NameVirtualHost *:80

    <VirtualHost *:80>
    ServerAdmin admin@mysite
    ServerName site
    ServerAlias www.site
    DocumentRoot C:/Windows/HOST/wamp/www/site
    ErrorLog "logs/error.log"
    CustomLog "logs/access.log" common
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin admin@localhost
    ServerName localhost
    ServerAlias www.localhost
    DocumentRoot "C:/Windows/HOST/wamp/www/"
    ErrorLog "logs/error.log"
    CustomLog "logs/access.log" common
    </VirtualHost>

    **********************

    When I go to my "inner" IP 192.168.254.2 I get mysite. When I go to localhost I get my Wampserver index page. That seems to be working correctly.

    But if I go to http://mysite I get some seach help page from my ISP (http://wind.search-help.net/index.php...). When someone outside my router goes to my "outside" IP http://75.117.202.131 they said they get a virus page. hehehe

    What up with this?

    When I go to http://mysite I should get mysite, correct? That's what the tutorials I've been reading and listening to say.

    When someone outside my router zone goes to my outside IP they should get mysite also, correct?

    What could be the matter?

    Thank you
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    Originally Posted by Freejoy
    When I go to my "inner" IP 192.168.254.2 I get mysite. When I go to localhost I get my Wampserver index page. That seems to be working correctly.
    Yes: 192.168.254.2 = your computer and localhost = your computer. They're both the same place.

    Originally Posted by Freejoy
    But if I go to http://mysite I get some seach help page from my ISP (http://wind.search-help.net/index.php...).
    Sounds like "mysite" doesn't exist in DNS. What are you actually using?

    Originally Posted by Freejoy
    When someone outside my router goes to my "outside" IP http://75.117.202.131 they said they get a virus page. hehehe
    I don't. I almost get a directory listing of / (but I don't because that's been disallowed so I get a 403 instead).

    Originally Posted by Freejoy
    When I go to http://mysite I should get mysite, correct? That's what the tutorials I've been reading and listening to say.
    It depends. "mysite" has to be resolved to some IP address, and apparently your ISP has things set up so that trying to go someplace that doesn't exist sends you to their search page. Normally your browser would tell you that it can't find "mysite".

    Originally Posted by Freejoy
    When someone outside my router zone goes to my outside IP they should get mysite also, correct?
    Short answer is yes.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    36
    Rep Power
    6
    Here's my latest development...

    Trying to cover all my bases with this in my hosts file:

    ::1 localhost
    127.0.0.1 localhost
    127.0.0.1 FOO
    127.0.0.1 FOO.com
    127.0.0.1 www.FOO.com
    127.0.0.1 google.com
    127.0.0.1 www.google.com

    This is my real unregistered website name. I can't register it until the end of the month when I get some money.

    Here's my new settings in my httpd-vhosts.conf file:

    NameVirtualHost *:80

    <VirtualHost *:80>
    ServerAdmin admin@FOO.com
    ServerName FOO
    ServerAlias www.FOO.com
    ServerAlias FOO.com
    DocumentRoot C:/Windows/HOST/wamp/www/FOO
    ErrorLog "logs/error.log"
    CustomLog "logs/access.log" common
    </VirtualHost>

    *********************

    I'm thinking it's my hosts.conf file so I've been checking it. Here's a ping check:

    C:\Windows\system32>ping FOO

    Pinging FOO.Home [184.106.31.186] with 32 bytes of data:
    Reply from 184.106.31.186: bytes=32 time=27ms TTL=240
    Reply from 184.106.31.186: bytes=32 time=37ms TTL=240
    Reply from 184.106.31.186: bytes=32 time=29ms TTL=240
    Reply from 184.106.31.186: bytes=32 time=25ms TTL=240

    Ping statistics for 184.106.31.186:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
    Minimum = 25ms, Maximum = 37ms, Average = 29ms

    ***************

    You can see I have www.google.com in my hosts file but I can still go to Google in my browser. So I think it's something to do with the host file.


    Yes: 192.168.254.2 = your computer and localhost = your computer. They're both the same place.
    Yeah but my IP 192.168.254.2 is suppose to be the same as localhost but I get two different pages. And that is what I want.

    I don't. I almost get a directory listing of / (but I don't because that's been disallowed so I get a 403 instead).
    Does this mean I need to set my folder to a more unrestricted settings. I'll do that and see.


    It depends. "mysite" has to be resolved to some IP address, and apparently your ISP has things set up so that trying to go someplace that doesn't exist sends you to their search page. Normally your browser would tell you that it can't find "mysite".
    I've been following these tutorials:

    JLBN - Virtual Hosts on WAMP
    http://guides.jlbn.net/setvh/setvh5.html

    and this YouTube:

    Setting up Virtual Hosts on Wampserver Part 1 of 2
    http://www.youtube.com/watch?v=_IjEtqpD23I

    They both say I should be able to go to my home page by typing http://FOO in the browser address bar.

    I follow it EXACTLY too.

    Thanks
    Last edited by requinix; June 21st, 2012 at 09:24 PM. Reason: s/original domain name/FOO/g
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    36
    Rep Power
    6
    I just wanted to say I fixed this issue. It was something the matter with the hosts.conf file.

    I just went here: http://support.microsoft.com/kb/972034

    and run the "Fix It" program then put everything I had back in the host file. That fixed it.
  8. #5
  9. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    Originally Posted by Freejoy
    This is my real unregistered website name. I can't register it until the end of the month when I get some money.
    Then allow me to contradict what I said earlier: it would be a good idea to not mention exactly what it is in case somebody (or something) finds it and registers it before you can. I've already pulled it out of your post.

IMN logo majestic logo threadwatch logo seochat tools logo