How to set up local OS X Server Site with DynDNS to make it accessible online

Hi


I have a Mac Mini Server running Yosemite OS X Server. I've managed to set up the server with a custom site (not the default on 'localhost' which I want to keep free for internal use) that runs Wordpress. It's basically a local development site and what I would like to to is make it accessible to a client over the Internet via DynDNS (as I don't have a fixed IP). This is pretty straightforward with MAMP Pro and I've managed to get that working fine with Dyn, but I can't find any specific setting or instructions on how to achieve this with OS X Server. I was hoping that someone in the community could spread some light on it? I have a paid Dyn account and can set up multiple hosts.


Thanks


Glennyboy

MAC MINI SERVER (LATE 2012), OS X Server

Posted on Nov 27, 2014 1:47 AM

Reply
9 replies

Nov 27, 2014 2:57 AM in response to glennyboy

I believe the general steps would be to do the following.


  • Setup DynDNS to point a host name to your dynamic IP
  • Setup a website on your Mac server
  • Setup port-forwarding for port 80 to go to your Mac server


The issue likely to be the most complex is the fact your running multiple websites on the same port 80 - unless decide to run your site on a non-standard port. Apache can 'see' the host name requested and then provide the matching site you have defined but usually this is with properly matching DNS records as far as the server itself is concerned. I as an example do run multiple sites on port 80 on the same internal server but I also use an internal DNS server to allow those host names to all properly resolve internally.


You could if needed look at running your DyDNS hostname on your internal DNS server, this would be a static entry pointing to your servers LAN address.


If your server has a public IP address and is not on the inside of a NAT gateway then this issue will probably not apply.

Nov 27, 2014 3:12 AM in response to John Lockwood

Hi John


Thanks for the response.


As far as I can see I have covered all of those 3 points and I think it's the last issue with resolving my sites hostname to that of the dyndns. In my setup I followed a similar config as MAMP and rather than specifying a 'domain name' in OS X Sites I called my site 'myhostname' and then added it to my hosts file. That may be unconventional to some, but it works fine and I don't need a domain linked right now.


So the website is running fine on http://myhostname' and I have a DynDNS host so the question is how do I link the two on port 80 like MAMP does? You mentioned a internal DNS Server is that what I am missing? If so how can I go about setting one up?


Thanks

Glennyboy

Nov 27, 2014 3:38 AM in response to glennyboy

If your behind a NAT then as mentioned you will be forwarding the port 80 traffic to your internal server. Apache then (the web server running on the Mac) looks at the URL that was requested - sees the hostname in that URL and should return the matching website.


The Apache Apple include is pretty much a standard Apache as included in MAMP. Some of the setting files are in different locations and some of the settings will be different but the basics of Apache are the same.


You would define a website in Server.app with the hostname defined via DynDNS e.g. name.dyndns.org and set it normally to answer on all IP addresses and in this case on port 80.

Nov 27, 2014 4:52 AM in response to John Lockwood

Hi John


Thanks for your help which put me ion the right track.


I had done everything correctly except I realised that as I wasn't using the domain name / host as provided by DynDNS. I needed to specify that domain/host under 'Additional Domains' and it then worked. As I am working on multiple hostnames under Wordpress I find that this plugin is the only one that seems top fix all file referring between the multiple hosts:-


https://wordpress.org/plugins/dynamic-hostname/


I hope the plugin author keeps it going :-)


I've got a few issues with my Billion Router to keep things stable and I'm in chat with them - other than that I'm good so thank you.


Cheers


Glennyboy

Nov 28, 2014 8:04 AM in response to glennyboy

With NAT you can only forward port 80 to a single destination. Either you would have to have a different port for each, or a different host name for each. If you use a different host name for each then Apache should see that and return the matching website. If there is not a match then it will show the default server site.


E.g. site1.domain.com site2.domain.com site3.domain.com etc.

Dec 1, 2014 2:40 PM in response to glennyboy

In theory if you are accessing your sites via something like site1.dyndns.org or site1.domain.dyndns.org then when you do so internally it should direct your users to the same external public IP address of your server and in theory you should end up back on your server with the matching site.


Test this by doing a DNS lookup on the LAN for your sites hostnames e.g. site1.dyndns.org and it should return your public IP address.


Alternatively you would setup an internal DNS server to point the same hosts to the internal LAN IP address of your server. However if your hosts are not in your own domain then you would remove the ability to access other people's hosts. That is if your hosts is like site1.dyndns.org you would not be able then to access someoneelse.dyndns.org as this would not be defined on your own internal DNS server.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to set up local OS X Server Site with DynDNS to make it accessible online

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