kamel Salah
kamel Salah

Reputation: 31

How to host multiple websites on GlassFish 4.0 server

I have GlassFish 4.0 and I want to host tow different websites on it by uploading war files,

So I have the first website in (web1.war) and the second website in (web2.war), How can I access them using (www.web1.com) and (www.web2.com) using GlassFish 4.0 server.

Assuming for sure that (www.web1.com) and (www.web2.com) are reserved domains for me and GlassFish 4.0 is installed on a public server with a public ip.

Upvotes: 1

Views: 1803

Answers (1)

Mike
Mike

Reputation: 4963

There are lots of different things you need to configure here:

  1. Acquire the domain names
  2. Configure the domain names to point to the IP of the host server
  3. Configure GlassFish Virtual Servers to handle requests on your domain names
  4. Deploy web apps to GlassFish, choosing previously configured virtual servers

The GlassFish 4.0 administration guide [PDF] details how to use Virtual Servers to achieve this in section 14-2 and from 14-11 onwards.

The alternative way to do this is with Apache web server, which allows you to configure VHosts based on the URL used in the request. These requests can then be proxied to GlassFish. This configuration is equivalent to using GlassFish's virtual servers feature.

Upvotes: 3

Related Questions