Trip
Trip

Reputation: 27114

Setting up a Vanilla Box, how does DNS redirection work?

I'm looking into purchasing a box with EngineYard to host all my clients small websites.

The catch with this, is that I'm unsure if its possible to host multiple websites on a vanilla box, and still have their DNS' align properly.

The server would be hosting both Rails and PHP based projects.

Could someone point me in the direction of how to set up a box from scratch with the ability to host multiple applications?

Will also accept any recommendations as well :)

Thanks!

Upvotes: 1

Views: 155

Answers (1)

tadman
tadman

Reputation: 211700

DNS is only used to resolve the IP address for a particular host name or domain. You must also independently configure your web server, be it Apache, nginx, or otherwise, to respond to these hostnames and domains when receiving requests, directing them to the appropriate PHP or Rails site as required.

Apache has a VirtualHost directive for this purpose, and nginx also supports virtual hosting using different directives. The concept is exactly the same, though, it's all about routing the request internally to the appropriate application or directory.

If you're looking to set up something from scratch on EC2 you may want to find a disk image that's at least most of the way there instead of an out-of-date Fedora or Ubuntu image that will require extensive patching in order to be current. Rightscale provides a number of these, as an example, but Amazon lists hundreds of them in their launcher tool. You may need to experiment to find one that works for you.

Upvotes: 2

Related Questions