Can someone describe the process of setting up the TServer (or Tomcat server) to delegate the serving of static content to Apache?
What configuration is required in the http.conf?
Thanks,
Paul.
Can someone describe the process of setting up the TServer (or Tomcat server) to delegate the serving of static content to Apache?
What configuration is required in the http.conf?
Thanks,
Paul.
Paul,
When you define the application (in addition to providing war file(s) ) you supply a zip/tar of the static content files. Those files are then served by Apache. Requests to /myChosenContextRoot are proxied to the app server.
Chris
Thanks Chris.
What if my application is in the ROOT context? How does apache know to serve the static content?
Wouldn't I need to put some 'ignore' in the http.conf so that the static folder bypasses tomcat? If so, what would I need to add?
Regards,
Paul.
You want to use mod_jk for your apache httpd server:
http://en.wikipedia.org/wiki/Mod_jk
As I understand it, Cloud Foundry does not use mod_jk but mod_proxy/mod_proxy_ajp.
P.
Hi Paul,
While we're working on a better way to serve static content from Apache with a web application deployed to the ROOT context, here's a solution that will work in a single instance topology.
Let's say you want to serve images and stylesheets from Apache, and your static.zip has /image and /css subdirectories
Create the following script on your local machine (let's say script.sh):
Now when you are launching your application, on the "Launch Deployment" page check the RUN SCRIPT checkbox under CONTAINER INITIALIZATION SCRIPT and select your script.sh in the file input labeled SCRIPT.Code:cat > /etc/httpd/conf.d/_proxyexcludes.conf <<END ProxyPass /image ! ProxyPass /css ! END
The script will run on your instance prior to starting your app, and it will tell Apache to exclude /image and /css paths from being proxied to the app server.
Hope this helps,
Dmitriy Volk