GlassFish 3.1.2 – enable Secure Admin for the Domain Administration Server

Environment: GlassFish Server 3.1.2 Open Source Edition (Web Profile), Oracle Linux 6.2.

I have some experience with GlassFish 3.1.1, but since I was doing a new installation, I wanted to try out the newer version 3.1.2.

During the installation, I did a Custom Install and I created a new server domain. Everything went smoothly and I didn’t notice any changes from version 3.1.1.

However, when I tried to remotely connect with my local web browser to the DAS (Domain Administration Server) on port 4848, I received the following error message:

Apparently, remote access to the DAS has been disabled by default, and this wasn’t the case in version 3.1.1.

There are 2 ways to enable Secure Admin to the DAS: by using the web interface from the local host, or by using the command-line asadmin utility. In both cases, you first need to set a password for the “admin” account, if you haven’t done so.

1) Using the web interface

First, you need to access the Administration Console from a web browser running locally on the server. The address of the Administration Console is by default http://localhost:4848/. Use the “admin” user name and password.

Next, click on “server (Admin Server)” in the left menu, and “Secure Administration” in the right window. Click “Enable Secure Admin” to enable the secure remote administration of the DAS. Note: this will restart the application server domain!

After this, you should be able to access the DAS administration console remotely, but now it’s using SSL (https) instead of http.

2) Using the asadmin utility

The asadmin utility can be found in the “bin” folder where you installed the GlassFish software. In my case, this was /u01/app/glassfish3/bin. To enable Secure Admin, you first need to run the “asadmin” utility and then enter “enable-secure-admin” as command. After this, you need to restart your DAS. To verify if Secure Admin is enabled or not, you can run the command “get secure-admin.enabled”.

asadmin> get secure-admin.enabled
Command get executed successfully.

asadmin> enable-secure-admin
You must restart all running servers for the change in secure admin to take effect.
Command enable-secure-admin executed successfully.

asadmin> stop-domain
Waiting for the domain to stop ….
Command stop-domain executed successfully.

asadmin> start-domain
Waiting for domain1 to start ……
Successfully started the domain : domain1
domain Location: /u01/app/glassfish3/glassfish/domains/domain1
Log File: /u01/app/glassfish3/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

asadmin> get secure-admin.enabled
Command get executed successfully.



4 Responses to GlassFish 3.1.2 – enable Secure Admin for the Domain Administration Server

  1. addy_071 says:

    Thank you Matthias.

  2. Thank you! This was very helpful.

  3. buddhika says:

    tnx its working fine

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: