SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot dereko's Avatar
    Join Date
    Dec 2003
    Location
    Ireland
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Apache 2.2 on Windows Server multiple sites one IP

    I'm fairly familiar with the workings of apache on Linux.

    Enviroment: Hosted VPS (full access)

    Windows Server 2003 Datacentre x64 edition, Apache 2.2

    I have 2 straight forward websites I want to host.

    example1.com and example2.org

    This server was originally set up by someone else and example1.com works as expected.

    So my task is to add example2.org to the server.

    I create a basic index.html test page in C:\www\example2

    add a virtual host record to httpd-vhosts.conf

    and for test purposes add a 127.0.0.1 example2.org to my hosts file so I can test locally.

    This all worked as expected and I can view example2.org which shows my test html file.

    The problem is... when the DNS propagated it shows the example1.com site when I go to example2.org from anywhere but the local windows server.

    I'm completely baffled as to why this is happening? Any ideas?

    At what point does apache read in outside connections differently to local ones?

    NameVirtualHost *:80

    <VirtualHost *:80>
    ServerName www.example2.org
    ServerAlias example2.org
    ServerAdmin info@example2.org
    DocumentRoot "C:/www/example2"

    <Directory "C:/www/example2">
    Order Deny,Allow
    Allow from all
    </Directory>

    ErrorLog "logs/example2-error.log"
    CustomLog "logs/example2-access.log" common
    </VirtualHost>

    <VirtualHost *:80>

    ServerName www.example1.com
    ServerAlias www.example1.com
    ServerAdmin info@example1.com
    DocumentRoot "C:/www/example1"

    <Directory "C:/www/example1">
    Order Deny,Allow
    Allow from all
    </Directory>

    ErrorLog "logs/example1-error.log"
    CustomLog "logs/example1-access.log" common
    </VirtualHost>
    Above is what I have in my httpd-vhosts.conf file.. bare in mind example1.com works fine.

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,645
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    do,

    Did you update your hosts file with the IP address for the WAN? Yes, 127.0.0.1 is fine for viewing by localhost but NOT from the LAN (192.168.x.x) or WAN (123.321.x.x). On a production machine, that would be taken care of by your control panel which would modify your DNS A record on the server (your hosts file is mimicking that).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Tags for this Thread

Bookmarks

Posting Permissions

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