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

Previous Page 2 of 3 last Next
  • by pbcaer,

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

    Tho that guide isnot up to date. There is no Server Admin first of all and I think that makes things little bit more complex.

     

    Here is the DNS section screen shot.

    Ekran Resmi 2013-11-19 23.43.07.png

     

    Anthing looks wrong ? The guide of yours making it look easy, but without Server Admin, it's lit bit confusing.

     

    By the way mine is not Mac Mini Server, it's Mac Mini. Don't think that matters though.

  • by pbcaer,

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

    Here is the screenshot of the site. Guess now it's on my server, tho not opening the .html.

     

    Ekran Resmi 2013-11-20 01.02.12.png

     

    Now all is ok ?

  • by MrHoffman,

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

    If you check Show All Records in Server.app, then follow the guide.  DNS itself hasn't changed, nor have the trade-offs and alternatives.

     

    I generally wouldn't run the same domain names both inside and out, prefering to use a registered domain just for internal network hosts, and depending on external DNS for resolving the public sites.   If you do run the same domains inside and out, you'll have to track IP addresses at your external servers within your internal servers, if you want to reach anything in the domain that's located outside your network.  That can be a hassle.  

     

    I would also not run public DNS on OS X Server; best to leave that to the ISP and domain registrar DNS servers.  You're probably not doing that.

     

    I also wouldn't use 192.168.0.0/24 or 192.168.1.0/24 for anything as those will cause conflicts with VPN access sooner or later.  VPNs are based on IP routing, and IP routing usually gets tangled when the same subnets are on both ends of the connection, and those two subnets are used in residences and coffee shops all over.

  • by pbcaer,

    pbcaer pbcaer Nov 19, 2013 4:31 PM in response to Paul Derby
    Level 1 (0 points)
    Nov 19, 2013 4:31 PM in response to Paul Derby

    I bought that book and unfortunately it skips website publishing hence the author thinks it's too much for home use. It tells all the other things, profile manager, device manager, etc. Does it deserve that price ? ABSOLUTELY NO.

     

    Any newbie could understand what DEVICE stands for, but if you want to hear from the author that it's for devices in the network, then go pay.

     

    A server is a server, and a book about servers has to include web publishing at least half the book. My very personal opinion.

     

    Thanks anyways. Hope you don't get me wrong.

  • by pbcaer,

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

    I just figured out that the first domain was for inside. I will get a new domain for the network. You're right, thanks.

     

     

    Tomorrow, I'll do whatever you said here. Now I can see clear, and have an understanding about how things work.. Like to learn the hard way, won't forget ever.

     

    Thanks a lot.

     

    Regards.

  • by pbcaer,

    pbcaer pbcaer Nov 20, 2013 3:57 AM in response to MrHoffman
    Level 1 (0 points)
    Nov 20, 2013 3:57 AM in response to MrHoffman

    I use my ISP's dns, not public dns like google's. Here is the screenshot of the website.Ekran Resmi 2013-11-20 13.55.11.png

    what can be the reason ? How can allow the browser to display website ?

  • by muslix,

    muslix muslix Nov 20, 2013 10:09 AM in response to pbcaer
    Level 1 (0 points)
    Nov 20, 2013 10:09 AM in response to pbcaer

    This is exactly what I get as well...

  • by MrHoffman,

    MrHoffman MrHoffman Nov 20, 2013 1:53 PM in response to pbcaer
    Level 6 (15,637 points)
    Mac OS X
    Nov 20, 2013 1:53 PM in response to pbcaer
    • Remote access to your web server requires external DNS from your ISP or your domain registrar.  That gets external users from the host name to the public static IP address; to your gateway-firewall-NAT device, and that target web server host name also gets passed to your web server via the HTTP or HTTPS commands sent from your client to your server to select which virtual host will be displayed by the web server.

       

      This is likely working, and if you're testing the connections remotely.

       

    • Your gateway-firewall-NAT device must be configured to map from your public static IP address to your private IP address, and must be configured to forward TCP port 80 through.

       

      This is also likely working, if you're getting those HTTP 403 Forbidden errors, and you're testing connections locally.

       

    • The web files must be readable by the web server user.  This is the user www (or the user _www depending on the context).   This is a so-called hidden user, but it's present on all OS X Server configurations.  If the files are not at least readable (by the www user and thus by the web server) then you will receive the HTTP 403 Forbidden status.  

       

      Please see the Apache virtual hosts article for the Terminal.app commands that are used to change protections and to ownerships on the web files.  You'll need to change index.html or whatever your root file is, as well as the other files that are your web site, to be at least read-accessible by the www  user, or possibly changed to be owned by the www user.

       

    • Irrespective of your use of public DNS at your ISP or your domain registrar, your NAT'd OS X Server system requires local DNS services.  This is because ISP DNS services cannot resolve NAT'd IP addresses, and OS X Server gets tangled in the absence of proper DNS.  Possibly tangled to the point where reinstallation can be the easiest approach to resolve the issues, unfortunately.  Please see this DNS server set-up article for information on setting up local DNS services.  If you check the Show All Records tab in Server.app, the rest of the article applies, even though it references the older Server Admin.app tool; DNS hasn't changed much.

       

      To verify local DNS services are correct, launch Terminal.app on your server and issue the diagnostic command sudo changeip -checkhostname
  • by GreyWullf,

    GreyWullf GreyWullf Nov 23, 2013 10:20 AM in response to MrHoffman
    Level 1 (33 points)
    iBooks
    Nov 23, 2013 10:20 AM in response to MrHoffman

    I believe I have DNS Set up correctly, but am not sure what is still wrong.  I want to delete the server.app and remove any and all settings and/or preferences to start over from the beginning.  I find Todd Olthoff's instructions on youtube (http://www.youtube.com/watch?v=LPw0sEHqj6A&feature=em-subs_digest) to be very helpful.  I used the preious set to successfully set up server v2.2

     

    Can someone please point me to or provide a list of files I should delete before re-installing the server App?

     

    Thanks

  • by MrHoffman,

    MrHoffman MrHoffman Nov 23, 2013 11:49 AM in response to GreyWullf
    Level 6 (15,637 points)
    Mac OS X
    Nov 23, 2013 11:49 AM in response to GreyWullf
  • by GreyWullf,

    GreyWullf GreyWullf Nov 23, 2013 6:00 PM in response to MrHoffman
    Level 1 (33 points)
    iBooks
    Nov 23, 2013 6:00 PM in response to MrHoffman

    MrHoffman, thank you for the link.  I followed the instructions and removed the Server.app from my system.  After removing the App, I cleaned out the trash and rebooted.  I then re-installed the Server.app and then set it up.

     

    However I still have problems, so firstly lets refer to DNS Settings, the following are screenshots for the DNS Settings in Server.app as well as the results of the changeip command.

     

    Server.jpg

    DNS Check.jpg

    And lastly, I still believe the problems exists with folder/file permissions.  The following is the result of using the ls -al command.

     

    File Permissions.jpg

     

    I read the article on permissions for Mac OSX Server.  It recommends setting the user to "www", but I dont have such a user in my system.  I can create one, but dont know the details for the user.

     

    Thanks

  • by pbcaer,

    pbcaer pbcaer Dec 8, 2013 1:59 PM in response to GreyWullf
    Level 1 (0 points)
    Dec 8, 2013 1:59 PM in response to GreyWullf

    Your primary DNS server must be the ethernet address of your server. You can see it when you click on the Server (BG Mac Mini) section, right below the Network tab.

     

    This is what I did.

     

    Now I have a new problem, when I want to create a new website, right where you pick the IP address for the new website, my static IP doesnot display. It only shows the Server's IP address and another lan IP. In the tutorials, apple says there has to be your static IP to be picked. What's missing ?

  • by MrHoffman,

    MrHoffman MrHoffman Dec 8, 2013 3:07 PM in response to pbcaer
    Level 6 (15,637 points)
    Mac OS X
    Dec 8, 2013 3:07 PM in response to pbcaer

    You are not the registered owner of the dnsalias.com domain, and I would not recommend using that domain or any other domain you don't have registered for your own DNS services.   Sure, the folks at dnsalias.com have set up a "registration" process for that particular host and possibly subdomain, but the domain itself is not yours and you don't have that formally registered.

     

    Mavericks does have the www user, it's just a hidden user.  It is one of the many users that are not displayed by default.  All users below UID 500 are hidden.   (This is because some folks have poked at these users, made changes or deleted them, and caused themselves trouble.  So as with other parts of the Unix underpinnings of OS X, Apple hides the users.)  To view the www user, launch Server.app, connect to the server if necessary, select Users, select View > Show System Accounts.  Scroll down through the list of users that were hidden, look for World Wide Web Server in the list, click once on the user, select the gear at the bottom of the list and select Edit User.  You'll see the id www (_www) listed.  Cancel out of that screen; don't change anything.

     

    In general you will be using Apache virtual hosting and NAT, and there will not be a unique IP address associated with each of the web sites you are hosting on your OS X Server box.  This is virtual hosting, meaning the web servers aren't organized as separate boxes with separate web servers running on each.   Add the site by name within your server, within WebServices section of Server.app.   Load the files into the directory you've set up, and the rest.   Confusingly, when setting these sites up, it's the remote DNS services that have your public static IP address, and it's the remote web clients that then connect to your public static IP address, and the web clients also then pass over the name of the target web site in the HTTP or HTTPS traffic, which allows your web server to see that name in the incoming HTTP or HTTPS chatter, and use that name to select which virtual web server to display to the user.   Hence "virtual" hosting.   This sequence and this configuration also assumes you have already set up whatever device you're using for NAT at the edge of your network to port-forward TCP port 80 and possibly also TCP port 443 along to your web server; this maps your public static IP address to your private static IP address.

  • by pbcaer,

    pbcaer pbcaer Dec 8, 2013 3:51 PM in response to MrHoffman
    Level 1 (0 points)
    Dec 8, 2013 3:51 PM in response to MrHoffman

    So I don't need to add my static IP there. People enters my domain name and they are redirected to my router, and the router translates the domain name they entered to my local IP, and finds where the website is, and sends them what they requested. Guess I figured it out right now. Apple's tutorial said there should be static IP, and that got me confused. Now I know it's not needed, router does it by itself. That's clear.

     

    About NAT, I can access my AirPort Extreme on Server app, and made webservices available on it. So 80 and 443 ports are now available. But why does my website not on ?

     

    registered a new host, server.mydomain.com. My website will be mydomain.com. Whenever I go to server.mydomain.com, it shows the sample html page which is not in server's website folder, but in mydomain.com folder. Should I create a Server folder inside mydomain.com folder ? Whenever I try to go to mydomain.com it says the server cannot be found. It opens the subdomain, but not the domain itself. I know that you've warned me about registering a seperate domain for server, but for now I wanted to try this.

     

    What's missing ?

     

    I can share my screen if you'd like to help. Or any screenshot if you want me to share here.

     

    Message was edited by: pbcaer

  • by pbcaer,

    pbcaer pbcaer Dec 8, 2013 4:33 PM in response to MrHoffman
    Level 1 (0 points)
    Dec 8, 2013 4:33 PM in response to MrHoffman

    when I go to server's website, this screen displays. It looks fine. But when I try my website it doesnot show.

    Ekran Resmi 2013-12-09 02.23.15.png

     

    Message was edited by: pbcaer

Previous Page 2 of 3 last Next