Serving Vaadin static files through Apache

We’ve got Tomcat 6 running under Apache. Our app is wonderful and Vaadin has been a delight, and now we’re working on pre-deployment performance issues. It’s obvious, and is mentioned in documentation, that static files (i.e., the whole WebContent/VAADIN directory) should be served through the web-server and not the servlet container. How do you do that?

  1. Put the VAADIN directory somewhere.
  2. Put a “resources” init-param into the web.xml/servlet element pointing at that somewhere? That seems to begin to work, but we run into permissions errors (see below).
  3. If not 2, do you need to do some url mapping in the Apache config?

I’ve gotten the feeling that the answer is very simple since so many posts almost casually mention the issue without giving detailed directions. Can some one shed some light on this?
Thanks

Error seen with Firebug with method #2 preventing the app from launching is attached as an image.
11690.png

It turns out the solution to this is:

  1. Assuming you are using Apache JK Connectors and in your httpd.conf file you are doing something like

JkMount /MyApp worker1

  1. Move the contents of the static vaadin directory to the apache directory, eg

/var/www/html/MyApp/VAADIN…

  1. Unmount the Vaadin directory from the JkMount in your httpd.conf file

JkUnmount /MyApp/VAADIN

This stops the Apache connectors from sending requests for stuff in the VAADIN directory to the Tomcat workers, and instead directs it to get it from the statically served directory.

This dramatically improves Apache and Tomcat performance.

I just have to add the usual reminder for readers to avoid strange future problems: when you upgrade the Vaadin version in your project, make sure you remember to update the static (extracted) VAADIN directory.

I have a app that fine work in netbeans IDE local, but upload production server it no work.
Apache only say “GET / HTTP/1.1” 400 179 “-”
Tomcat say anything.
Server: squeeze
apache2: 2.2.16
Tomcat: 6
java: 1.6.0_18
vaadin: 6.7.1
Is to deploy my first application and my head hurts because I’ve searched the web and can not find the solution. And is that the system does not tell me anything.
The application is deployed perfectly.
Thank you very much for the help, because I really need it.