Home > AS/400 Tips > WebSphere Strategies for iSeries professionals > Virtual hosting for iSeries Web applications
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEBSPHERE STRATEGIES FOR ISERIES PROFESSIONALS

Virtual hosting for iSeries Web applications


Paul Holm and Matt Jensen
03.01.2006
Rating: -2.33- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



Paul Holm

Matt Jensen

WebSphere has gained significant market and mindshare in the Web application development space. Fortunately, there is a powerful, easy to use, and free alternative to WebSphere: Apache's Tomcat.

Tomcat is an open-source server and it is the reference implementation for Sun's servlet standard. Tomcat has proven itself as production quality and is used by many companies to access the iSeries. In either case, an often requested feature is the ability for one server to host multiple Web sites. The ability for a server to host multiple Web sites is called virtual hosting. This may be useful to application service providers or companies with multiple products or divisions. Since there is an abundant amount of information available on configuring virtual hosting with WebSphere, this tip will focus on how to use Tomcat for virtual hosting. Tomcat can be configured to operate as a plug-in to Apache's Web server or as a standalone server. Here, we'll demonstrate using Tomcat as a standalone server on a Windows system (though the process would be the same with Tomcat running on the iSeries).

More Information

1. Configure Tomcat

In our example scenario, we want to allow two different Web URLs to be serviced by one server: www.companyOne.com and www.companyTwo.com.

To accomplish this, we need to edit the "<Tomcat Install Directory>/conf/server.xml" and add the following:

<Host name="localhost" appBase="webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"></Host>

<Host name="companyTwo.com" appBase="webapps2"
unpackWARs="true" autoDeploy="true" xmlValidation="false"
xmlNamespaceAware="false">
<Alias>www.companyTwo.com</Alias> </Host>

The first host entry is the default local host that is already present after you install Tomcat. Company One's URL will point to this host by default. The second host entry was added for Company Two's URL. Notice the second host has <alias> tags. Any number of alias tags can be added to handle variations in the URL. For instance, the second host entry would respond to requests for both 'companyTwo.com' and 'www.companyTwo.com'. The rest of the parameters are standard defaults with the appropriate changes to name and appBase.

Next, create a copy of the "webApps" directory and give it a different name (e.g. webapps2). This new directory will be the 'appBase' for Company Two.

2. Direct or Redirect DNS

DNS is an Internet service that directs URLs to a specific TCP address. For example, when you enter: www.ibm.com An Internet DNS server translates it to something like: 129.42.20.99. We must set our two Web site addresses to the same TCP address where our Tomcat is installed and operating. This step is normally done using a Web-based utility provided by your Domain register, such as Network Solutions.

3. Test

Once steps one and two are done, you can test by simply changing the root index.html in both webapps and webapps2 to some unique content and then accessing each URL.

Note: Browsers may cache data so you may need to clear cache or restart your browser to see results. DNS changes may also take several hours to propagate through the Internet.

That's it! As you can see, Tomcat is an easy to use application server for hosting multiple Web applications and even multiple Web sites.

---------------------------
About the authors:
Paul Holm is an iSeries WebSphere and Java specialist at PlanetJ Corp. He worked for IBM-Rochester for over 10 years as a DB2/400 and Java/WebSphere developer. Matt Jensen is a Web software developer at PlanetJ Corp.

Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Web
Using geocoding on AS/400 to enhance your Web presence
RPG application gets a Web revamp at Pinnacle Foods
Antiquated iSeries ERP module gets Web overhaul
Moving legacy applications to SOA
An SOA call to arms
Survivor EDI - Accommodating Relentless Change is Key to Keeping EDI Relevant
Meeting that UCCnet Data Synchronization Mandate: Look Before you Leap!
Dynamic web enablement using RPG
UCCnet: One version of the Truth
EDI- Has the need outpaced the translators?

WebSphere Strategies for iSeries professionals
Application modernization strategies for System i
Application modernization in the i world
Natively supported Web applications for Power running i
Enterprise open source basics
Basic security considerations for a Domino/WebSphere system
Simplifying data access using Java Standard Tag Library
Integrating Microsoft ActiveX components with WebSphere
Choices for running Web workloads on iSeries
Automate WebSphere configuration backups on the iSeries (i5)
Squirrel: The universal SQL client

Web Development
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
IBM i shop boosts online sales with RPG-based Web platform
Migrating from RPG to EGL on IBM i
Groovy programming on IBM i
Running PHP open source applications: NOBODY needs authority
Zend Web software teams up with IBM System i
The best technologies and tools for System i programmers in 2009
Seven IBM i project lessons learned in 2008
AS/400 lessons from the past, present, and future: A holiday tale

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
WebSphere Development Studio Client (WDSC)  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts