How does one get started with multiple domains using the Play Framework? In other words, the same server will serve content for both somedomain.com and anotherdomain.com, and both of these domain's content will be served by the Play Framework
Do you set up Play behind Apache for example, or can you configure virtual hosts on Play itself. I'm starting with a blank Linux server, and just want to know how to get started, i.e. should I mess about with things like Apache, or will I come right with the Play Framework alone?
Using front-end HTTP server is typical solution, otherwise you would need to access each application on the separate port and/or IP address.
Additionally HTTP servers allows you to work with SSL
(Play 2.x doesn't support it!) so if you plan to create secure connections you will need to use scenario described in doc.
Finally using server will allow you to incorporate other useful things like load-balancing, serving static (really static) content in CDN-lke mode with very precise cache settings etc...
Just one tip: if only job for the HTTP server will be just proxying the Play apps, consider using some lighter option than Apache, for an example nginx
or lighttpd
, you'll find sample configurations for all of them in Play's documentation.