• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Setting up web sites

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problems with the configuration of Websphere.
I am using IBM HttpServer and Webshere Application Server 5.

I think this should be really easy to do - I can do this when using Tomcat.
I want to setup 2 web sites. I have 2 application already running on Websphere Application Server.
I want to setup a url e.g. www.test.co.uk and have this "pointing" to my first application e.g. myapp1
I want to setup a url e.g. www.test2.co.uk and have this "pointing" to my second application e.g. myapp2
Can anybody help me with this?
Surely someone has setup 2 web sites on a system that uses the http server and the application server.
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you set
http://www.test.co.uk
and
http://www.test2.co.uk
in DNS to point to some server IP:80 then without some path info I don't see how tomcat can resolve the requests unless in a filter or a front controller handling the request HttpServletRequest.getRequestURL() is invoked.
Now
http://www.test.co.uk/xxx
and
http://www.test2.co.uk/yyy
is a different story...
[ April 16, 2004: Message edited by: Rufus BugleWeed ]
 
Davie Ali
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes both web sites point to port 80 of the server.
In Tomcat you can set up 2 different virtual hosts. Each virtual host has a different "docbase" (as it is in Tomcat - Document Root in the IBM Http Server).
By doing this the first virtual host will route all requests for www.test.co.uk to a particular application and the second virtual host will route all requests for www.test2.co.uk to a different application.
I have this setup and working in a production environment with standalone Tomcat BUT how can this be achieved in the IBM HttpServer / Websphere.
Surely somebody out there has setup 2 different web sites on the same server ?
Rufus by needing the application context (xxx) then a user wishing to get to a web site would have to put www.test.co.uk/xxx into the browser ? This is not very practical and it is like setting up Google to be www.google.co.uk/myapp ??
[ April 16, 2004: Message edited by: Davie Ali ]
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IBM HTTPS supports virtual hosts in httpd.conf
#<VirtualHost host.some_domain.com>
#ServerAdmin webmaster@host.some_domain.com
#DocumentRoot /www/docs/host.some_domain.com
#ServerName host.some_domain.com
#ErrorLog logs/host.some_domain.com-error.log
#TransferLog logs/host.some_domain.com-access.log
#</VirtualHost>
But then that's not the plugin.
[ April 16, 2004: Message edited by: Rufus BugleWeed ]
 
Davie Ali
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I know about the virtual hosts in the httpd.conf file - the question is if you wish to setup one of these virtual hosts in this file what should the Document Root be set to when you are wishing to "point" it to an application on the application server
[ April 18, 2004: Message edited by: Davie Ali ]
[ April 18, 2004: Message edited by: Davie Ali ]
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I honestly don't think it matters what the doc root is set to. The WAS plugin will intercept all URL's bound for it without regard to the document root -- now if you want to host static content outside WAS, you'll need to set these to point to the directories holding that content, of course.
Kyle
 
Davie Ali
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I have tried it and it does not work. Maybe I need some fixpack or something. Kyle I tried the context root set to "/". But I cannot set two application's context roots to this unless they are in a different virtual hosts in the application server.
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's how it works -- the combination of virtual host and context root is used to determine what application to route the request to. But I thought that's what you were trying to do? If you do set up two virtual hosts in the app server, and in the web server it should route requests for "vhost1/" to application 1 and "vhost2/" to application 2. Isn't that what's happening?
Kyle
 
Davie Ali
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kyle - so to confirm you are saying to set up 2 virtual hosts in the app server each virtual host has one application in it with a context root "/"?
I DO NOT have to do anything in the IBM HttpServer as the plug-in will take care of it. Is this correct?
 
When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!