# Apache2 and subdomains

**URL:** <https://www.ruby-forum.com/t/apache2-and-subdomains/108646>\
**Category:** Deployment\
**Created:** [July 5, 2007, 5:19pm UTC](https://www.ruby-forum.com/t/apache2-and-subdomains/108646 "2007-07-05T17:19:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d9b06d/32.png) [@gman](https://www.ruby-forum.com/u/gman)\
**Post date:** [July 5, 2007, 5:19pm UTC](https://www.ruby-forum.com/t/apache2-and-subdomains/108646/1 "2007-07-05T17:19:37Z")

</div>

Hi everyone,

I’ve set up rails to use dynamic subdomains with the account location  
plugin. And on my dev box I’ve been able to get the result I require  
by modifying my hosts file.

127.0.0.1 [user1.myapp.com](http://user1.myapp.com)  
127.0.0.1 [user2.myapp.com](http://user2.myapp.com)

However my question is, on the production server, if I want  
[user1.myapp.com](http://user1.myapp.com) and [user2.myapp.com](http://user2.myapp.com) ,etc to work , does this require  
an apache2 ServerAlias?  
something like ServerAlias \*.myapp.com?

I’m not to familiar with the apache2 configuration.  
Any help would be appreciated.

tks.
