Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i feel kinda stupid for this cause i figured it would be easy, but im stuck. it all started when trying to run some jsp pages off a rh9 server that uses apache. the jsp pages loaded and displayed the static content, but did not execute the simple java code i had. no biggy i figured, i just need to put java on there. so i downloaded and installed a JRE rpm, but that didnt do anything. i dont know how to activate it. im using a website that i know of that requires java to work. so as a test i go to this site and it keeps telling me that my java isnt activated, and my jsp still isnt working, so what do i need to do to get java to work right?
If this isn't the most asked question on this site, I don't know what is.
You need to make a link between your browswers plugin directory and the appropriate java plugin. You probably also need to put the java/bin directory in your path and maybe even set your JAVA_HOME environement variable.
Use the search button and you will find literally hundreds of posts explaining everything in great detail
what browser and browser version are you using? asking the version, since choosing the correct java plugin depends on which version of mozilla you're using, if you're using mozilla. but the gist of it is to create a symbolic link inside your browser's plugins directory to the java plugin provided in the jre.
in mozilla 1.4 and higher, you'll need to link to the plugin in the ns610-gcc32 directory in your java install. for mozilla versions less than 1.4, link to the plugin in the ns610 directory in your java install.
opera, should be able to automatically know that java is installed. if not, there's an option to tell opera a java install directory. usually the path is:
/usr/java/j2sdk1.4.2_02/jre/lib/i386/
you'll have to change the bold to the version of java you're using (the version is used as a directory when java is installed). also the above may be different as i'm using the sdk but it shouldn't be much different.
you'll probably also want to set the path to java. some programs look for the JAVA_HOME variable. i like to use pathmunge in the /etc/profile. it'll look something like this:
Quote:
JAVA_HOME=/usr/java/j2sdk1.4.2_02
pathmunge $JAVA_HOME/bin after
export JAVA_HOME
i usually put it right after the if/fi path manipulation statement, but i'm not sure how your distro has this set up or how different you're /etc/profile file is compared to mine. you'll also need to put in the correct path of your java install. mine's just an example. also you may need to restart your login session or a reboot maybe required if that doesn't get java in your path. java will be in your path if you use the command "java -version" and you get the java version for the output.
Your question is quite confusing. I will attempt to address the two issues I found.
JSP
Java Server Pages are a server side technology, which allows you to incorporate Java code, tags, EL, into standard HTML pages. JSP's are interpreted by a servlet container and compiled into Java classes which return HTML to clients accessing them via the servlet container. If you wish to write JSP pages an learn some Java you will need a container such as tomcat. http://jakarta.apache.org/tomcat/index.html
Apache is a regular http webserver that is not able to process jsp pages. (Note there are some apache modules that allow for this)
Java Applets
If you are looking to view web pages that require the Java plug-in take the advise of the above post!
Note applets are not jsp .. jsp is server site and require a servlet container, applets are run on the client and require the Java plug-in.
ok my confusion was with tomcat then. didnt know i needed it. im still stuck in the windows state of mind, where IIS can run ASP without additional plugins. Tomcat doesnt look too easy to configure, but i guess thats the charm of linux
If you wish to write JSP pages an learn some Java you will need a container such as tomcat. --mhiggins
Quote:
Apache is a regular http webserver that is not able to process jsp pages. (Note there are some apache modules that allow for this) --mhiggins
Going along with what is talked about here, what is the advantage of having a whole new server, Tomcat, installed along side Apache versus installing a module for apache that understands JSP? I would think that the less installed and the less running would cause less to troubleshoot and maintain.
I have a web server running Apache and I would like to use JSP to simplify my life.
Originally posted by tumana Going along with what is talked about here, what is the advantage of having a whole new server, Tomcat, installed along side Apache versus installing a module for apache that understands JSP? I would think that the less installed and the less running would cause less to troubleshoot and maintain.
I have a web server running Apache and I would like to use JSP to simplify my life.
Thanks in advance,
ian
Based on what I understand you will need to install Tomcat in order to run jsp and serverlets on Apache. Apache is really just the web server only. The module
mod_jk is required to be installed as a conector in order for Apache to talk to Tomcat server.
Tomcat is a full HTTP server, Apache is not needed to run Tomcat or serve jsp's. There are in fact modules that will compile jsp's in Apache but are not recommended as they do not provide a full Java environment. mod_jk is a connector for Apache
, it works like mod_rewrite and/or mod_proxy, this helps to split static and dynamic content as Apache is traditionally faster at serving up static content then Tomcat. If you are running a small site, tomcat alone will be fine.
The benefit of using tomcat over a simple module that can compile and serve jsp's is that you get the full Java servelt environment. Some benefits include, built in session tracking and management, access to your home brew Java objects in your jsp's and servlets, custom tag libraries that can help you build large complex pages by using your own custom tags. The list goes on and on but those are some highlights.
Originally posted by cyberpt Based on what I understand you will need to install Tomcat in order to run jsp and serverlets on Apache. Apache is really just the web server only. The module
mod_jk is required to be installed as a conector in order for Apache to talk to Tomcat server.
Ok... Tomcat seems like what I'm going to learn next; however, I've read that you need Apache if you are planning on using such things as databases or languages like PHP.
Java can interface with databases via JDBC. PHP can be executed as a CGI binary, so assuming Tomcat can handle CGIs (I think it can, but I'm not positive -- only started playing around with it myself), you can use PHP through it.
Originally posted by cyberpt Based on what I understand you will need to install Tomcat in order to run jsp and serverlets on Apache. Apache is really just the web server only. The module
mod_jk is required to be installed as a conector in order for Apache to talk to Tomcat server.
Originally posted by bentman78 nope...you can proxy request to the tomcat server on port 8080 from Apache. I was in debate about his recently, and doing it this way is much easier.
I've also heard that you can proxy certain pages to Tomcat from Apache through port 8080. It's funny that Apache Jakarta's website suggests to use the mod_jk as on the link above.
Let me try and clear up some confusion. Tomact is a Java specific application server. Tomcat can process JSP's, execute servelets, serve static content including HTML, and images. Tomcat known as a container provides a full Java environment for JSP's and servlets as well as any other supporting classes. The container adheres to a sun specification for deployment of Java applications.
Here are some links that provide more background as well as a tutorial.
Tomcat can not execute php or other scripting languages. You can connect to databases through Java but that is not a function of Tomcat, however as described above, Tomcat can execute any supporting classes you need including JDBC driver classes. You do not need Apache in any way to use Tomcat. If you have all Java or static html content then you don't need Apache at all. mod_jk is not in any way required, in fact it is highly unlikely you will need mod_jk.
A word of caution there is a lot to learn when it comes to Java server side technologies. Start small. Build you site or test site with JSP's only, then add some servelets. Pick up some books.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.