Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Oct 1 '12 at 17:46

This question came from our site for professional and enthusiast programmers.

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 '12 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 '12 at 14:54
    
@leonbloy, The question is a server configuration question, not a programming question. It belongs on Server Fault. –  gpojd Oct 1 '12 at 14:58

4 Answers 4

up vote 3 down vote accepted

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.

share|improve this answer
    
Thank you for clarifying, and thanks for the very handy tip, I will look into this. –  hacket Oct 1 '12 at 14:55

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.

share|improve this answer

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|improve this answer

As servlet containers there are also other alternatives like Jetty and Resin.

http://www.indicthreads.com/1712/apache-tomcat-server-alternatives-jetty-and-resin/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.