Google

Local development/test domain setup

Written on:March 14, 2011
Comments
Add One

This posting shows how to setup a local domain for development and/or testing to allow access the same way as to the production system using a real URL instead of the customary development type URLs such as http://localhost:3000/system/login or http://127.0.0.1:3000/system/login for access from the host machine or http://10.0.1.100:3000/system/login for access from machines on the local network, changes are required to the hosts file.

In an earlier post “Simple RoR Deployment” I outlined how simple it is to deploy a rails server with Apache. One can use the setup also during development and testing eliminating the need to provide the port number. It is assume for this posting that you have implemented the Rails/Apache integration.

Let’s assume that the registered domain for the production site  is www.myapp.com, the quickest way is to change the development domain name to www.myapp.dev, using “.dev” instead of “.us”. This way there are no worries about the method used linking to images and other pages and there is no need to buy a new domain. In addition, if the production system uses the SSL protocol the changes include the adjustments to configure the test system to simulate the production system setup.

The only change required to the httpd-vhost.conf file as described in the “Simple RoR Deployment” article is to replace “myapp.com” with “myapp.dev”.

Changes made to the local test system

The only adjustment is to edit the hosts file. This file will override what the browser thinks of the .dev top-level domain (TLD) since .dev doesn’t really exist in the domain world. All that was required was to add the following line to the hosts file:

127.0.0.1 www.myapp.dev

This tells your browser that www.myapp.dev should point to localhost and not try to search for it elsewhere.

Changes required for systems on the LAN to access the development/test system

Since the test domain www.myapp.dev is not a valid entry found via any DNS server, each local machine on the network that wants to access the test system will need an additional entry to its hosts file.  All that is required is to add the following line to the hosts file:

10.0.1.100 www.myapp.dev

IMPORTANT NOTE: The IP address of 10.0.1.100 is based on my installation and would be different for your own system.

 

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>