Instalación de Tomcat

download Instalación de Tomcat

of 14

Transcript of Instalación de Tomcat

  • 8/9/2019 Instalacin de Tomcat

    1/14

    Instalacin de Tomcat

  • 8/9/2019 Instalacin de Tomcat

    2/14

    Qu es Tomcat

    Es el servidor web y de aplicaciones del

    proyecto Yakarta.

    Servidor web ya qu

    e gestiona solicitu

    des yrespuestas Http (incluye el servidor Apache)

    gracias a sus conectores http

    servidor de aplicaciones o contenedor de

    Servlets/JSP (Catalina).

  • 8/9/2019 Instalacin de Tomcat

    3/14

    Instalacin

    Lo primero es la descarga en El sitio de la

    Apache Software Foundation.

    El ejecutable incluye un wizard que facilitabastante la instalacin:

  • 8/9/2019 Instalacin de Tomcat

    4/14

    A menos que se estutilizando previamente elpuerto 8080 por otra aplicacin, resultaaconsejable dejar este puerto para Tomcat (es el

    puerto por defecto para el servidor web). Se le debe indicar el lugar donde se encuentra

    nuestro JRE (en la versin 5.5 de Tomcat, enversiones anteriores requera un JDK).

    Resulta aconsejable instalarlo como un servicioque ser arrancado por el sistema operativo aliniciarse.

  • 8/9/2019 Instalacin de Tomcat

    5/14

    si todo ha ido bien

    http://localhost:8080 y debemos ver la pgina de bienvenida

  • 8/9/2019 Instalacin de Tomcat

    6/14

    En el manager podremos ver la lista de

    aplicaciones.

    Por defecto se incluyen aplicaciones deejemplo, el manager, etc.

    Para cada una de ellas podemos pararla,

    iniciarla, etc.

  • 8/9/2019 Instalacin de Tomcat

    7/14

    Adems es conveniente comprobar que se ha

    instalado como un servicio del sistema:

    Entramos en los Servicios y comprobamos qu

    eApache Tomcat est iniciado

  • 8/9/2019 Instalacin de Tomcat

    8/14

    Vemos la estructura de directorios creada por Tomcat

    /bin - El nucleo de Tomcat. Necesario para iniciar,

    parar, etc. /conf- Archivos de configuracin. El ms importante es

    server.xml, que es el descriptor del servidor Tomcat.

    /logs - Archivos de log.

    /webapps - Para las aplicaciones que vienen conTomcat. Las aplicaciones que realicemos nosotrospodremos ponerlas en esta ruta o en otra

  • 8/9/2019 Instalacin de Tomcat

    9/14

    server.xml

    Es el descriptor de la configuracin del

    servidor.

    Las caractersticas ms importantes son: definicin de puertos de invocacin

    de parada y conectores,

    describir loscontextosde aplicacin.

  • 8/9/2019 Instalacin de Tomcat

    10/14

    Caractersticas del server.xml

    Indicacin del puerto Http y de atributos como el

    mximo nmero de hilos, etc:

  • 8/9/2019 Instalacin de Tomcat

    11/14

    Representar las aplicaciones que tenemos instaladas:

    .... ....

  • 8/9/2019 Instalacin de Tomcat

    12/14

    El contexto de aplicacin debe aparecer

    dentro del apartado "host".

    En nuestro caso lo hemos puesto al final de"host".

  • 8/9/2019 Instalacin de Tomcat

    13/14

    Algunos de los atributos de las aplicaciones:

  • 8/9/2019 Instalacin de Tomcat

    14/14

    className: Java class name of the implementation to use. This class must implement the org.apache.catalina.Context interface. If not specified, the standard value (defined below) willbe used.

    cookies: Por defecto true

    crossContext: True si quieres usar ServletContext.getContext() para redirigir (request dispatcher) a otra aplicacin de este host virtual. En entornos de fuerte seguridad poner false (pordefecto); hace que getContext() devuelve null.

    docBase: Obligatorio. Puede ser una ruta absoluta o relativa al directorio del Host

    path: The context path of this web application, which is matched against the beginning of each req uest URI to select the appropriate web application for processing. All of the contextpaths within a particular Host must be unique.

    reloadable: Set to true if you want Catalina to monitor classes in /WEB -INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected.This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's whythe default setting for this attribute is false. You can use the Manager web application, however, to trig ger reloads of deployed applications on demand.

    wrapperClass: va class name of the org.apache.catalina.Wrapper implementation c lass that will be used for servlets managed by this Context. If not specified, a standard default value willbe used.

    cachingAllowed: If the value of this flag is true, the cache for static resources will be used. If not specified, the default value of the flag is true.

    allowLinking: If the value of this flag is true, symlinks will be allowed inside the web application, pointing to reso urces outside the web application base path. If not specified, the defaultvalue of the flag is false. NOTE: This flag MUST NOT be set to true on the Windows platform (or any other OS which does not have a case sensitive filesystem), as it will disable casesensitivity checks, allowing JSP source code disclosure, among other security problems.

    swallowOutput: If the value of this flag is true, the bytes output to System.out and System.err by the web application wi ll be redirected to the web application logg er. If not specified, thedefault value of the flag is false.

    useNaming: Set to true (the default) to have Catalina enable a JNDI InitialContext for this web application that is compatible with Java2 Enterprise Edition (J2EE) platform conventions.

    workDir: Pathname to a scratch directory to be provided by this Context for temporary read-write use by servlets within the associated web application. This directory will be made visibleto servlets in the web application by a servlet context attribute (of type java.io.File) named javax.servlet.context.tempdir as described in the Servlet Specification. If not specified, asuitable directory underneath $CATALINA_HOME/work will be provided.