Tuesday, January 15, 2008

Drupal: Multi-site installation

In drupal, it is possible to create multiple sites from ONE drupal instance. There are lots of information out on the web show how to do it, but many times are confusing. Following are some summary steps to create multiple sites in drupal:

There are two url form for multi site: subdomain (site1.domain.com, site2.domain.com) and suburl (domain.com/site1, domain.com/site2).

Example:
I want to create couple sites: www.gt.com; www.gt.com/site1; site2.gt.com. I can also create something like this: site1.gt.com/site2

1. Add virtual server to apache
NameVirtualHost *:80


ServerAdmin name@databasepublish.com
DocumentRoot "c:/wamp/www"
ServerName localhost

AllowOverride All
Allow from all





ServerAdmin name@databasepublish.com
DocumentRoot "c:/wamp/www/multisite"
ServerName gt.com //this is good enough to take care of gt.com/site1; gt.com/site2 ... (but make sure set the symbolic link otherwise you will get "page not found" error
ServerAlias *.multisite.com //this takes care of: site1.gt.com; site2.gt.com .....
ErrorLog logs/multisite_error_log
CustomLog logs/air-access_log common


AllowOverride All



( REMEMBER: all sites must point to the drupal base installation directory, also make sure to set symbolic link if using suburl format)

2. Modify window host file to point to the domain name, the location of the host file can be refer from http://leoman730.blogspot.com/2007/07/hostfile-location.html


3. Create new directories ("gt.com"; "site1.gt.com"; "gt.com.site2" under ) in path_to_drupal_installation/sites.

Tip: the directory name must match the site location by replacing '/' with '.'

Copy the settings.php file the default directory into these new directories.
Modify the settings.php accordingly for base_url, and db_url parameter.

Ex: in "gt.com.site2" directory, the base_url should be set to
$base_url = 'http://gt.com/site2';

Also need to modify the db_url to point to the correct database for each site


4. Create symbolic link for subsite (This is need is using suburl format)
I am using wamp as example, add alias by create a new alias file. The code should looks like this:

Alias /site1 "c:/wamp/www/multisite/" //multiple alias can be added here


Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all



4. Don't run the install script yet. Create new database for each site using any available tool such as phpadmin, or mysql admin

5. If the re-write moudle for appach has not been turned on yet, you need to turn that on: See this post for more info: http://drupal.org/node/15365. Turn this on will enable drupal Clean URL feature

6. Very Important. After all these modification, restart apache server and mysql server

7. Go to the new site and run the install.php

13 comments:

wholesales said...

ugg bootsTHE SNOW wholesale ugg bootsSTARTED TO FALLWholesale handbags SEVERAL HOURS wholesale clothingBEFORE HER laborWholesale jewelry began.wholesale clothing A few flakes wholesale handbagsfirst, wholesale furniturein the dull Furniture Wholesalegray late-afternoon Wholesale jewelrysky,Ceramic tileand then Micro sd cardswind-driven swirls Wholesale clothingand eddies Wholesale Jewelryaround the edges Wholesale fashion jewelryof their wide Wholesale costume jewelryfront porch. ugg bootsHe stood by her wholesaleside at the windowwholesale electronics, watching sharp gusts of snow billow,skin care products
then swirl and drift to the ground. All around the neighborhood, lights came on, and the naked branches of the trees turned white.

wholesales said...

ugg bootsOutside,uggs snow continuedHigh pressure blower to fall quietly throughIndustrial fan the darkness, Industrial bloweras bright and thick Commercial bloweras static in the wholesalecones of light castchina wholesale by the streetlights.wholesale shoes By the time he rosewholesale clothing and looked out watchesthe window, pressure blowertheir car had become a soft white hill on the edge pressure blowersof the street.fans Already his footprints blowers
in the driveway had filled and disappeared.

wholesales said...

wholesaleShe looked up, wholesale atvsmiling, wedding dresseswhen he tuckedMP3 player
the blanketwholesale mp3 around her legs.Wholesale Mp4
"You know,digital camera wholesale I've been wondering consumer electronicswhat it's like,"mp5 player she said. memory cards"Before we're born,Car video players I mean. It's too bad we can't remember." gps devicesShe opened her robe and pulled up the bluetooth headsetsweater she wore underneath, revealing a Mp3 Wholesalebelly as round and hard asMp3 Wholesale a melon. Mp4 WholesaleShe ran her hand across its smooth surface, Mp4 Wholesalefirelight playing across her skin, casting reddish gold onto her hair.

wowgoldme said...

cheep wow gold,buy wow goldworld of warcrft gold.

Affordable Luxurious Wedding Dress Blog said...

cheap wedding gownsdiscount bridal gownsChina wedding dressesChina wedding online store

chinaspecial said...

China Highlights
China Highlights
China Tours
China Hotels
China Attractions
Beijing China Travel
Shanghai China Travel
Xi'an China TravelGuilin China TravelYangshuo China Travel
China custom toursChina special toursChina custom TravelChina special travel

筱娅 said...

Have you heared about 9Dragons which you need use shadow of legend Gold to play, and you can also borrow sol gold from other players? But you can buy shadow of legend Gold, or you will lose the choice if you do not have cheap shadow of legend Gold. If you get shadow of legend Gold money, you can continue this game.
Have you heared about 9Dragons which you need use kal geons to play, and you can also borrow kal gold from other players? But you can buy kal online geons, or you will lose the choice if you do not have kal online gold. If you get kalonline Geons, you can continue this game.

Affordable Luxurious Wedding Dress Blog said...

cheap wedding gownsdiscount bridal gownsChina wedding dressesChina wedding online storediscount designer wedding dresses

game gold said...

Without hesitate, I bought second life linden , in the game I can find myself. I feel lonely, but I do not want to talk with anyone, so I buy lindens . At present, think the happy day I spend in knight, I am eager to enter it, and buy cheap linden . Own linden dollars , it means that you own the life of happiness. So I will not leave secondlife money . It is the origin of the happiness.

Buy Rom Gold is the chance. I always have a bad dream when my account was theft, since I buy Rom Gold ; I had not had the bad memory. At present, I want to say thanks to the people who stole my account, if he did not to do that, I would not play game, I would not have Runes of Magic Gold . Although I have little Runes of Magic money , I will on the way of the game for long time. At one time or another, I am a pessimistic person, but when I have cheap Runes of Magic Gold , it changes my attitude of life.

jislsnhd said...

It is the maple mesos which make me very happy these days, my brother says mesos is his favorite games gold he likes, he usually buy some cheap mesos to start his game and most of the time he will win the maplestory mesos back and give me some maple story mesos to play the game.
I always heard something from my neighbor that he sometimes goes to the internet bar to play the game which will use him some maple mesos,he usually can win a lot of mesos,then he let his friends all have some cheap mesos,his friends thank him very much for introducing them the maplestory mesos,they usually maple story mesos together.

feilin said...

I think 4story Luna changes my life. Because of 4story Gold, I meet a lot of friends. Besides, my friends usually give me some 4story money. I usually buy 4story Luna through Internet and advice from my friends, so I gain a lot of cheap 4story Luna and harvest in life.
Flyff is a very good game. Through buying flyff penya, I find fun in it. I am so glad that I can earn a lot of flyff money. Flyff cater to the taste of young people. With cheap penya, you can get everything you want in this game. So I like to buy flyff penya. For me flyff gold is not just a simple thing.

woow said...

Do you play any internet game? Do you know WOW? The biggest and the most famous mmorpg. What is your hero's level? Do you want to make them more charmful, more powerful? If you use yes to answer my questions, then I guess you must want to get much more gold to make your hero more charmful and more powerful. How do you get the gold? farm by yourself or just buy the gold from some internet store? If you have the habit to get the gold from internet store, I strongly recommand you get wow gold from Masswowgold.
Masswowgold is a professional site designed specifically for tradingWorldofWarcraft gold from gamer to gamer. Not only is the price cheaper than other sites, but also the service is instant, secure and professional. Masswowgold dedicate themselves to offer WOW players with great prices and quality services. They do instant delivery through customer service 24 hours a day, 7days a week and the prices are updated regularly according to current market rates. You can buy cheap wow gold from masswowgold, fast delivery and good service. Masswowgold is a booming provider of MMORPG virtual currency and assets including buying & selling service. It has started its online selling since 2004. It supports payment by Paypal, Credit Card, Moneybookers ,Western Union and Bank Transfer. With its advanced internal ERP system, extensive supplier network, enthusiastic employees and 24/7 live chat; Masswowgold has helped about 150,000 WOW players. Its concept is: Honesty, Enthusiasm, Innovation and Cheap. New chapters will be written by its unceasing innovation.
Hope what i said just now is useful for you and for your WOW life. Hope you can enjoy your WOW life better with WOW gold from masswowgold.

Aion also is a very interesing game, new game. But i dont know if it has been started in USA. It is very popular in Korea and China. 永恒之塔代练 is a very hot word in China. Many people want to level their hero become high level, but they have not enough time to do that. So they just let others to help them. Beuwant provides this kind of service. They do the powerleveling with hands but not bots, so aion代练 is very safe.

Jerry said...

cheap wedding gowns,
discount bridal gowns,
China wedding dresses,
discount designer wedding dresses,
China wedding online store,
plus size wedding dresses,
cheap informal wedding dresses,
junior bridesmaid dresses,
cheap bridesmaid dresses,
maternity bridesmaid dresses,
discount flower girl gowns,
cheap prom dresses,
party dresses,
evening dresses,
mother of the bride dresses,
special occasion dresses,
cheap quinceanera dresses,
hot red wedding dresses