Skip to main content

Configuring Virtual Servers

4 replies [Last post]
rbair
Offline
Joined: 2003-07-08

Hey,

Problem: Trying to host several websites on one server with one network card

Background: Was using Apache & Tomcat, seeing if I can get away with just using glassfish. I've looked into the admin guides for SJAS 8 enterprise, but was left a little confused on this line:

"Because a virtual server must specify an existing HTTP listener, and because it cannot specify an HTTP listener that is already being used by another virtual server, create at least one HTTP listener before creating a new virtual server."

I'm confused, because it seems that this line is saying that you cannot have more than one virtual server on port 80 (for example). If this is true, then how can I host www.aaa.com and www.bbb.com on the same machine? Would I have to insert some other server that would route www.aaa.com requests to a different port than 80 for the glassfish server?

Richard

Note: All solution attempts are done using the GUI, though recovery was sometimes done on the command line.

Solution Attempt #1
- Installed two virtual servers
- Installed 4 HTTP Listeners (all for 0.0.0.0, ports 80 or 81. Two for each virtual server)
- Restarted Server
Result: Ooops. Shouldn't do that (port contention)

Solution Attempt #2
- Installed two virtual servers
- Configured servers to use http-listener-1 and http-listener-2
Result: connection refused

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rbair
Offline
Joined: 2003-07-08

Solution Attempt #3:
- created 1 virtual server
- set listeners to http-listener-1 and http-listener-2
- set docroot to a docroot beside the normal docroot
- I had previously set it within the docroot like this
/usr/glassfish/domains/domain1/docroot/aaa.com
- now it is like this
/usr/glassfish/domains/domain1/aaa-docroot
- restart server

And this worked. I'm not sure if it was restarting the server, or moving the docroot, or something else. Also, Since this appears to be working, the documentation might need clarification.

Richard

rbair
Offline
Joined: 2003-07-08

I just configured another virtual server, and it appears that bouncing the domain was required before the new virtual server (and it's associated docroot) took effect. The web based tool did not have the "restart required" message, perhaps it should?

Richard

jfarcand
Offline
Joined: 2003-06-10

Hi Richard,

seems to me a bug that you are facing. Which version are you using exactly (8.1 pe or ee, or Glassfish)?

Thanks

rbair
Offline
Joined: 2003-07-08

I'm using glassfish, build 15 I believe