Serving the same content on different IP addresses

Discussion in 'Apache' started by nickle, May 16, 2009.

  1. #1
    hello all

    Heres my query, i have a home broadband internet connection on windows xp. i'm identified as 192.168.1.* (this is wht appears in cmd>ipconfig) on my network but whn i check my ip address on the internet its 59.92.*

    i dont own a registered DNS name, i want to use my ip address to access my site. after installing apache i can access the site over lan using the 192.168.* ip address but what do i use over the internet?

    i added
    NameVirtualHost 192.168.1.*
    NameVirtualHost 59.92.*

    <VirtualHost 192.168.* 59.92*>
    ServerName 192.168.*
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
    </VirtualHost>

    as indicated by the apache docs. i tried my external ip address as ServerName too but i cant access the site over the internet. any help would be greatly appriciated.

    ~tq
     
    nickle, May 16, 2009 IP
  2. alexandrus

    alexandrus Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi.
    Probably you are connected to internet by router, so ip address 59.92.* is address of your router and 192.168.1.* is address of your computer in your local network. If you have an admin access to the router you can redirect port 80 on the router to port 80 on your computer. You can find how to do it in yours router manual.
     
    alexandrus, May 18, 2009 IP
  3. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yep, you need to forward external port 80 to your internal pc port 80, so that your apache can be 'seen' from the net. once you have setup apache, you can use ServerName 192.168.* (your LAN ip address) and it should work. You only have to NameVirtualHost 127.0.0.1:80 if all of your virtualhosts are on your pc; in this case you could instead of ip-based Vhosts, use named ones, such as <virtualhost mysite1:80> then add the hostname to your \system32\drivers\etc\hosts file.
     
    szalinski, May 26, 2009 IP