k_b k_b - 25 days ago 17
Apache Configuration Question

Apache web server with tomcat

We have a java web application with gradle build configuration which contains 2 modules as below:


  1. project-web.war -- contains all statc files, js, jsp, etc. Also it contains all the project, spring configuration with rest controller layer.

  2. project-main.jar -- contains all the business & DAO layer logic.



Currently we are deploying both of these modules in Apache tomcat. Our project is going through with some architectural changes & one of the requirement is to add all the static content in Apache server so that static content can be served quickly.

I am beginner in regard to Apache http web server. I have below questions:


  1. If I put all the static contents in Apache http server, then can I remove all the static contents from project-web? Can both of these project exist separately?

  2. Going forward static content of project will be in Apache http web server and web app will be deployed in Apache tomcat, in addition both of these server will be in different VM machine. How web app in tomcat can access static content from Apache web server in different VM machine?(E.g. how jsp can point to images?)

  3. Would it be fine idea to create a separate project for just static content as it will independent of web project in future and just need to be deployed in Apache http server?



Answers for above questions will be appreciable & other related suggestions are also welcome. Thanks!

EJP EJP
Answer

1) If I put all the static contents in Apache http server, then can I remove all the static contents from project-web?

Yes.

Can both of these project exist separately?

They can, but the stuff in the webapp will (should) never be accessed so what would be the point?

2) Going forward static content of project will be in Apache http web server and web app will be deployed in Apache tomcat, in addition both of these server will be in different VM machine. How web app in tomcat can access static content from Apache web server in different VM machine?(E.g. how jsp can point to images?)

The webapp doesn't need to access the images. The browser needs to access the images. The Apache HTTPD configuration can be set up to take care of that transparently without requiring any JSP changes.

3) Would it be fine idea to create a separate project for just static content as it will independent of web project in future and just need to be deployed in Apache http server?

Yes.

Comments