Glassfish Administration

Start server (in debug mode):

amg@ubuntu-amg:$ /opt/glassfish3/glassfish/bin/asadmin start-domain
Waiting for domain1 to start ............................
Successfully started the domain : domain1
domain  Location: /opt/glassfish3/glassfish/domains/domain1
Log File: /opt/glassfish3/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Debugging is enabled.  The debugging port is: 9009
Command start-domain executed successfully.

Stop server:

amg@ubuntu-amg:$ /opt/glassfish3/glassfish/bin/asadmin stop-domain
Waiting for the domain to stop ...
Command stop-domain executed successfully.

Change server ports:

You need to edit /opt/glassfish3/glassfish/domains/domain1/config/domain.xml or use the GlassFish admin web console.

Set access to administration console from external hosts ("enable secure admin" or "remote access"):


If you want to enable secure admin you have to set admin password first

amg@ubuntu-amg:$ /opt/glassfish3/glassfish/bin/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.

Fix "There are no domains" error on startup:

1. Execute:

amg@ubuntu-amg:$ /opt/glassfish3/glassfish/bin/asadmin list-domains
domain1 running
Command list-domains executed successfully.

amg@ubuntu-amg:$ ll /opt/glassfish3/glassfish/domains
total 12
drwxr-xr-x  3 amg amg 4096 févr. 14 04:01 ./
drwxr-xr-x 10 amg amg 4096 févr. 14 03:39 ../
drwxr-xr-x 11 amg amg 4096 mai   16 20:44 domain1/

There should be one domain with full access for the user you are running

2. If it still fails to start, try this:

HTTP/HTTPS proxy settings

In order to configure GlassFish server behind a proxy, the following JVM parameters have to be added to the server config:


  • -Dhttp.proxyHost=...
  • -Dhttp.proxyPort=...
  • -Dhttp.nonProxyHosts=localhost||toolcloud|iam.toolcloud.bull|...


  • -Dhttps.proxyHost=...
  • -Dhttps.proxyPort=...
  • -Dhttps.nonProxyHosts=localhost||toolcloud|iam.toolcloud.bull|...

Server information in HTTP response

The security issue may be to hide the information about application server provided by default in HTTP response headers: X-Powered-By and Server.

To disable sending Server header one have to add the following to JVM options: "".

To disable X-Powered-By header one have to disable the following option in GlassFish admin console:

         glassfish -> server-config -> Network Config -> Network Listeners -> http-listener-1 > HTTP -> uncheck " XPowered By: "

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 5.4.6 - Documentation - Legal Notice

Site maintained by