Skip to content

Multisite Configuration

August 5, 2009
tags:

Hi Guys,

This is my first blog on Virtual CMS. This is also my first blog anywhere. To tell you the truth, I was really feeling shy to put a blog when people told me to write blogs regularly on technical topics. I have now come out of that shell and am going to create my first blog for myself and also for Tenth Planet from me.

I was asked by the team to check out if multiple sites can be configured in OpenCms.
I knew it is possible with some configuration. But I haven’t really tried to configure and test it till now. Now here was a chance for me to do the same and make myself confortable.

As anyone would do, the moment I was told to try and configure mutiple sites in OpenCms, I started searching in Google for the steps to do the same. I got some information related to this from the OpenCms Wiki website.

The following are the steps that I tried and configured to make multisite work in OpenCms.

a. Created a new folder called “NewSite” in the root path (i.e., “/”). See screenshot.

b. Now I went to the following folder path “C:\TenthPlanet\Tomcat5.5\webapps\ROOT\WEB-INF\config” in opencms and opened the file called opencms-system.xml. The above path is in my system where I have installed OpenCms as the ROOT application.

c. Here I found the following entry which is already available in the file. See screenshot.

D. I added my entry into this, which is for the creation of the new site for which I have already created the folder in the VFS (Virtual File System).

E. Now I restarted tomcat and created a file called index.html with some content in the OpenCms new site. I also created another file with the same name in the “/sites/default” with some other content. Then published the content. So far so good right.

F. That’s it. Now I opened a new browser and provided the URL for the old site. http://localhost:8080/opencms/index.html. This URL showed the contents from the old site (i.e., /sites/default/). Now I changed the URL to the new site. http://192.168.0.25:8080/opencms/index.html. This URL showed the contents from the new site (i.e., /sites/NewSite/). This is how simple it was to create the same.

But it took for me a day to configure this. Because while doing the configuration, I tried the real website names instead of htt://localhost:8080 or http://192.168.0.25:8080. I provided the host name as http://www.siteA.com for the old site and http://www.siteB.com for the new site. This is wrong because only when the domain are registered against our IP Address this will work properly. This is how we need to configure when we go for production.

But for testing purpose since no domains are registered with our IP Address (the local machine) we need to provide the site address as only http://localhost:8080 or the machine IP where tomcat is installed. This simple thing took me so much time for me to complete because I didn’t understand how to tailor the examples given in websites to our needs.

Hope this information helps whoever reads them. Now I am trying to make this manual configuration of multiple sites into an more simpler way for the admin to configure. I am working on the customization related to that. Once that is complete I will write another blog on the technicalities of the same. See you soon.

Thanks
Krishnan

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: