4

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?

4
  • 2
    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.
    – leonbloy
    Oct 1, 2012 at 14:50
  • @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.
    – hacket
    Oct 1, 2012 at 14:54
  • As servlet containers there are also other alternatives like Jetty and Resin. indicthreads.com/1712/…
    – romedius
    Oct 1, 2012 at 14:54
  • @leonbloy, The question is a server configuration question, not a programming question. It belongs on Server Fault.
    – gpojd
    Oct 1, 2012 at 14:58

3 Answers 3

4

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.

1
  • Thank you for clarifying, and thanks for the very handy tip, I will look into this.
    – hacket
    Oct 1, 2012 at 14:55
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.

2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .