SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Norcross, GA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This sounds like a dumb question, but I need to ask it anyway.

    How do I host two web sites from the same box? I know that servers all over the country do this, but I don't know how to work out the IP stuff.

    I have a static IP of 123.123.123.123 that all port 80 requests go to. From there what do I do? How does the server know which page to serve?

    tia.

  2. #2
    SitePoint Wizard jonese's Avatar
    Join Date
    Jul 1999
    Location
    Powder Springs GA (Atlanta)
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what kind of server are you on? Windows (what version)? *nix(waht flavor and version?)

    from this info i'm sure we can help you much better.

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Norcross, GA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Linux RH 7.0, Apache 1.3.12

  4. #4
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's pretty easy.

    Just open up your httpd.conf configuration file (/usr/local/apache/conf).

    At the bottom add something like:

    Code:
    NameVirtualHost 123.123.123.12
    
    <VirtualHost 123.123.123.12>
    ServerAlias www.domain.com
    ServerAdmin webmaster@domain.com
    DocumentRoot /home/domain/public_html
    ServerName www.domain.com
    </VirtualHost>
    
    NameVirtualHost 123.123.123.12
    
    <VirtualHost 123.123.123.12>
    ServerAlias www.domain2.com
    ServerAdmin webmaster@domain2.com
    DocumentRoot /home/domain2/public_html
    ServerName www.domain2.com
    </VirtualHost>
    I believe that should work..let me know if you have any more questions!
    Last edited by mkaufman; Mar 3, 2001 at 21:46.

  5. #5
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't need the second NameVirtualHost directive as you have already identified the IP as being used for a virtual host.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  6. #6
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My mistake..

    It should look like this:

    Code:
    NameVirtualHost 123.123.123.12
    
    <VirtualHost 123.123.123.12>
    ServerAlias www.domain.com
    ServerAdmin webmaster@domain.com
    DocumentRoot /home/domain/public_html
    ServerName www.domain.com
    </VirtualHost>
    
    <VirtualHost 123.123.123.12>
    ServerAlias www.domain2.com
    ServerAdmin webmaster@domain2.com
    DocumentRoot /home/domain2/public_html
    ServerName www.domain2.com
    </VirtualHost>
    Keep in mind that you will also need to restart Apache for these settings to take place.

    If you don't feel comfortable editing the httpd.conf file by yourself or don't have the knowledge of all the commands you can use, I'd highly recommend you downloading WebMin (http://www.webmin.com) or Plesk (http://www.plesk.com)


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
  •