Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Reply
33 replies

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.

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.

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

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

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.


User uploaded file

User uploaded file

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


User uploaded file


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

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 ?

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.

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

Dec 8, 2013 6:28 PM in response to pbcaer

pbcaer wrote:


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,...


Routers don't know from domains. Domains are DNS. Routers care about IP addresses.


and finds where the website is,


The router doesn't know where the web site is. It knows how to get from one IP address to another.



and sends them what they requested.


The IP router gets the packets to the web server, and back again. The web client then sends the target host over the connection, to be received and processed by the web server. As far as IP routers are concerned, this transfer of the web site name is just data payload in the packets. The routers neither know nor care about the contents of the packets. The routers look at IP addresses only.



Apple's tutorial said there should be static IP, and that got me confused.

I haven't looked at the Apple tutorial, so I don't know what they're referring to. For a typical web site, there would be a static IP address in the public IP address space, and a second static IP address at the web server host, and whatever firewall-NAT-router-gateway device in use will need to map packets arriving at the public address to IP packets forwarded to the internal private static IP address, and also smart enough to map returning packets from the web server back to the firewall-NAT-router-gateway device and from there along to the remote web browser.


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 ?


I don't use Server.app for that. I manually configure the settings. Check AirPort Utility and confirm the settings are as expected; that packets arriving at the AirPort Extreme are correctly configured for NAT, and being sent to the target web server. Also check that local network traffic is correctly resolving the host name and the IP address — if DNS is incorrect, then local traffic will probably fail to find the web server. Then confirm that the web site is configured in Server.app. Then check the web server logs, and see if there are packets arriving and some problem, or if the packets are not reaching the host. Further IP testing is usually with the command line ping tool; that'll indicate whether connections by IP address and DNS name are both working.


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.

There's no difference from IP and DNS, whether it's the first or the second host. I'm apparently not effectively communicating the details and the requirements here (and that's entirely on me), so I'm going to bow out of this discussion and allow somebody else to provide assistance. I'll probably just end up confusing things further, and I'd rather not have that happen.


That written, please fix your local DNS services configuration. Until local DNS servers are correct, enabling and configuring further services is something I'd consider premature, and can end up being a waste of time and effort. As services are activated, these DNS configuration issues can enter into the server-specific configuration, and these inital DNS service errors can tend to be pernicious. Restarting from scratch can be easier than clearing these, unfortunately.

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

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.