I've an application which is deployed/running in Websphere Application Server at Machine 1 (iSeries server). Database running at Machine 2 (AIX Server). Using IBM HTTP Server as a reverse proxy server which is at Machine 3 (Windows Server).
Below is the structure of my EAR file.
Machine 1
+ HelloWorldEAR + META-INF + HelloWorldWAR // Struts/JSP + WEB-INF + HelloWorldEJB.jar
Is this application comply with 3 tier architecture, though my whole application (EAR) sits in one machine?
or Deploy WAR file in Web Server in one machine and Deploy EJB in App Server in other machine? What is the role of Web and App Servers in j2ee architecture? Is it a good practice to always deploy presentation logic (servlets/jsp) and business logic (ejb) in two different machines? Is there any standard way to design the j2ee application so that each layer can be deployed in each tier?
Is this application comply with 3 tier architecture, though my whole application (EAR) sits in one machine?
Probably yes, as it has presentation layer (via JSP/Struts), business logic layer (via EJB) and data (maybe not yet, as probably your hello app doesn't store any data right now).
What is the role of Web and App Servers in j2ee architecture?
Web server usually acts as security proxy (is placed in the DMZ zone) and forwards requests to application servers. It might also act as load balancer distributing requests to many servers in cluster. If you have very rich presentation layer e.g. lots of flash. large static files, etc you could put these files to your web server as they don't need to be served from application server.
Application server from the other hand, should be placed in intranet zone, and is responsible for running your dynamic application.
Is it a good practice to always deploy presentation logic (servlets/jsp) and business logic (ejb) in two different machines?
No, it is not a good practice, since there is significant performance degradation (you loose many 'in process' optimizations and requires remote calls between layers), adds complexity to the environment and management.
Is there any standard way to design the j2ee application so that each layer can be deployed in each tier?
As I wrote earlier, it is no longer recommended, there was a moment in EJB 1.1 times, when you had only remote interfaces, when it was suggested, but not any more. If you really want to do it you will need to create business layer (usually EJB) with Facade that is exposed via some kind of remote interface (EJB, web service, rest..).