KonaKart Community Forum

Installation / Configuration => Installation of KonaKart => Topic started by: xtian on December 05, 2013, 01:29:34 pm

Title: Removing the context path
Post by: xtian on December 05, 2013, 01:29:34 pm
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.
Title: Re: Removing the context path
Post by: xtian on December 05, 2013, 01:51:07 pm
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!
Title: Re: Removing the context path
Post by: trevor on December 05, 2013, 04:45:49 pm
How do you know that all users of those base addresses have access to the HttpServletRequest?
Title: Re: Removing the context path
Post by: xtian on December 06, 2013, 03:19:15 pm
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.

Title: Re: Removing the context path
Post by: trevor on December 06, 2013, 03:25:20 pm
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...
Title: Re: Removing the context path
Post by: xtian on December 10, 2013, 02:37:18 pm
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.