sudo netstat -lntp
, you will see that there is a process listening on port 4848 which is your GlassFish app server but it is NOT listening to port 80 and 443! Why!!?
If you take a look at the app server's log file right after starting it, you will see the
Connection refuse
exception. Assuming that you've already correctly set up GlassFish's http-listeners
to listen to port 80 and 443, the solution is actually pretty simple: you have to start the server using the root privilege (i.e. sudo ./<GLASSFISH-FOLDER>/bin/asadmin start-domain
). These 2 special ports seem to be protected by Linux OS. You cannot listen to these 2 ports without having access to root privilege.
I hope this helps! :)..