File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Apache: Java, PHP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache: Java, PHP" Watch "Apache: Java, PHP" New topic
Author

Apache: Java, PHP

Pinki Roy
Greenhorn

Joined: May 16, 2008
Posts: 22
How does Apache recognize whether the request is coming from Java or php application?
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1527
Pinki Roy wrote:How does Apache recognize whether the request is coming from Java or php application?

Wait, request comes from client/browser and for the Java or Php processes... correct me if I am wrong.
And is it Apache(WebServer) or Apache Tomcat you are talking about?


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Pinki Roy
Greenhorn

Joined: May 16, 2008
Posts: 22
Its Apache Web Server.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11465
    
  94

The Apache HTTP Server does not know anything about Java. However what it can do is specify that certain resources should be handled by some other process, such as a Java Web Application Server (e.g. Tomcat). As an example, you can say that anything that starts with /myApplication/... should be served by Tomcat. Everything else will be handled by the Apache HTTP Server.

For the files that are processed by the Apache HTTP Server, you normally specify that PHP files will be identified by having a ".php" extension (there are ways around that), so that the Apache HTTP Server knows to run it through the PHP processor.

There are more nuances to configuration, but that gives a high-level overview.


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1527
Apache web server itself doesn't serve to process java. Rather it delegates java processing to other servers like Tomcat. As Andrew said it does so based on the incoming requests, anything with /so-and-so should go to so and so process etc. So if the request has a .php extension in the end it has something to with PHP likewise. You manually configure these things in one of the Apache's configuration file. (I'm not sure if it is httpd.conf)
 
GeeCON Prague 2014
 
subject: Apache: Java, PHP