Page 1 of 1

Tomcat Standalone

Posted: Tue Mar 05, 2013 11:23 am
by mota_nginya
Guys,

I need help really bad. Here is the issue I am facing http://forum.broadleafcommerce.org/viewtopic.php?f=15&t=1710&sid=db6c08f66ec8574fa17c1fdaf3877b63%20. What I do not understand is whether I need to do some additional configuration in tomcat to get the work correctly on standalone tomcat. It works perfectly when I use it in eclipse but I had to add addition configuration in the tomcat7-maven-plugin like this

Code: Select all

<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<warSourceDirectory>${webappDirectory}</warSourceDirectory>
<path>/</path>
<port>${httpPort}</port>
<httpsPort>${httpsPort}</httpsPort>
<keystoreFile>${webappDirectory}/WEB-INF/blc-example.keystore</keystoreFile>
<keystorePass>broadleaf</keystorePass>
<password>broadleaf</password>
</configuration>
</plugin>


This works well for all the three modules but when I deploy my code onto a tomcat server I cannot get the home page on any of the modules to work. say I use http://localhost:8080 I get a page not found but if I do http://localhost:8080/merchandise I get what want. This is the case for admin and combined modules even if deploy it as ROOT.war onto my standalone tomcat server. Do I need to add some additional configuration on the tomcat server for it work?

Thanks,
Blessed

Re: Tomcat Standalone

Posted: Tue Mar 05, 2013 3:56 pm
by phillipuniverse
Have you made changes to your server.xml or context.xml file in tomcat? Can you set a breakpoint in BroadleafRequestFilter and see if that actually gets hit when you go to localhost:8080?

Re: Tomcat Standalone

Posted: Tue Mar 05, 2013 6:08 pm
by mota_nginya
Thanks for the response, no I have not. What kind of change should I do there?

Re: Tomcat Standalone

Posted: Tue Mar 05, 2013 6:28 pm
by phillipuniverse
None that I know of. I was just asking to try to help debug.

Here's a question: what if you go to localhost:8080/? Meaning, add the trailing slash onto the end. What happens in that case?

Re: Tomcat Standalone

Posted: Tue Mar 05, 2013 7:42 pm
by mota_nginya
Using localhost:8080/ did not work. Instead the browser removes the "/" and use localhost:8080. You may not believe this but I think I have just learned a big lesson or trick here. So what I have always done was to installing tomcat and delete all those apps deployed by default. Apparently that caused some problems. It seems as if when that is deleted, all of the configurations are not removed appropriately. Now what I did was to install a new tomcat server, instead of deleting those apps, I undeployed them and then install my app as root and bingo, it worked like a charm. What a lessons learned! Hopefully this will help someone in the future.

However, all https pages are routed to https:localhost:8443/page will that be a problem if apache is used to handle https.
Thanks all the same for your continuous assistance, and hope you can use this to help someone else in the nearest future.



Thanks again,
Mota_nginya.

Re: Tomcat Standalone

Posted: Tue Mar 05, 2013 11:29 pm
by phillipuniverse
Hm; that's pretty strange. VERY glad that you reported back though! I'm sure that this will help others that run into an issue like yours :D

The https port configuration is done via applicationContext-security.xml. When you go to production (or if you just want to use the normal 80 and 443 for http and https) you will need to modify the applicationContext-security.xml file at a minimum, and definitely ensure that your certificates are installed correctly in Tomcat.

Your question specifically was about Apache though (which I assume you mean httpd). I believe that as long as you have your ports configured right in Apache and applicationContext-security.xml then you should be fine.

Re: Tomcat Standalone

Posted: Wed Apr 24, 2013 5:09 pm
by iivaan
If I wat to test the demo site with 8080 and 8443 and want to deploy the war file to production server where we need to use port 80 ad 443, what I have to change.

Can any one help?