Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Multiple Web Sites on a single IP Address

Options
  • 07-11-2001 8:57pm
    #1
    Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭


    Hi Folks,

    I am currently moving 3 web sites from my old server to a new server.

    My new server has a single IP address which all 3 URL's point to. While I am configuring the new sites on the new server I don't want to repoint the domains.

    Any ideas how I access the individual sites on the new server using the IP address only? e.g. 222.222.222.222:site1, 222.222.222.222:site2 etc.

    It's hard to map cirtual directories as I'm now using a cobalt RAQ, and the control panel doesn't allow this.

    Thanks

    Graham


Comments

  • Registered Users Posts: 2,119 ✭✭✭p


    It can certainly be done using vhosts,
    but since I guess you're not adminning your own server then it seems unlikely.

    The company might do it for you though, for a charge.


    - Kevin


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Hi,

    I do admin my own server, just not sure how to do it, and suggestions appreciated.

    Thanks

    Graham


  • Closed Accounts Posts: 3,859 ✭✭✭logic1


    You never specified waht web server you're running but I'll assume you're using Apache.

    If so name based virtual hosting is right up you're street.

    In your httpd.conf you'll have a virtual host section right at the end usually.

    In here you'll need to make virtual host entries for each extra client you want to host something like the following format:

    NameVirtualHost 10.5.195.10
    <VirtualHost 10.5.195.10>
    ServerName www.customer-1.com
    DocumentRoot /www/hosts/www.customer-1.com/docs
    ScriptAlias /cgi-bin/ /www/hosts/www.customer-1.com/cgi-bin
    </VirtualHost>
    <VirtualHost 10.5.195.10>
    ServerName www.customer-2.com
    DocumentRoot /www/hosts/www.customer-2.com/docs
    ScriptAlias /cgi-bin/ /www/hosts/www.customer-2.com/cgi-bin
    </VirtualHost>
    # blah blah blah
    <VirtualHost 10.5.195.10>
    ServerName www.customer-N.com
    DocumentRoot /www/hosts/www.customer-N.com/docs
    ScriptAlias /cgi-bin/ /www/hosts/www.customer-N.com/cgi-bin
    </VirtualHost>


    .logic.


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Thanks logic, I've managed to do that part, any ideas how I access the sites customer1.com, customer2.com etc until the domains are repointed?

    i.e. customer1.com customer2.com still reside on my old server at the moment, for testing though I'd like to be able to access their virtual sections on the new server using just the IP address of my new server.

    Thanks again

    Graham


  • Subscribers Posts: 1,911 ✭✭✭Draco


    Originally posted by Graham
    Thanks logic, I've managed to do that part, any ideas how I access the sites customer1.com, customer2.com etc until the domains are repointed?
    AFAIK you'll just have to wait.


  • Advertisement
  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Bugger,

    didn't want to move the domains yet, ah well, such is life.

    Thanks for the advice anyway. :rolleyes:


  • Registered Users Posts: 3,279 ✭✭✭regi


    Not so... You could alter your workstation's host file to add a phony record for that domain name. On Windows 2000, you'd find it in winnt/system32/drivers/etc/hosts. On *nix, the hosts file's location varies. On my FreeBSD system here, its in /etc/hosts.

    In that, there should be an entry like
    127.0.0.1 localhost

    Add more entries:
    xxx.xxx.xxx.xxx www.customer1.com
    xxx.xxx.xxx.xxx www.customer2.com
    xxx.xxx.xxx.xxx www.customer3.com

    Now, when you try to browse to www.customer1.com, it'll resolve to the value you put in your hosts file, and so your HTTP host headers will allow you to view the virtual hosts.

    Make sure you remove these entries once you're done testing :)


  • Registered Users Posts: 476 ✭✭Pablo


    yeah right on Regi

    i did the same thing on my mates computer that mapped google.com to yahoo.com and vicaversa :D


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Regi,

    you're a genious, why didn't I think of that. I'll give it a go later.

    Thanks

    Graham


Advertisement