Ir al contenido principal

PHP On Tomcat

Fue tomado de http://fabien.duminy.ifrance.com/blog/archives/2007/08/entry_14.html

tomcat and php

Here are the steps to run php in tomcat :

  1. Download tomcat and unzip the archive where you want (=> TOMCAT_DIR)
  2. Create the following directories : TOMCAT_DIR/webapps/testPHP
  3. If necessary, create directory TOMCAT_DIR/common/lib (it seems, at least with tomcat 6, that the directory is no more created)
  4. Edit the file TOMCAT_DIR/conf/catalina.properties and modify the line for property shared.loader :
    shared.loader=${catalina.home}/common/classes,${catalina.home}/common/lib/*.jar
  5. Edit the file TOMCAT_DIR/conf/web.xml and add the lines mentionned below (see 'lines to add to web.xml of your tomcat installation')
  6. To download quercus ( a php 5 engine written in pure java), you must in fact download resin because quercus can't be downloaded separately
  7. Unzip the archive to RESIN_DIR
  8. Copy the 2 files RESIN_DIR/lib/resin-util.jar and RESIN_DIR/lib/quercus.jar to the directory TOMCAT_DIR/common/lib (see step 3)
  9. Now, in the directory TOMCAT_DIR/webapps/testPHP, create a file named test.php with the following content :
  10. start tomcat (TOMCAT_DIR/bin/startup.sh) if you have not already done
  11. Enter the following url in your web browser : http://localhost:8080/testPHP/test.php
  12. You should get a screen like the following (values may vary) :
------------ expected result screen ---------------------------------

Quercus

PHP Version => 5.2.0
System => Linux 2.6.20-16-generic amd64
Build Date => 20070628T2777
Configure Command => n/a
Server API => CGI
Virtual Directory Support => disabled
Configuration File (php.ini) Path => WEB-INF/php.ini
PHP API => 20031224
PHP Extension => 20041030
Debug Build => no
Thread Safety => enabled
Registered PHP Streams => php, file, http, https

PHP Variables

............
----------------------------------------------------------------
------------ lines to add to web.xml of your tomcat installation ---------
quercus
com.caucho.quercus.servlet.QuercusServlet
text/html
quercus
*.php
----------------------------------------------------------------
And Voila, you have a running php engine in your tomcat webserver :-)

Comentarios

Publicar un comentario

Debes estar registrado en el blog para poder enviar tus comentarios.

Entradas populares de este blog

Instalacion Moodle en debian 4.0 R6

Tomado de http://docs.moodle.org/en/Debian_GNU/Linux_installation Debian GNU/Linux installation From MoodleDocs Jump to: navigation , search Contents[ hide ] 1 Installing Moodle as a Debian package 1.1 Using apt-get, aptitude or Synaptic 1.2 Manual download 2 Installing moodle from .tgz(.tar.gz) or .zip file 2.1 Step 1: Install required packages 2.2 Step 2: Download moodle 2.3 Step 3: Unpack file 2.4 Step 4: Start web and database servers 2.5 Step 5: Finally install 3 Installing Moodle from CVS 3.1 Install php, MySQL and other needed components 3.2 Setup MySQL Database 3.3 Get Moodle from CVS 3.4 Create a data directory and set Moodle directory permissions 3.5 Change Apache to use Moodle as the web site 3.6 Setup Moodle 3.7 Install cron 3.8 Other recommended settings 3.9 Updating from CVS if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } Installing Moodle as a Debian package Using apt-get, aptitude or Synaptic Make su...

Configurar Shorewall en CENTOS y Debian

Tomado de  http://www.com-sl.org/staticpages/index.php?page=config-shorewall-2da-parte Como   configurar un Firewall con Shorewall en dos Interfaces de Red con políticas DROP en CentOS y Debian . Autor:  Henry D. Rosado T. Correo electrónico:  bleycklinx@gmail.com Otros Datos:   Clic Aqui En este tutorial indicare como se configura un Firewall con Shorewall con políticas DROP en dos interfaces de red para CentOS y para Debian. Shorewall Shorewall  (Shoreline Firewall) es una robusta y extensible  herramienta de alto nivel para la configuración de muros cortafuego .  Shorewall  solo necesita se le proporcionen algunos datos en algunos ficheros de texto simple y éste creará las reglas de cortafuegos correspondientes a través de  iptables .  Shorewall  puede permitir utilizar un sistema como muro cortafuegos dedicado, sistema de múltiples funciones como  puerta de enlace, dispositivo de encaminamiento y servidor . Shorewall no solo le permite configurar un firewall seguro,  poderoso y rob...