4

I have a Glassfish 4 server running on a headless Debian VM. I can access the application just fine, but I cannot seem to access the admin port from anything other than localhost. I'd like to be able to access it so I can remotely deploy/debug from an IDE on another machine.

I've tried the asamin enable-secure-admin command, which completes but after restarting there is no change.

I've checked with netstat and Glassfish is only listening on port 4848 from localhost. Is there any other place remote admin is controlled from? Or something I'm missing?

NonlinearFruit
  • 2,509
  • 1
  • 25
  • 27
Austin
  • 680
  • 1
  • 9
  • 23
  • 1
    Maybe start by running `asadmin> list *` and seeing if you can figure out which property you need to set. See if you can correlate that with a property you find by running `grep localhost ...` on the Glassfish config file(s) (which I no longer remember the location of, sorry.) – Andrew Henle Apr 27 '15 at 18:41
  • Thanks for pointing out the list command, that helped me figure out what property to set. – Austin Apr 27 '15 at 21:07

2 Answers2

6

You need the following to administer Glassfish remotely:

  • set a non-blank password for all admin logins
  • enable secure admin
  • ensure the network listener is listening on the correct IP addresses (it could be set to listen only on the loopback interface)
dsh
  • 12,037
  • 3
  • 33
  • 51
1

For me it works as follows:

*log into the glassfish admin console locally

*set admin-listener port to 14848 (I don`t know what is wrong with 4848, my JVM permanently uses it thus the admin console port changes automatically)

*set admin-listener IP to my-host-IP (different from the default 0.0.0.0 and from 127.0.0.1)

*add a new FireWall (I`ve ordered VPS on Windows) rule for outcoming TCP access to 14848 port

*run default glassfish domain

asadmin start-domain

*enable secure admin

asadmin --host my-host-IP --port 14848 enable-secure-admin

*restart the domain (and don`t forget to kill Java possibly loitering in memory)

a.parfenov
  • 528
  • 6
  • 16