In this tutorial I will show you how to enable secure admin of Glassfish or Payara, so you can access it remotely.
When you deploy Glassfish or Payara on a remote domain (not localhost) and you want to access the Glassfish Admin remotely you need to enable it first. The Glassfish Admin is running by default on port 4848.
If you see this message
Configuration Error Secure Admin must be enabled to access the DAS remotely.
than follow this steps.
Set Admin Password
Before being able to enable DAS (Domain Administration Server), You might be prompted with a message saying your admin password is empty and cannot enable security. If you haven’t set and admin password yet, solve the problem by changing (or initially setting) the password of admin this way:
asadmin --host localhost --port 4848 change-admin-password
You will be asked to enter the user and the password:
Enter admin user name [default: admin]> press Enter key if you want to stay with admin
or type another one
Enter the admin password> if you haven’t set an admin password yet just hit Enter key
Enter the new admin password> type in your new password
Enable Secure Admin
On a running server enter following command:
asadmin --host localhost --port 4848 enable-secure-admin
You will be prompted to type in admin user name and password
You will need to restart all running server for the change to take effect.