Jump to content

Setup a local office development dns setup


Recommended Posts

Hi

 

Currently, the developers in the office have been building on their own local installations of xampp. To use a test domain we would set up a virtual host in the apache config files and link our ip to a test domain e.g. newsite.dev. In order for someone else to view the site, they would have to go through the same process on their mac.

 

We now have a windows server installed so we can all connect to it. We are in the process of having wamp installed so we can all access the same version of each site.

 

Is there a way we can quickly assign a test domain to each new site once...i.e. without having to do it manually on each computer that is going to connect to it? Some sort of local dns server???

Link to comment
Share on other sites

Why on earth would you be using Windows as a development environment?

 

And yes, of course there are DNS servers you can run locally. I use dnsmasq on Linux as it's simple to configure. On Windows? I wouldn't know, but I'm sure it comes built into the server versions.

Link to comment
Share on other sites

Yes, Windows Server has DNS software. Set it up with CNAMEs (aliases) for each domain to each computer serving it. Or if each computer has static IP addresses you can use A records instead.

 

For example, point "newsite.dev" to "wscomp123" (where WSCOMP123 is the name of the computer hosting the newsite.dev web server).

Link to comment
Share on other sites

Ok requinix! that sounds like the type of thing I am after!

 

I have logged into the windows server and have found the DNS Manager. Let's say I have wamp on there and a site in a folder /htdocs/websiteOne/

Is it straight forward enough to assign that location to a domain www.websiteOne.dev so that all computers that are on our network and connected to the windows server would be able to type that domain into their web browser address bar and resolve to the test site?

 

If it's a long winded solution, you can just point me in the direction of a tutorial or relevant section in the documentation. As far as I know it's an SPS windows server 2008

 

Thanks

 

***and on a side note...will a wamp setup on windows still handle php/mysql exactly the same as your average linux php web hosting? Or are there some subtle differences I should be aware of when shifting from the test server to a live linux one? (unfortunately, it is a windows server because they already had it before I started here so stuck with it for now)

Link to comment
Share on other sites

I have logged into the windows server and have found the DNS Manager. Let's say I have wamp on there and a site in a folder /htdocs/websiteOne/

Is it straight forward enough to assign that location to a domain www.websiteOne.dev so that all computers that are on our network and connected to the windows server would be able to type that domain into their web browser address bar and resolve to the test site?

Hostnames don't resolve to web sites - they resolve to servers. You can't tell DNS where a website is, but you can tell it where the computer that hosts the website is. There's a subtle difference. But yes: if you create a websiteOne.dev name that refers to the right computer then anybody using the network's DNS server will be able to visit the websiteOne.dev website.

 

To save yourself some trouble, I recommend a hierarchical system of names. For example, instead of websiteOne.dev use websiteOne.john.dev. Two advantages: one is that it's clearer as to whose version of websiteOne you're looking at, and two is that you can create one *.john.dev DNS record that will catch every hostname created; John could set up websiteTwo.john.dev and you wouldn't have to update the DNS.

 

and on a side note...will a wamp setup on windows still handle php/mysql exactly the same as your average linux php web hosting? Or are there some subtle differences I should be aware of when shifting from the test server to a live linux one? (unfortunately, it is a windows server because they already had it before I started here so stuck with it for now)

There are a few differences, but if you pretend that you're on a Linux machine then you'll be mostly safe. The biggest difference is in paths; use relative paths instead of absolute, or use variables like $_SERVER["DOCUMENT_ROOT"] and magic constants like __FILE__ or (in PHP 5.3+) __DIR__. Keep in mind that Windows is case-insensitive while Linux is case-sensitive. The next biggest difference is probably missing functions on Windows. 5.3+ provides implementations for a few, but in 5.2 Windows versions of PHP miss out on some functionality (strftime() and fnmatch() for example).

 

But for the most part you won't notice much: if it works on Windows then it'll probably work in Linux (given a similar PHP installation (ie, installed extensions and the like)).

Link to comment
Share on other sites

Thanks a lot!

 

I managed to get it working by adding an A record and associating it with the IP address, but as you said, just for a single site. I would normally have xampp running locally on my mac, add a virtual host in my xampp config file, then add a domain in my hosts file so I can run several sites on several domains at the same time. I assume that if I just add a virtual host on the windows server's version of wamp, it will work the same? I was hoping to avoid that and thought that perhaps there was a way of associating a domain with ip/path_to_site in the A records. :(

 

Are those differences applicable to xampp vs wamp - I assumed they would work exactly the same, but maybe only a php install on IIS would be different?

Link to comment
Share on other sites

DNS records only relate IP addresses with server names. The server has to be configured separately for each website it hosts.

 

XAMPP and WAMP both use Apache so there aren't really any differences there. Yes, use VirtualHosts.

DNS has nothing to do with Apache or IIS so there aren't any differences there either.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.