Skip to main content

Installing GlassFish on a Managed Private Server

5 replies [Last post]
writex
Offline
Joined: 2007-07-04

Can anyone help me get started on how to install and configure GlassFish V2 on a MPS (managed private server)? I'm doing rehat linux hosting with Verio and have several domains on my dedicated box.

Where should GlassFish be installed?

Should there be one installation per domain?

What files have to be configured to get it to work for each domain?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
whartung
Offline
Joined: 2003-06-13

> Do you have a link for Glassfish virtual hosting
> services?

Look in the Administration Guide regarding HTTP Services.

> Also, who is right--you or the previous reply which
> said to install GlassFish for every domain?

Well, I'm right, of course! :-) I'm always right! Ask anybody...

> I'm confused about how to get GlassFish working for
> each domain. My domains are already set up on a
> managed private server. Installing GlassFish in one
> domain's folder seems logical, desired and
> easier--but how would do what you proposed, access
> applications from existing domains, and get them to
> run GlassFish deployed applications by hitting
> domain-specific URLs? Do I have to modify apache
> files?

I guess I'm confused a little.

By "domain", I assume you mean "example.com" "company.com" "mysite.org", and that you have several of those set up on your current server, correct? That is, you have DNS pointing those domain names to your servers IP address(es), yes?

Glassfish uses the word domain differently. In Glassfish, a domain is an instance of a running server.

So.

Assuming that we're using your definition of domain, as in the DNS name of a host, then this is straightforward.

Each of your domains is pointing to a specific IP address. Some, perhaps all, are pointing to the SAME IP address.

Glassfish has two artifacts that it uses internally to manage domain and hosts: HTTP Listeners and Virtual Hosts.

You bind HTTP listeners to IP addresses and ports, and Virtual Hosts to HTTP Listeners. You can have several Virtual Hosts using the same HTTP Listener.

If you have several domains sharing an IP address, you will create a single HTTP Listener (typically simply leveraging the default one), and several Virtual Hosts.

If you have several domains each with distinct IP addresses, you would have several HTTP Listeners each with a single Virtual Host.

Using a combination of Listeners and Hosts, a single instance of GF can manage several different domains.

Where you will run in to potential problems is if you have several domains hosting similar or identical applications, yet distinct, within Glassfish. The issue is because while Listeners and Virtual hosts break up the namespace for HTTP requests coming in to the server, they do NOT have a similar effect on EJB applications deployed against those hosts. Simply put, the EJB JNDI tree in the server is global and shared across everything deployed within it, regardless of what virtual host that server is connected to (if any -- for example you can deploy an EAR containing nothing but remote Session Beans, and this has no relationship whatsoever to HTTP listeners as, in fact, it's not servicing HTTP requests).

So, that's where deploying several instances of the same application in to the same server can be problematic. A lot of this can be overcome, but it's take a bunch of tweaking of deployment descriptors. But, sometimes, code is written incorrectly and non-portably and can run afoul of this issue.

Finally, if you are not using Apache for anything besides a front door to GF, you can most likely simply eliminate it completely.

For example, say you have Apache running your applications, but it also has some web console on port 10000. If your applications are pure Glassfish (vs a mix of PHP, CGI, and GF), you can tell Apache to stop listening to port 80 but continue hosting port 10000 (your web console), then GF can handle port 80 and all of that traffic.

Really depends on the application mix.

whartung
Offline
Joined: 2003-06-13

It should just install with no issues.

If you have several domains pointing to the same server, I would use the Glassfish virtual hosting services to host them all in a single instance of the server. You'll save a lot of memory overhead doing that.

I would install glassfish, any place handy will do. /usr/local/glassfish, say.

By default you get the default domain, domain1: /usr/local/glassfish/domains/domain1

I would use that to test and make sure everything is working ok. But when I was done, I'd create a new domain someplace else, /usr/local/domains/yourdomain for example.

Use the asadmin --create-domain command to create your new domain, and don't forget the --domain-dir argument.

The reason you want to do this is that if you need to upgrade glassfish (say to the latest release for a bug or security fix), it's trivial to simply backup and reinstall the glassfish install without affecting your domain. You domain stays independent and safe, no copying files around, etc. The domain is pretty much stand alone and ignorant of the glassfish installation, and, in general, if you stay within the same version (i.e. GFv2), you won't need to change anything in your domain to work with the new version.

writex
Offline
Joined: 2007-07-04

Do you have a link for Glassfish virtual hosting services?

Also, who is right--you or the previous reply which said to install GlassFish for every domain?

I'm confused about how to get GlassFish working for each domain. My domains are already set up on a managed private server. Installing GlassFish in one domain's folder seems logical, desired and easier--but how would do what you proposed, access applications from existing domains, and get them to run GlassFish deployed applications by hitting domain-specific URLs? Do I have to modify apache files?

Gabe Wong

glassfish@javadesktop.org wrote:
> Do you have a link for Glassfish virtual hosting services?
>
> Also, who is right--you or the previous reply which said to install GlassFish for every domain?
>
> I'm confused about how to get GlassFish working for each domain. My domains are already set up on a managed private server. Installing GlassFish in one domain's folder seems logical, desired and easier--but how would do what you proposed, access applications from existing domains, and get them to run GlassFish deployed applications by hitting domain-specific URLs? Do I have to modify apache files?
> [Message sent by forum member 'writex' (writex)]
>

They are both valid responses depending on what it is you want to
achieve. If indeed it will be the same system user that will be
accessing and managing
Glassfish then the most recent post with the 1 installation solution
would work. However my understanding from your original post is that
it seem you wanted to provide the hosting for the different domains for
different users. In that case you may want to consider my original response.
Also if your private server is a VPS then you need to take into
consideration your available RAM memory

--
Regards

Gabe Wong
NGASI AppServer Manager
Application server installation and configuration AUTOMATION
http://www.ngasi.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Gabe Wong

glassfish@javadesktop.org wrote:
> Can anyone help me get started on how to install and configure GlassFish V2 on a MPS (managed private server)? I'm doing rehat linux hosting with Verio and have several domains on my dedicated box.
>
> Where should GlassFish be installed?
>
> Should there be one installation per domain?
>
Managed Private Server - is that another name for a VPS? If so, given
that GF requires at least 128MB, you would for all practical
purposes need 512MB available to the system.

If you are installing GF for multiple users, then it is best each have
their own installation.
I would assume installing under each user home directory would be a good
idea.
Installing multiple GF would also require playing around with ports to
avoid port conflicts.

--
Regards

Gabe Wong
NGASI AppServer Manager
Application server installation and configuration AUTOMATION
http://www.ngasi.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net