pbcaer

Q: How to host my website(s) on a Mac Mini with OS X Server ?

It's been 2 weeks and getting disappointed. I tought OS X Server would be the easiest way to host a website from home, but now I see that's not true.

 

Got a Mac Mini and want to use it as a dedicated server, for my home network and for my websites (and iOS apps, databases etc.).

 

Registered a temporary domain, replaced my dynamic ip with a static one, bought a SSL, and purchased OS X Server for Mavericks, right just one month after purchasing for Server 2.2 (that's not fair I think, another story.).

 

I went to my domain registrars control panel and redirected the A host record to my brand new static ip, and edited the nsX.domain.com / nsY.domain.com records.

 

Then on the OS X Server, I turned the website option on, and added the new domain there. (both with port 80 and port 443 for SSL).

 

I don't know what's wrong but the website doesnot run.

 

Another thing, it's really hard to find where the OS X Server stores my website files, hard to locate it. By default it seems like generates a new folder with domain name, but you can't locate it.

 

Need help.

Mac mini, OS X Mavericks (10.9), OS X Server

Posted on Nov 16, 2013 5:31 PM

Close

Q: How to host my website(s) on a Mac Mini with OS X Server ?

  • All replies
  • Helpful answers

Page 1 of 3 last Next
  • by GreyWullf,

    GreyWullf GreyWullf Nov 17, 2013 6:06 PM in response to pbcaer
    Level 1 (33 points)
    iBooks
    Nov 17, 2013 6:06 PM in response to pbcaer

    Good day pbcaer.  You are not alone.  I hosted my own websites from my mac mini using server version 2.2.  Now that I have upgraded, my websites do not run (same as yours).

     

    I store my website files in /Library/Server/Web/Data/Sites, but the websites are not responding.

     

    Hope someone can help us.

  • by GreyWullf,

    GreyWullf GreyWullf Nov 17, 2013 6:31 PM in response to GreyWullf
    Level 1 (33 points)
    iBooks
    Nov 17, 2013 6:31 PM in response to GreyWullf

    Forgive me, I was hoping I could edit my previous response.

     

    I wanted to add that I can ping my websites from outside the network.  So I have properly configured my Airport Extreme to forward ports, etc.

  • by capitanu,

    capitanu capitanu Nov 18, 2013 1:54 AM in response to pbcaer
    Level 1 (35 points)
    Nov 18, 2013 1:54 AM in response to pbcaer

    .

  • by John Lockwood,

    John Lockwood John Lockwood Nov 18, 2013 2:27 AM in response to pbcaer
    Level 6 (9,411 points)
    Servers Enterprise
    Nov 18, 2013 2:27 AM in response to pbcaer

    Neither of you have indicated if your websites work internally or even on the server itself. Once it is working internally we can worry about getting it working on the Internet.

     

    Also, you could try testing internally with the default server website.

  • by pbcaer,

    pbcaer pbcaer Nov 18, 2013 3:40 AM in response to pbcaer
    Level 1 (0 points)
    Nov 18, 2013 3:40 AM in response to pbcaer

    * Mac Mini late 2012 (the server) with OS X Server Mavericks (3.xx)

    * iMac early 2013 (the admin mac, for daily use, developing and editing websites, and screen for Mac Mini (via thunderbolt)

    * MacBook Pro late 2012 (client in network)

    * My and my gf's iPads and iPhone 5s

    * AirPort Extreme (brand new)

    -------------------------------------

    All of them up to date.

     

    Replaced my dynamic IP with a static one. So I won't need 3rd party services like dyndns etc.

     

    Registered a domain from goDaddy, off their control panel, created two new hosts NS1.mydomain.com and NS2.mydomain.com and redirected the name servers to them.

     

    From goDaddy's control panel, changed the A host record to my static IP.

     

    Bought an SSL certificate.

     

    On my Mac Mini the server, I turned the website publishing on. Added two new websites (www.mydomain.com), one for port 80 and one for port 443 (for SSL).

     

    When I try to go to Safari and open up the website, it says the page can't be found. What's wrong ? Did I miss something ?

     

    The settings for adding a new website were all done true. I mean, redirected port 80 one to port 443 one, added the www.mydomain.com and mydomain.com versions as aliase. They were simple and clear and making a mistake there was impossible.

     

    Is it about DNS settings ? Do I need to go to my router's control page and set the both ports to the Mac Mini's internal IP ? You know maybe all those tutorials on the net were for those who have just one IP in their network so it automatically redirects the queries to that mac. Do I need to change the router settings and tell the router that if somebody asks for visiting my website (port 80 and 443), redirect them to my Mac Mini, not to iMac or any other internal IP or something like that ?

     

    I really need a guide, Server App's tutorials are not enough, because I did what was said there and still can't see the website. And they don't talk about the router settings or static IP or any other thing. It just explains how to set the Server App which can be done without a tutorial.

     

    Some may ask if I have a website or index page (html or something else), I just pick the Server App's sample php page, and add it to the list and bring it up to first on the list. So I suppose it should display a sample php page. But it doesnot load anything.

     

    Should I play with those DHCP NAT settings, I don't know what they really do, so left them untouched.

     

    Even sharing a website is hard enough to make me tired and bored and I am about to give up my project. I don't want to think about publishing a database for my iOS app.

     

    I need help. Nobody knows enough about Mac Server, and many people told me it was a bad choise. But when you see the Mac Mini Server, I mean it's design and the way Apple makes everything simple, you think mac is the best choise. I hope I am not wrong.

  • by pbcaer,

    pbcaer pbcaer Nov 18, 2013 3:49 AM in response to GreyWullf
    Level 1 (0 points)
    Nov 18, 2013 3:49 AM in response to GreyWullf

    Hello GreyWullf,

     

    I guess the path has changed with Mavericks. I can't find that path on my mac. Maybe yours just a result of wrong path, well hope it's that easy.

     

    I am having problems with AirPort Extreme too, don't know how to change port settings there even.

     

    I guess we need a tech guide.

     

    Cheers, good luck.

  • by capitanu,

    capitanu capitanu Nov 18, 2013 4:43 AM in response to pbcaer
    Level 1 (35 points)
    Nov 18, 2013 4:43 AM in response to pbcaer

    1. Please back track and make sure the standard Web services are working ....

    type 'localhost' in Safari

    (screenshot attached)

    Bild 2.png

     

    2. Then Create a new website (no ssl, no redirect....) and point it to a folder with an index.html with the following content

    <html><body>Test</body><html>

    Post screenshots.

     

    3. Then we can talk about SSL/redirects (all is seemless so no need to redirect ports, use Airport extreme for standard functionalities used in OSX Server App e.g. web, mail, contacts....)

     

    Note that you have to tell your friends that the Sever app is the only app/OS on the market for a complete new user in server mangement, using a GUI to manage services, and rememeber that as in any app with more than 1 option to setup, the order you enable them, it's important. Please start simple (all on default)

     

    Message was edited by: capitanu

  • by nick101,Helpful

    nick101 nick101 Nov 18, 2013 6:22 AM in response to pbcaer
    Level 5 (5,113 points)
    Nov 18, 2013 6:22 AM in response to pbcaer

    You don't say anything about having set up DNS services on Server - that may be the cause of the porblem

     

    Short version: Your *external* DNS setup (at GoDaddy) should point the domain names to your static external IP address. Your *internal* setup (on Server) should point the names to your server's *internal* IP address.

     

    MrHoffman's web page (link below) explains in more detail and I've found it very helpful. I hope it's OK to post the link here.

     

    http://labs.hoffmanlabs.com/node/1436

  • by Paul Derby,Helpful

    Paul Derby Paul Derby Nov 18, 2013 6:34 AM in response to pbcaer
    Level 1 (143 points)
    Servers Enterprise
    Nov 18, 2013 6:34 AM in response to pbcaer

    MrHoffman's web page is excellent.

     

    There is also a Mavericks Server guide that has a lot of "how to's" available online at this url:

     

    http://store.wegotserved.com/collections/os-x-server/products/using-os-x-maveric ks-server-at-home

  • by MrHoffman,

    MrHoffman MrHoffman Nov 18, 2013 8:52 AM in response to pbcaer
    Level 6 (15,637 points)
    Mac OS X
    Nov 18, 2013 8:52 AM in response to pbcaer

    Mavericks Server has moved the web services directories around somewhat, yes.

     

    When using Server.app to create or edit or view a particular Site, you'll see the directory path ghosted into the display. 

     

    In a clean install of Mavericks Server, it'll use the path /Library/Server/Web/Data/Sites

     

    You can also reset where the files are stored when you create a site using Server.app, but I'd tend to leave the files in the defauilt location.

     

    Your DNS must absolutely be correct before starting other services, or things tend to get weird.  Once you have DNS configured, you can use the following Terminal.app command (Applications > Utilities > Terminal.app) to detect the usual sorts of configuration issues:

     

    sudo changeip -checkhostname

     

    That's a harmless diagnostic command, and will not change your host or network settings.  After displaying some configuration data, that command will tell you that no changes are required, or if there are issues with the configuration.  You will need to enter an administrative password for the sudo.

     

    If you're using NAT and a private address block on your local network as is typical, then you cannot reference your ISP DNS servers here, nor the Google DNS servers nor any servers located outside of your private network.  You need working DNS servers operating within your private (NAT'd) network.

     

    To get DNS working on OS X Server, yes, see that page I wrote that Nick101 links to.  If you're looking for more reading on DNS and virtual hosts and small networks with OS X Server, see this article on network gizmos and this article on Apache Virtual Hosts(what Apple calls "Sites" with OS X.).

     

    Another couple of common mistakes that can arise early on here: if you're just getting going here, I'd also suggest getting out of 192.168.0.0/24 and 192.168.0.0/24 subnets and into one of the other private blocks (the network gizmos article has the other private blocks), this particularly if you ever might decide to use a VPN to connect into your network, as VPNs are based on IP routing and IP routing doesn't appreciate the same subnet on both ends of the connection, and because 192.168.0.0/24 and 192.168.0.0/24 are very common choices on home networks and coffee shop networks.   And also as is suggested in the OS X Server DNS article, I'd recommend a real and registered domain or subdomain of a real and registered domain on your internal network; ICANN are probably going to create a thousand or more new top-level domains here soon.

  • by pbcaer,

    pbcaer pbcaer Nov 19, 2013 12:24 PM in response to capitanu
    Level 1 (0 points)
    Nov 19, 2013 12:24 PM in response to capitanu

    Ekran Resmi 2013-11-19 19.36.26.png

    This is the localhost page.

  • by pbcaer,

    pbcaer pbcaer Nov 19, 2013 12:33 PM in response to capitanu
    Level 1 (0 points)
    Nov 19, 2013 12:33 PM in response to capitanu

    I had to change name servers to my friend's hosting. I rechanged them but it needs some time to let me access to A Zone, since my friend's name servers dont belong to me. (The zone file is unavailable because the domain's set nameservers do not belong to this registrar.)

     

    Here is the screenshot of the index page I've put right inside the folder;

    Ekran Resmi 2013-11-19 22.24.03.png

    and here is a screen when I try to open the server's ip

     

     

    Ekran Resmi 2013-11-19 21.11.09.png
    Here is another question. How can I rearrange the internal IP numbers for each device. I mean 192.168.0.3 Server 0.4 MacBook Pro 0.5 iMAc and goes on, and is it possible to clean the other once used ip numbers from the network ?
  • by MrHoffman,Solvedanswer

    MrHoffman MrHoffman Nov 19, 2013 12:51 PM in response to pbcaer
    Level 6 (15,637 points)
    Mac OS X
    Nov 19, 2013 12:51 PM in response to pbcaer

    The web files must be readable by the web server user; by user www (or use _www, depending on the context).

     

    This article on Apache on OS X describes the general process of setting up ownerships and protections, though you'll be working in (or under) the /Library/Server/Web/Data/Sites directory and not the older /Library/WebServer/Documents directory discussed in the article); you'll be using a command such as cd /Library/Server/Web/Data/Sites to get to the newer default web directory.

  • by pbcaer,

    pbcaer pbcaer Nov 19, 2013 1:23 PM in response to MrHoffman
    Level 1 (0 points)
    Nov 19, 2013 1:23 PM in response to MrHoffman

    Thanks.

     

    I found where was the directory. Right now I am waiting for godaddy to accept my nameserver edit.

     

    By the way, I only have websites and DNS sections turned on (Server app). After readding my website there, I was working on DNS, and I figured out that rather than the server's internal ip, there was external ip of mine. So probably that was the reason I couldnot manage to run the website. It couldnot find which mac the server is I think. Dont know how or when did I make that mistake. Still waiting for godaddy. Then I will share the screens.

     

    I did changeip command prompt, first it was all good, they both were same and matching. Then I changed the hostname of the server.mydomain.com thing. Now they don't match. Don't know how to take it back. Can you explain what is that for. I mean should I register another host for it on godaddy where I created name server hosts ? And what happens if I use just server.local or lan.server instead of server.domain.com ?

     

    I know that it's the admin panel for server, but does it have to be on my domain ? That'd be great if you explain it a little bit.

     

    Here is a screenshot, of DNS settings page. This IP was my external IP, then I changed it to Mac Mini's IP. This is the new look.

    Ekran Resmi 2013-11-19 23.10.12.png

     

    I think there's nothing wrong right now. I ll report back right after godaddy lets me to access A zone. Thanks.

Page 1 of 3 last Next