Sub URI for multisites at one domain » History » Version 1

Jiongliang Zhang, 2010-01-22 13:20
starting writing

1 1 Jiongliang Zhang
{{>toc}}
2 1 Jiongliang Zhang
3 1 Jiongliang Zhang
h2. Why we need SubURI in one domain for multisites
4 1 Jiongliang Zhang
5 1 Jiongliang Zhang
When there are many web sites on your hands, then how to deploy? what their relationship should be? If you are richer, and never care about money, then you can deploy them one server machine one site. But, as you know, we programmers, not so rich as we are, so... we may consider deploy one server machine multisites, and maybe we just want to deploy them at the server machine just has one network interface card, it means there is just one ip address. One ip address, there are also two resolving ways (If there's error, just tell me), one is virtual host (it needs to configure DNS server A record.), the other is multi directories. In there, I want to tell the second one.
6 1 Jiongliang Zhang
7 1 Jiongliang Zhang
h2. What it looks like
8 1 Jiongliang Zhang
9 1 Jiongliang Zhang
The multi directories deploy way, call it sub-uri way, is look like this:
10 1 Jiongliang Zhang
* resuming the domain is "pfg.com" (ip address is ok), 
11 1 Jiongliang Zhang
* there are two or more rails applications, app1, app2, ... appN
12 1 Jiongliang Zhang
* web server is apache2.2
13 1 Jiongliang Zhang
* Ruby 1.8.6
14 1 Jiongliang Zhang
* Rails 2.1.x or Rails 2.2.x (a little different)
15 1 Jiongliang Zhang
16 1 Jiongliang Zhang
<pre>
17 1 Jiongliang Zhang
http://pfg.com/app1
18 1 Jiongliang Zhang
http://pfg.com/app2
19 1 Jiongliang Zhang
...
20 1 Jiongliang Zhang
http://pfg.com/appN
21 1 Jiongliang Zhang
</pre>
22 1 Jiongliang Zhang
23 1 Jiongliang Zhang
Next, I will tell you how to configure them.
24 1 Jiongliang Zhang
25 1 Jiongliang Zhang
h2. How to configure them in Rails application
26 1 Jiongliang Zhang
27 1 Jiongliang Zhang
h2. Attention