Javascript  
 
  ScriptJava  
 
  Perl  
 
  PHP  
 
  ROR  
 
  ask us  
 

 

Applications
  1. Getting started
  2. Definitions
  3. First program
  4. Characters and Strings
  5. Object and methods
  6. Arrays and Circles
  7. Exceptions
  8. The main method
  9. Reading
  10. Writing file
  11. Vectors
  12. Stacks
  13. Map The Dictionary
  14. Lists
  15. Linked lists
  16. Collection
  17. Interfaces
  18. Scanner
  19. StringTokenizer
  20. Generics
  21. JDBC
  22. DataBase Queries
  23. JSP, The main step

Graphics

Applets
  1. Regards
  2. One Picture
  3. Calculator
  4. Random pictures
  5. Bouncing picture

Swings
  1. Buttons listeners
  2. TextFields
  3. Swing Example

JavaBeans
  1. The first step
  2. Example

Search a word:
   



© The scientific sentence. 2010

HowTo: JDK1.5, JDK1.6, Apache2.2, Tomcat6.0, and Oracle 10g
Java, Apache, Tomcat,
Oracle Database: How to
  

III. Configuration of Apache Tomcat:

Recall that Tomcat is the engine of the servelet. The servlet plays the 
role of CGI (Common Gateway Interface), with respect to Perl. That is a 
dynamic graphical user interface.

By default, a program running on a browser, like PHP, CGI, Apache, Microsoft 
IIS, and Tomcat are set on the 8080 port number. 
Without IIS, Apache runs on localhost, Installing Tomcat gives a conflict 
regarding localhost machine (127.0.0.1). The solution is to install the mod_jk 
module web server connector.
Go to :
http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/
Then:
http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.25/
Download the related connector mod_jk-apache-2.2.4.that is for Apache 2.2,
rename it as mod_jk.so and istall it at the \Apache\modules director like:
C:\Program Files\Apache Software Foundation\Apache2.2\modules

Configure Apache. Open the file: 
C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf 
Comment: #LoadModule proxy_module modules/mod_proxy.so
Uncomment: LoadModule jk_module modules/mod_jk.so
One should have Apache on localhost:8080 and Tomcat at localhost.

1. Go to:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\
examples\WEB-INF\web.xml
and put in, the two tags, in the place like the others, with the 
name of your servlet, "Regards"

    <servlet>
        <servlet-name>Regards</servlet-name>
        <servlet-class>Regards</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>Regards</servlet-name>
        <url-pattern>/servlets/servlet/Regards</url-pattern>
    </servlet-mapping>

2. Go to:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\server.xml 
and change 8080 to 80 in:

    <Connector port="80" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
 
    <Connector executor="tomcatThreadPool"
               port="80" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

3. Go to:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\jk\
workers.properties
All the lines uncommented appear here:
workers.tomcat_home= C:\Program Files\Apache Software Foundation\
Tomcat 6.0
workers.java_home= C:\Program Files\Java\jre1.6.0_03
ps=\
worker.list=ajp13
# worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
#  ----> Low lbfactor means less work done by the worker.
worker.ajp13.lbfactor=1

			   
4. Go to:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\
examples\WEB-INF\classes
and put your servlet java programes and thier classes there:


5. write a servlet like:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class Regards extends HttpServlet
{

 public void doGet(HttpServletRequest req, HttpServletResponse res)
   throws ServletException, IOException
 {
  doPost(req,res);  
 }

 public void doPost(HttpServletRequest req, HttpServletResponse res)
   throws ServletException, IOException
 {
  res.setContentType("text/html");	
  PrintWriter out=res.getWriter();
  out.println("Regards and all the best");	
  out.close();			
 }
}


 and go to :
C:\Program Files\Apache Software Foundation\Tomcat 6.0\
webapps\examples\servlets
an put in a file.html to call the sevlet:

The servlet will be located at:
http://localhost/examples/servlets/servlet/Regards
The content is:
Regards and all the best


Java Apache Tomcat



  
Google
Web
ScientificSentence
 




chimie labs
|
scientific sentence
|
java
|
php
|
green cat
|
contact
|


© Scientificsentence 2009. All rights reserved.