• Welcome to KonaKart Community Forum. Please login or sign up.
 

Removing the context path

Started by xtian, December 05, 2013, 01:29:34 pm

Previous topic - Next topic

xtian

I need to remove the context path from the url, so that I could access the site with "http://shop.mysite.net" without a trailing "/konakart" .
What is the best approach?
I'm going to define a tomcat virtual host, and I'm going to place the "konakart" and the "konakartadmin" apps in two different virtual hosts with different appBase:


<Host name="shop.mysite.net"  appBase="konakartapp" />
<Host name="shopadmin.mysite.net"  appBase="konakartadminapp" />


This implies moving and renaming the webapps.
Is this going to break anything now or in the future?

Thank you.

xtian

Oh gosh, you have the webapp context configured in the admin app instead of just getting it from HttpServletRequest  :o
See "Store-Front base", "Store-Front image base", ... and who knows if anywhere else!

trevor

How do you know that all users of those base addresses have access to the HttpServletRequest?

xtian

How do you know that all users of those base addresses have access to the HttpServletRequest?
It's unfair to discuss architecture and implementation without giving access to any of them... but I know it's my fault, I started it ;)
I was just upset to find out that deploying to a "real" environment had to be harder than expected.
Back to the topic, in case anyone wonders: it works so far.
I have configured two virtual hosts, moved the apps to the respective ROOT, tweaked some configuration files which had the original path in it, changed the configuration via console, and all is fine.
Yet I think that deployment is an aspect of the system that could enjoy some optimization.


trevor

QuoteYet I think that deployment is an aspect of the system that could enjoy some optimization.


We're always open to suggestions so please fire away...

xtian

The first thing that comes to mind is that all configurable paths, both in the database and property files, should be relative to a common "base path". This way I could deploy the application on different paths in different environments (development, test, etc.), and configure just one property if I don't have any particular need of, say, moving the "templates" folder for instance.

Another idea more on the post subject: having the context path in the url should be considered as "uncommon". What I mean is that nobody serious about his business would ever want a "konakart" context appearing in his shop urls, so the distribution should come out-of-the-box with that in mind. The shop application should be deployed in the "ROOT" folder of the tomcat webapp directory. This way, I won't have to move the app when deploying to production and I'd have less configuration tweaks to do.