# Configure server subdomains

**URL:** <https://www.ruby-forum.com/t/configure-server-subdomains/103204>\
**Category:** Rails\
**Created:** [May 2, 2007, 10:44pm UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204 "2007-05-02T22:44:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@adi](https://www.ruby-forum.com/u/adi)\
**Post date:** [May 2, 2007, 10:44pm UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204/1 "2007-05-02T22:44:48Z")

</div>

How can i configure a server to use apache, mysql, ruby on rails and to  
add how many accounts i wan’t but to give a subdomain not a port.  
thanks

---

<div class="post-metadata">

**Author:** ![adi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@adi](https://www.ruby-forum.com/u/adi)\
**Post date:** [May 2, 2007, 10:58pm UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204/2 "2007-05-02T22:58:21Z")

</div>

I’m willing to give you a hand, but I’m not sure that I, or anyone else  
for that matter, understands what you are asking.

~k

---

<div class="post-metadata">

**Author:** ![adi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@adi](https://www.ruby-forum.com/u/adi)\
**Post date:** [May 2, 2007, 11:07pm UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204/3 "2007-05-02T23:07:41Z")

</div>

Kurth Bemis wrote:

> I’m willing to give you a hand, but I’m not sure that I, or anyone else  
> for that matter, understands what you are asking.
> 
> ~k

sorry for my english.  
so i wan’t to configure my server to be a ruby hosting.  
Anyone who register to have a subdomain like [hisname.mydomain.com](http://hisname.mydomain.com)  
Now ruby can recognize only 1 host at 1 port like [mydomain.com:3000](http://mydomain.com:3000)

---

<div class="post-metadata">

**Author:** ![adi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@adi](https://www.ruby-forum.com/u/adi)\
**Post date:** [May 3, 2007, 7:09am UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204/4 "2007-05-03T07:09:34Z")

</div>

many thanks  
So i start the webrick server just 1 time on 3000 port.  
And all subdomains will be configured from httpd.conf ?

---

<div class="post-metadata">

**Author:** ![adi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@adi](https://www.ruby-forum.com/u/adi)\
**Post date:** [May 3, 2007, 5:31am UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204/5 "2007-05-03T05:31:47Z")

</div>

Oh, I think I see what you want to do…

You want to have a subdomain for each user setup, and you wish to have  
rails running on those sub domains.

Everything you require is within the command in your Apache  
conf files. Here’s mine.

> From /etc/httpd/conf.d/hosts.conf  
> –  
> \<VirtualHost \*:80\>  
> SetEnv RAILS\_ENV development  
> ServerName [xxx.xxxxxxx.org](http://xxx.xxxxxxx.org)  
> DocumentRoot /var/www/public/  
> ErrorLog /var/www/public/lmic/log/apache.log

\<Directory /var/www/public/lmic\>  
Options ExecCGI FollowSymLinks Indexes  
AddHandler fcgid-script .fcgi  
AllowOverride all  
Order allow,deny  
Allow from all

## \<Directory /var/www/public/Requester\> Options ExecCGI FollowSymLinks Indexes AddHandler fcgid-script .fcgi AllowOverride all Order allow,deny Allow from all

If I wanted to change this to a subdomain, I would make sure that I  
could resolve the subdomain via DNS, then change the first line to  
something like , and change the  
paths to reflect your setup. I’m also using Fast, so your setup might  
not be exactly the same.

Checkout the apache2 (or apache) docs. I’m sure they have them in your  
native language. [Apache HTTP Server Version 2.2 Documentation - Apache HTTP Server Version 2.2](http://httpd.apache.org/docs/2.2/)

As for running the webrick server, it shouldn’t be run in anything but a  
dev environment. I have been told by others that it is not designed for  
use as a public webserver, only a dev server running locally.

I hope that I have helped point you in the correct direction.  
~kurth

---

<div class="post-metadata">

**Author:** ![adi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@adi](https://www.ruby-forum.com/u/adi)\
**Post date:** [May 3, 2007, 5:11pm UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204/6 "2007-05-03T17:11:52Z")

</div>

This may be overkill for your situation, but it should give you some  
insights on how to do what you want (if I understand what you want to  
do)

[http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/](http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/)

---

<div class="post-metadata">

**Author:** ![adi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@adi](https://www.ruby-forum.com/u/adi)\
**Post date:** [May 3, 2007, 7:48am UTC](https://www.ruby-forum.com/t/configure-server-subdomains/103204/7 "2007-05-03T07:48:55Z")

</div>

You should not be using the Webrick server for anything but local  
development. The httpd.copnf file is an apache2 configuration file, it  
has nothing to do with webrick.

If you are running linux, there are instructions on how to setup most  
linux distributions with Apache and RoR. From trolling on this list, I  
think that it’s possible to run RoR on IIS/Windows, but I’m not sure.  
Some time spent with Google will help.

~kurth
