Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts

    getting virtual host working accross network under xampp

    I've got xampp running on my local (Win7) dev machine.

    I'm using virtual hosts to get various dev sites running under that. So relevant bits from my apache/conf/extra/httpd-vhosts.conf look like:

    NameVirtualHost 127.0.0.1:80

    <VirtualHost dev.newsite.com>
    ServerAdmin me@localhost
    DocumentRoot "C:\dev\newsite\build"
    ServerName dev.newsite.com
    ServerAlias dev.newsite.com
    <Directory "C:\dev\newsite\build">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>
    And the relevant entry in my hosts file:

    127.0.0.1 dev.newsite.com
    This works fine, from the Win7 machine.

    I've also created a virtual machine running WinXP (on the same Win7 machine), so I can test on IE8. I want to access dev.newsite.com from it.

    I've commented out the following in httpd-xamp.conf, so the virtual machine can at least see my xampp apache. Probably not the safest but this is all on an internal office network:

    #<LocationMatch "^/(?i?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    # Order deny,allow
    # Deny from all
    # Allow from 127.0.0.0/8
    # ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
    #</LocationMatch>
    And I've added an entry to the hosts file on the WinXP virtual machine, pointing dev.newsite.com at the network IP address of the Win7 machine:

    192.168.154.168 dev.newsite.com
    That's got me nearly there. But if I start up the WinXP virtual machine and point IE8 at http://dev.newsite.com - I don't get the dev site.

    I get the xampp 'welcome' page. In fact, it's redirecting me to:
    http://dev.newsite.com/xampp/

    What's doing this, and how can I stop it?

  • #2
    Regular Coder
    Join Date
    Nov 2007
    Location
    127.0.0.1
    Posts
    348
    Thanks
    26
    Thanked 40 Times in 39 Posts

    Accessing Virtual Host domain from a guest os running as a Virtual Machine

    Quote Originally Posted by Spudhead View Post
    I get the xampp 'welcome' page. In fact, it's redirecting me to:
    http://dev.newsite.com/xampp/

    What's doing this, and how can I stop it?
    Hi, have you restarted xampp, after making changes?
    Also, disable and enable the network connection from the Guest OS.

    ps: I have such a config running on my machine now.
    Last edited by tagnu; 04-06-2011 at 09:31 AM. Reason: updated title.
    Blog Charity:Water
    WhatisWrongWith.me/tagnu - Send me anonymous feedback.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •