Search code examples
apacheglassfish-3

How to hide context root


I've configured Glassfish 3.1 + Apache 2 with jk_mod. All is well when I type in http://myserver.com/myapp, it does displays the index page.

I need help to change from http://myserver.com/myapp to http://myserver.com and it should still go to myapp. Please let me know if this is even possible.?

Thanks.


Solution

  • Yes, this is possible.

    You can set a Default Web Module for the default Virtual Server named server.

    To do this, deploy your application, open the GlassFish Admin GUI, go to server-config -> Virtual Servers -> server and look for the setting Default Web Module. Select your web application and save. Now you can reach your web application on http://myserver.com. Be aware that your Apache configuration has to be in sync with the new context root.

    You can also set it up via asadmin:

    set server-config.http-service.virtual-server.server.default-web-module=<YOUR_WEBAPP>
    

    See also: