How to get html/css/jpg pages server by both apache & tomcat with mod_jk
- by user53864
I've apache2 and tomcat6 both running on port 80 with mod_jk setup on ubutnu servers. I had to setup an error document 503 ErrorDocument 503 /maintenance.html in the apache configuration and somehow I managed to get it work and the error page is server by apache when tomcat is stopped. Developers created a good looking error page(an html page which calls css and jpg) and I'm asked to get this page served by apache when tomcat is down. When I tried with JkUnMount /*.css in the virtual hosting, the actual tomcat jsp pages didn't work properly(lost the format) as the tomcat applications uses jsp, css, js, jpg and so on. I'm trying if it is possible to get .css and .jpg served by both apache and tomcat so that when the tomcat is down I'll get css and jpg serverd by apache and the proper error document is served. Anyone has any technique?
Here is my apache2 configuration:
vim /etc/apache2/apache2.conf
Alias / /var/www/
ErrorDocument 503 /maintenance.html
ErrorDocument 404 /maintenance.html
JkMount / myworker
JkMount /* myworker
JkMount /*.jsp myworker
JkUnMount /*.html myworker
<VirtualHost *:80>
ServerName station1.mydomain.com
DocumentRoot /usr/share/tomcat/webapps/myapps1
JkMount /* myworker
JkUnMount /*.html myworker
</VirtualHost>
<VirtualHost *:80>
ServerName station2.mydomain.com
DocumentRoot /usr/share/tomcat/webapps/myapps2
JkMount /* myworker
JkMount /*.html myworker
</VirtualHost>