I have Ubuntu server 16.04 installed. I downloaded glassfish 4.1.1 and latest jdk8 and setup the environment variables and all. After that i enabled remote admin and deployed my application. Problem comes when i try to access the secure admin, which should be on port 4848, but it gives me my application, which is supposed to be on port 8080. I have checked and rechecked that i am deploying to "server" virtual host and not the __asadmin virtual host. but it seems to deploy it on both. If i copy the glassfish folder from the server to my desktop, which is Ubuntu desktop 16.04, it runs smoothly and as expected with no problems.
On the server i notice strange errors that do not appear on the desktop
[2016-06-15T15:05:17.595+0400] [glassfish 4.1] [WARNING] [] [javax.faces] [tid: _ThreadID=42 _ThreadName=admin-listener(2)] [timeMillis: 1465988717595] [levelValue: 900] [[
Multiple JSF Applications found on same ClassLoader. Unable to safely determine which FactoryManager instance to use. Defaulting to first match.]]