Apache httpd Java Application?

8,334

Solution 1

Apache HTTPD is not a Java application server. If you want to run a Java application, you need Tomcat, or another application server like JBoss or GlassFish.

Another cool thing is that there's a module for Apache called "mod_jk" which allows you to create a bridge between Tomcat and HTTPD, by defining workers. You can keep your Tomcat installation running on a different port and still access it through your main web server.

Solution 2

Java applications built using a Servlet specification require a container that implements such standards. Hence, that java application must be deployed in a web container like Apache Tomcat.

Apache HTTP merely serves files, which your browser can't parse as, for example, the jsp(jspx) files are to be compiled before being served, delivering an HTML document to the client.

Solution 3

Your JSPs need a servlet container to process, like Tomcat, Jetty, Glassfish etc... Once you have that up and running, you can just reverse proxy to it with httpd.

Share:
8,334
YANN
Author by

YANN

Updated on September 18, 2022

Comments

  • YANN
    YANN almost 2 years

    I have an Apache httpd server (not Tomcat) installation with various applications running on it. One application that I just "installed" is a Java application. The application was installed into the 'htdocs' folder, and contains a file -> "index.jspx", which I'm assuming would be the start page, if it loaded.

    All I get is a 404 error, and what I'm guessing is that something else needs to be done to have a Java application run on Apache Server.

    Is there anything I need to enable in httpd.conf, or do I need Tomcat?

    • leonbloy
      leonbloy almost 12 years
      why the downvotes and the closing votes? this is a novice question, but it's quite legitimate IMO , and might be useful to other programmers.
    • Admin
      Admin almost 12 years
      @leonbloy thank you, I agree. As someone who doesn't work with Apache products or servers much, it's not something I'd know off the top of my head.
    • romedius
      romedius almost 12 years
      As servlet containers there are also other alternatives like Jetty and Resin. indicthreads.com/1712/…
    • SoumitaP
      SoumitaP almost 12 years
      @leonbloy, The question is a server configuration question, not a programming question. It belongs on Server Fault.
  • Admin
    Admin almost 12 years
    Thank you for clarifying, and thanks for the very handy tip, I will look into this.