DNS Setup

Browser security constraints effectively mandate putting your static host and our database server under the same domain, under different subdomains. For example, our javascript example pages are hosted on the site 'www.paginaswww.com', but the database is accessed as the site 'rdbhost.paginaswww.com'. That is, 'rdbhost.paginaswww.com' is an alias for our server 'dev.rdbhost.com', where the database is hosted.

The jquery.rdbhost.js module and the database content page received each manipulate the domain name as necessary to allow the received data to be processed, but browser security constraints require the common domain for both the requesting page and the data page.

DNS Manager Web App

Generally, you would set this up using the DNS manager web application provided by your registrar. Use an 'A' record for the subdomain you create to address the rdbhost.com server. We recommend the subdomain 'rdbhost', but you are free to use something else. If you do use another, be sure to use the 'subdomain' option in jquery.rdbhost.js, so that that module knows what to use.

For a detailed tutorial on how to set up subdomains on GoDaddy.Com, see GoDaddy DNS Setup page.

The below is a screenshot snippet from the internet.bs registrar where I hold some domains.

Your domain registrar should have a DNS manager page that is similar.

Localhost

If you are developing on a local server (I may be the only web developer I know that doesn't do this as standard operating procedure), you can setup a hosts file with contents like this:

127.0.0.1 localhost.tld www.localhost.tld 208.78.103.48 rdbhost.localhost.tld

The localhost option must have at least two parts, such as 'localhost.tld', or 'localhost.me', and not just 'localhost'. The db option must be at least 3 parts, where the last two match the above.

The hosts file is located in /etc on Ubuntu, and somewhere in the C:\windows\... directory tree on Windows XP. On my machine, the path is C:\windows\system32\drivers\etc\hosts, but the location varies from Windows version to version.

Once the hosts file is setup, you can startup a local web server, point your browser at http://localhost.tld or http://www.localhost.tld and test as usual. The Rdbhost database access should work fine.

If you need a web server for simple static file serving, and do not wish to install one of the high quality free servers available, you might try the server below, run from the document root. This is what I have been using to serve static html and javascript files for local testing.

import SimpleHTTPServer import SocketServer PORT = 80 Handler = SimpleHTTPServer.SimpleHTTPRequestHandler httpd = SocketServer.TCPServer(("", PORT), Handler) print "serving at port", PORT httpd.serve_forever()