Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change default start page of Glassfish?

Currently when I type in the URL of my webapp, say "http://abc.edu/mywebapp/", I am taken to the login page of my webapp. When I type "http://abc.edu/", I am taken to the GlassFish info page. How can I do it such that when I key in "http://abc.edu/", I will be taken to my login page and not the GlassFish info page?

like image 491
ohseekay Avatar asked Jun 09 '11 02:06

ohseekay


2 Answers

Option 1: You can set one of your webapps as default. This can be done with the admin console:

Configuration --> Virtual Servers --> server

Then select your default web application from the drop-down menu. If your webserver port is 8080, you can start your application now by:

http://hostname:8080

instead of http://hostname:8080/webapp

Notice that "server" is the name of Glassfish's default virtual server. If you configured a different virtual server for your webapp you need to change it accordingly.

Furthermore regarding this source, there might be some problems with JDBCRealms.

Option 2: You could also deploy your default webapp to "/" instead of "/webapp" but I think the first option is more flexible.

like image 73
Matt Handy Avatar answered Nov 03 '22 12:11

Matt Handy


You need to change your context root to "/" Edit the application.xml that is where the context root for the app is set. You might have to undeploy the default context root inorder to do that (that is what I do in JBoss, I undeploy ROOT.war).

like image 23
Mohamed Mansour Avatar answered Nov 03 '22 12:11

Mohamed Mansour