- If you have a hosting with a
dedicated java application server
- (JAVA-* account), you have the possibility to install GlassFish. This article explains how to access the admin console of your GlassFish server.
Step 1: Identify the access port
- Your application server is running on a hardware server running several application servers. To avoid port conflicts, each application server runs on a dedicated port that is not the standard port (8080).
- To identify your server's administration port, open the following file (via FTP or the control panel's file manager):
- ./appservers/private/saase.properties
- This file was created in your account when you installed Glassfish.
- This file contains the definition of several variables. The one you are interested in is the following:
appsrvr.admin_port=4990
According to the example above, the administration console of your server uses port 4990.
2nd step: Securing access
- By default, and to avoid malicious connections using the default password, the administration port is blocked by our firewall.
- You have the choice between accessing this port via an SSH tunnel (more secure variant) or directly. For direct access, you must first secure the access to the administration console:
- Connect via SSH to your account (the user and password are the same as those that allow you to access the control panel):
- On Mac or Linux, open a terminal and type the command: ssh utilisateur@nomdedomaine.ch
- On Windows, use a program such as Putty.exe to connect
- Once connected, run the following commands to enable https access on the console (replacing the port number with the one you found in step 1):
cd appservers/glassfish-4x/
./bin/asadmin --port 4990 enable-secure-admin - The asadmin command asks for the admin user and password. By default, this is admin / adminadmin. Once the command is executed, you should see the message "Command enable-secure-admin executed successfully."
- Then run the following command to change the default password:
./bin/asadmin --port 4990 change-admin-password - The password change is confirmed by the message: "Command change-admin-password executed successfully".
- Finally, to take the changes into account, restart the application server with the following command:
./bin/asadmin --port 4990 restart-domain domain1
Step 3: Access to the interface
- To access the GlassFish administration interface, you have two options:
- Through an SSH tunnel
The port on which your application server is running is closed on our firewall, which guarantees maximum security. To access your admin console, run the following command (or the equivalent in Putty) to create an SSH tunnel to this port:
ssh -L 8080:localhost:4990 utilisateur@votredomaine.com
You must run this command from your local computer, which is the machine you will use to connect to your GlassFish server.
Using Putty, the configuration should look like this:
Once connected, you will be able to access the administration console from your browser at the following address:
https://localhost:8080/- Live
After performing the operations in step 2, you can also ask us to open the port in our firewall by writing totechnical support. In this case, once the port is opened, your administration console will be available at the following address:
https://votredomaine.com:4990/