dtolabs / yana2

Yet Another Node Authority ... because you wanted an agile Real-Time Service Model (RTSM)
8 stars 1 forks source link

Yana App should be deployable as a war file in a non-root context #138

Closed sharadr closed 12 years ago

sharadr commented 12 years ago

Yana war if deployed as a war in tomcat does not work if it is deployed in non-root context.

Steps to reproduce: grails prod war

Take target/yana2-0.1.war and deploy to $CATALINA_BASE/webapps/yana.war Server starts up but on access of first service throws an exception that the resources could not be loaded. The assumption was that Config.groovy has app.context=/ which needs to be overridden in config.properties which when done causes an infinite redirect for firefox and the splash page does not render.

orubel commented 12 years ago

You have to unpack the war and build your context for the unpacked war. This is why you got that error. You are attempting to autodeploy.

sharadr commented 12 years ago

I am not attempting to autodeploy. We want to run the app as /yana so that it does not deploy in the root context as /

The end user should be able to change the context of the application ie. take the app, drop it into $CATALINA_BASE/webapps/yana.war and the app should run with the context as /yana/

The end user should not have to do any other steps.

orubel commented 12 years ago

Yes this is not a necessary change just a different way of thinking when deploying; something that we already discussed.

You will have to change alot of the paths if you do this I believe. But leaving it as is is not going to really hurt anything as it can be deployed perfectly fine within existing environments under a subdomain which is quite common for web application deployment.

PHP/Python/Ruby and many other web apps follow this exact same procedure when deploying multiple webapps in the some environment... especially if they are from different vendors.

In java however, when proxying to virtual hosts, it is common to use the appname to differentiate which is useful. It's not necessary but alot of people find it helpfuland those who don't know how to configure ajp proxying for vhosts without the appname can get confused so there is an good argument to be made for having the appname in the context.

gschueler commented 12 years ago

this is working for me. I can deploy to a non-root context for tomcat and it works.

orubel commented 12 years ago

oh good. I was afraid that I might have missed some pathing in the controllers or views that made this a bit more difficult. Excellent. Good to hear. wipes brow