ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

How to Publish Multiple Websites Using a Single Tomcat Web Application
Pages: 1, 2, 3

Summary of Setup Procedures for Creating A New Website in Knowledge Folders

  1. Register a domain with a domain name registrar (such as GoDaddy.com).
  2. Provide name servers for the domain.
  3. Associate/inform IP address with name servers via an email to the hosting providers.
  4. Add an alias to Tomcat server.xml under the host corresponding to the web app.
  5. Make changes to the aspire configuration to tie the domain name to an individual account.
  6. Optionally set up an email account for the domain.
  7. Write down the passwords for all of the accounts you have set up.

The Email Option

As it exists today, Knowledge Folders is quite flexible and convenient to create websites without any additional tools. This is a great advantage for small companies that want to have a web presence quickly without having to buy any hosting space. Nevertheless, these small companies also usually want a basic email address at the domain so that they can use it on business cards or as a general advertisement. This can be done in two ways.

Setting It Up with Indent

You see, there are three players in this solution. The domains are registered at GoDaddy. The Windows server on which the software runs is sitting on the Peak 10 network, which requires that I use their name servers. The actual Windows server is owned and operated by Indent.

So the first option involves alerting Indent to create email accounts. Indent uses the James mail server. Indent usually uses a manual process to either create a full-fledged email account or provide email forwarding for that account.

Using GoDaddy's Email Accounts

Registering a domain at GoDaddy generates a free email account for each registered domain. You can also purchase additional email accounts if needed. GoDaddy also offers email forwarding and online tools to manage these email accounts.

But it is tricky to use these email accounts at GoDaddy if the original mail server for your domain is at a hosting facility. You have to set up MX records and CNAME records at the mail server to accomplish this.

GoDaddy recommends adding the following to the domain-name system manager:

MX 0 - smtp.secureserver.net 
MX 10 - mailstore1.secureserver.net

What Are MX Records and How Do They Work?

According to an MX FAQ, a mail-sender program checks the domain-name system to see if the server has an MX record pointing to another mail server. If it does, then it will use that server as the target server. It may even be recursive. This is one way to redirect the mail. This is how the MX records at Peak 10 will reroute the mail to GoDaddy, meaning I could use the email accounts at GoDaddy. It is sufficient to set the MX records only for the root domain name and not the CNAMES. For instance, to set up MX records for www.knowledgefolders.com, it is sufficient to set them for "knowledgefolders.com", because the email is going to be addressed to somemail@knowledgefolders.com.

Adding CNAMES To Fine-Tune The Email Solution

According to another CNAME document, CNAME records are aliases at the domain-name server (in this case, Peak 10) redirecting the traffic. For example, I can set up a CNAME record at Peak 10 for pop.knowledgefolders.com pointing to pop.godaddy.com. This will allow Outlook to specify the pop-name server as your domain-name server. Something similar can be done for smtp CNAME, and for the webmail at GoDaddy if needed.

Limitations of CNAMES

CNAMES are aliases to host names. They also introduce new names into the domain-name space. For example, if I have a domain registered as knowledgefolders.com, then a CNAME record can introduce another host into the domain-name space called myhost.knowledgefolders.com. This only works as long as the new host names you are introducing are all suffixed with knowledgefolders.com. For example, you can not introduce a CNAME called somehost.some-domain.com when you don't own some-domain.com.

Nevertheless, you are entitled to point somehost.your-domain.com to some-other-host.someoneelsesdomain.com, which is how the indirection of SMTP and POP mail servers is achieved.

End Result

At the end of all of this, I was able to publish the following distinct websites using various accounts in Knowledge Folders. Let's take a look:

  1. www.knowledgefolders.com points to the original home page of multi-account Knowledge Folders.
  2. www.knowledgefolders.org points to the documentation website for Knowledge Folders.
  3. www.knowledgefolders.net points to my personal account in Knowledge Folders.
  4. www.satyakomatineni.com points to my personal account in Knowledge Folders, as well.
  5. www.kavithakomatineni.com points to the website I manage for my daughter.

I use Knowledge Folders for a number of things:

  1. I manage my weblogs.
  2. I manage documentation for Aspire/J2EE.
  3. I support Aspire/J2EE using feedback.
  4. I manage documentation for Knowledge Folders.
  5. I collaborate with teams to develop websites using a project portal concept where project documentation is maintained.
  6. I create static websites for small companies.
  7. I manage my daily, weekly, and monthly tasks and to-do lists.
  8. I run tutorials.
  9. I conduct my research.
  10. I publish articles.

Future Possibilities for Web Hosting

Currently the process of creating websites is very disjointed; one must follow numerous steps to get a web presence today, but the trend is certainly toward simplification. Especially with something like Knowledge Folders, it is possible to imagine a time when consumers could visit a site, create an account, and post their content on the Web right away. The back-end details can be automated. By managing our tasks and schedules, publishing, and collaborating from the same site, we're heading toward something like a "web OS."

Satya Komatineni is the CTO at Indent, Inc. and the author of Aspire, an open source web development RAD tool for J2EE/XML.

Return to ONJava.com.