11 Replies Latest reply: May 26, 2010 5:06 PM by Vladiator
Jeffdsn Level 1 Level 1 (0 points)
I have 10.6 server on a mini, with a single static ip serving 2 websites. Everything is working well, but I was wondering if I could use 2 different static ips to reach the 2 different websites on my server. The DNS entry at the domain name registrar both go to the same single static ip mentioned above. In other words, for example, 1.1.1.1 goes to web site A, and I would like to add 1.1.1.2 to go to web site B. Can this be accomplished in the DNS section of ServerAdmin?

Thank you for your help,

Jeff

Mac Mini Server, Mac OS X (10.6.2)
  • 1. Re: 2 Websites with 2 different IP addresses
    Camelot Level 8 Level 8 (45,790 points)
    Why do you need to bother with two IP addresses?

    As long as you're not using HTTPS/SSL it's entirely possible to run multiple sites on a single IP address. Apache will look at the request to determine which site the user is trying to access and serve the appropriate content.

    It is possible to do with multiple addresses, but it's more work with little or no gain.

    Just use Server Admin to create an additional site and make sure you set the site's hostname appropriately.
  • 2. Re: 2 Websites with 2 different IP addresses
    Jeffdsn Level 1 Level 1 (0 points)
    Thank you for your reply. One of the sites is https. I had a friend, (his company just put in new blocking software), go to one of the sites, and ended up at the wrong site (from my server. He received the main site my server is set up with). Every other computer I have tested these sites on was good, only the one that has the new blocks. So I figured if the sites were done with different ip's, instead of getting the incorrect site, he would get nothing at all.

    Jeff
  • 3. Re: 2 Websites with 2 different IP addresses
    Camelot Level 8 Level 8 (45,790 points)
    You'll probably find that the existing site is configured with a wildcard (*) which tells Apache to match all hostnames to this site's configuration. You need to remove that (Server Admin -> Web -> Sites -> (default site) -> Aliases) to allow other hostname-based sites to work.
  • 4. Re: 2 Websites with 2 different IP addresses
    Jeffdsn Level 1 Level 1 (0 points)
    Thank you again, for your reply. There are 3 sites listed in ServerAdmin/Web. Site 1, port 80, site 1, port 443, and site 2, port 80. None of them contains an wildcard(*) anywhere on the screen in Aliases.
  • 5. Re: 2 Websites with 2 different IP addresses
    Vladiator Level 1 Level 1 (50 points)
    Where do I find instructions on how to setup multiple websites on one IP address?
  • 6. Re: 2 Websites with 2 different IP addresses
    MrHoffman Level 6 Level 6 (12,470 points)
    Where? There are various spots to [learn about Mac OS X Server|http://www.apple.com/server/macosx/resources/documentation.html]. For this case, in [the web administration manual|http://images.apple.com/server/macosx/docs/WebTech_Adminv10.6.pdf], certainly. Or the "Managing Multiple Sites on One Server" in the Web section of the Server Admin help file. Via Google, of course. Or [something here|http://labs.hoffmanlabs.com/node/1329]? The underpinnings of this environment are Apache, and you can learn about the pieces underneath Server Admin (and what Apple calls "sites") at the [Apache web site|http://www.apache.org], and in various Apache books.
  • 7. Re: 2 Websites with 2 different IP addresses
    Vladiator Level 1 Level 1 (50 points)
    MrHoffman wrote:
    Where? There are various spots to [learn about Mac OS X Server|http://www.apple.com/server/macosx/resources/documentation.html]. For this case, in [the web administration manual|http://images.apple.com/server/macosx/docs/WebTech_Adminv10.6.pdf], certainly. Or the "Managing Multiple Sites on One Server" in the Web section of the Server Admin help file. Via Google, of course. Or [something here|http://labs.hoffmanlabs.com/node/1329]? The underpinnings of this environment are Apache, and you can learn about the pieces underneath Server Admin (and what Apple calls "sites") at the [Apache web site|http://www.apache.org], and in various Apache books.


    I found the Apple's web administration manual you referenced contains numerous inaccuracies that it makes it difficult to use. For example, on page 35 is says:

    +To create a website:+
    +1. Open Server Admin and connect to the server.+
    +2. Click the triangle at the left of the server.+
    +3. The list of services appears.+
    +4. From the expanded Servers list, select Web.+
    +5. Click Sites, then click the Add (plus) button to add a site.+

    The problem is there is you cannot ad a site from Server Admin, and it actually should be Server Preferences. Server 10.6 has a tab called Custom Sites, and there is no reference to it in the web administration manual. When I add a custom site, which I think is a second website in addition to the one that the server hosts, it asks about IP address and port (80 as a default). the IP address has an option "Any" and "10.0.1.5". I tried both and none of them works.

    I will try to research more, but if you have any suggestion on how to setup a second website (domain name) correctly, please respond.
  • 8. Re: 2 Websites with 2 different IP addresses
    MrHoffman Level 6 Level 6 (12,470 points)
    The problem is there is you cannot ad a site from Server Admin,


    Odd. Server Admin is all I've used to add sites on Mac OS X Server.

    And I just tried it. +'d a site. Picked an alternate port (8080) with a wildcard address. Clicked "enabled". Clicked Save. Tested. Worked.

    I'm going to guess there's some error or some sequence or some additional or specific information here that's been left unstated, either by the manuals or by your experience here.

    That there are some details on what you've configured.

    What you've then tested.

    What results you've encountered or errors you've then received.

    Server Preferences is not a tool I generally recommend using, given it has various issues with moderate to more complex sites.

    That Server Preferences works implies there's something different in the two sequences; a step that's been missed.

    As for the documentation, toss a problem report at Apple. They're typically quite receptive. If this is a newly-acquired system and still under software support, you could also choose to call up Apple Support for some information and guidance here, too.
  • 9. Re: 2 Websites with 2 different IP addresses
    Vladiator Level 1 Level 1 (50 points)
    MrHoffman wrote:
    The problem is there is you cannot ad a site from Server Admin,


    Odd. Server Admin is all I've used to add sites on Mac OS X Server.

    And I just tried it. +'d a site. Picked an alternate port (8080) with a wildcard address. Clicked "enabled". Clicked Save. Tested. Worked.

    I'm going to guess there's some error or some sequence or some additional or specific information here that's been left unstated, either by the manuals or by your experience here.

    That there are some details on what you've configured.

    What you've then tested.

    What results you've encountered or errors you've then received.

    Server Preferences is not a tool I generally recommend using, given it has various issues with moderate to more complex sites.

    That Server Preferences works implies there's something different in the two sequences; a step that's been missed.

    As for the documentation, toss a problem report at Apple. They're typically quite receptive. If this is a newly-acquired system and still under software support, you could also choose to call up Apple Support for some information and guidance here, too.


    I am wondering if you have an older version of Mac OS Server. Server Admin that I see does not have an option to add a site. Looks like they moved this option to Server Preferences. I checked out the printed manual and it's up to date, describing how to add a site from System Preferences. So my guess the PDFs on Apple's site are not updated yet.

    So my understanding is I need to add a new port for each additional website the server will host? So if the default site is port 80, an additional website should be setup up to port 90 for example? I understand I should not use other reserved ports from the list of ports used.

    Please advise if I understand this correctly.
  • 10. Re: 2 Websites with 2 different IP addresses
    MrHoffman Level 6 Level 6 (12,470 points)
    I am wondering if you have an older version of Mac OS Server.


    Testing was with current Mac OS X Server software and with the current Server Tools version in a local configuration I use for testing.

    My test was with a different web server port because that was easy way to test adding a site; I didn't need to set up a domain CNAME to test that.

    From another Mac OS X client on the same LAN as the server:

    Server Admin > select the server > Web > Sites

    Immediately below the "Sites" line, there's a box with "Enabled" and "Host Name" and "IP Address" and "Port" as its headers. That's where the sites are entered.

    At the bottom of that box is a + to add a new site, which will cause a sheet to drop with the input prompting for the details for the new site. If you hover the cursor over the + button, you'll get a "add a new web site" label.

    Below this box, you'll have a set of buttons starting with General, Options, Realms...

    Your list from the previous reply is exactly what I see with Server Admin, which implies there's a problem with Server Admin or the connectivity or such in the local configuration, or that the displays are confusing. Without some additional details of what you're seeing when following that Server Admin sequence and what (if any) error messages are arising, a specific diagnosis is difficult at best.

    Server Preferences is a limited and more targeted and more friendly (and unfortunately somewhat buggy) version of Server Admin and Workgroup Manager tools. I prefer to avoid it, given I've had it utterly fail in configurations that I regularly work with.

    Port collisions are generally to be avoided, yes. 8080 happens to be the http alternate port. It's also used by Apache Tomcat. For web server testing purposes, it's (usually) available and I happened to know that Tomcat was not in use on the test server.
  • 11. Re: 2 Websites with 2 different IP addresses
    Vladiator Level 1 Level 1 (50 points)
    Thanks for your help! I found the root cause of the problem: I changed the DNS entry to point my server's IP address just recently, and I started to work with it immediately. It looks like I need to wait 24-48 hours until the DNS changes will be propagated. Looks like it's up and running just fine.

    The other issue I found is that I should not create a website folder that has a period in the folder name, for example /Sites/example.com/ as a website location is troublesome and does not work. Better location is /Sites/example/.