Apache Name-Based hosts dont work.

Discussion in 'Server Operation' started by hgrimberg01, Dec 22, 2007.

  1. hgrimberg01

    hgrimberg01 New Member

    I have a problem with name based virtual hosts. Both throgh ispconfig and not, no go on either method. I always am taken to the main server root rather than the virtual hosts root. DNS is running well. say i enter x.com into my browser and have a virtual host for x.com, it still takes me to the root of the main server. It even happens when i have another name host y.net, it still takes for to the main server root. :(

    Any suggestions will be greatly appreciated,

    Thanks
     
  2. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ifconfig
    , and what IP address do you use in your Apache configuration?
     
  3. hgrimberg01

    hgrimberg01 New Member

    eth0 Link encap:Ethernet HWaddr 00:13:20: D8:E2:BE
    inet addr:192.168.2.5 Bcast:192.168.2.255 Mask:255.255.255.0
    inet6 addr: fe80::213:20ff:fed8:e2be/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:688 errors:0 dropped:0 overruns:0 frame:0
    TX packets:454 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:72144 (70.4 KiB) TX bytes:37347 (36.4 KiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:68 errors:0 dropped:0 overruns:0 frame:0
    TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:4663 (4.5 KiB) TX bytes:4663 (4.5 KiB)

    The ip address behind the NAT is 192.168.2.5, however the dmz is set to that address so it is visible to the world as 64.151.6.117. Could the NAT have something to do with it?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Do you use 192.168.2.5 or 64.151.6.117 in your Apache configuration? It must be 192.168.2.5.
     
  5. hgrimberg01

    hgrimberg01 New Member

    I told ISPconfig 64.151.6.117, the dnsworks fine like that except the virtual hosts dont work for apache. I try 192.168.2.5.
     
  6. hgrimberg01

    hgrimberg01 New Member

    Hooray it works, thanks. it never crossed my mind.
     

Share This Page