Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have set up a Cloud Server instance on Rackspace, and I have purchased a domain name and directed it to the IP address of my server because I want to host a Sinatra application on this server, but it's my first time doing this and I need some pointers.

My primary confusion is: when I hit the IP address or the domain name in the browser, how is Ubuntu going to know which directory it should serve the files from? Is there a configuration file I should modify? I already modified /etc/hosts with this:

173.1.1.23 my.domain.com

(not the real IP address)

But that doesn't work. My app is running...so I don't know what is missing here. Has anyone set up a site on Rackspace? Any insight would be much appreciated.

Secondary confusion is: is it possible to point a domain name to an IP address without a name server? Just curious. GoDaddy made me think it was, but now I'm not so sure. :-/

share|improve this question

migrated from superuser.com Jun 4 '10 at 15:15

This question came from our site for computer enthusiasts and power users.

4 Answers 4

up vote 2 down vote accepted

Basically what happens when you type www.example.com in your browser is this.

  1. The browser looks up the IP address for the domain name from a DNS server.
  2. The browser sends a request for the particular resource to the given IP address (but also passes the human-readable address (the domain name), so that one IP address can serve many websites).
  3. The server returns the resource.

A much more detailed description is at http://igoro.com/archive/what-really-happens-when-you-navigate-to-a-url.

Basically if you have only one site being served from that IP address then there's nothing you need to do to associate the DNS name with the IP address on the server itself. You just have to ensure you've got the record set up appropriately on the DNS server.

If you want to serve different websites with different domain names from the one IP address then check out http://httpd.apache.org/docs/2.0/vhosts.

is it possible to point a domain name to an IP address without a name server?

I'm not sure exactly what you're getting at here. For a computer to get your IP address from a given name, it's either got to be in the specific computer's host file, or on a DNS server.

HTH

Andy

share|improve this answer
    
Thanks, I need to read up on how DNS servers work. I used to host my site on a shared hosting service, and they made me use their nameserver urls, and I had to enter those to GoDaddy, where I purchased the domains. I did this without thinking how it worked, and now I'm feeling like fish out of water, and not sure if it'll work when I just give the IP to GoDaddy. –  picardo Jun 4 '10 at 11:35
    
See if anything here helps: rackspace.com/apps/support/portal/1110. If you have any specific Qs do ask. –  Andy Jun 4 '10 at 11:42

The name servers for the rackspace cloud are

dns1.stabletransit.com and dns2.stabletransit.com

For anyone struggling with this please read instructions here, it explains it well

http://cloudservers.rackspacecloud.com/index.php/DNS_-_Creating_a_DNS_Record

I can sympathize with the OP as I had to search for a while to figure this out, since if your coming from a background of shared hosting, how DNS works will be completely unknown if you have not read up on it or done it before

share|improve this answer

You probably need to setup your virtual host directives.

I would also suggest giving the fanatic support a call.

share|improve this answer
    
"Fanatic support" live chat agent was pretty apathetic this morning. It's kind of annoying that I can't avoid their popups telling me to try their live chat everytime I vist, and when I do, I wish I hadn't. –  picardo Jun 4 '10 at 11:31

Sinatra applications are a bit different to standard webservers like Apache. You create your sinatra application as a file (say hello.rb) and then just run that file for it to start hosting your web application. It'll default to a non-standard port number, but you can configure it to run on any port.

That's the basics if you're just wanting to host one simple Sinatra app for testing. If you're going to be hosting multiple Sinatra applications or want to do it "the proper way" then you'll need to use Passenger. This page describes the basics of getting Sinatra to run with Passenger and Apache.

I should also mention that if you are just wanting to host something for testing/development purposes then Heroku might be good for you. They can be pretty expensive once you start actively using it, but for development purposes it's quite nice.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.