Menu

[r389]: / trunk / php-java-bridge / INSTALL.SERVLET  Maximize  Restore  History

Download this file

144 lines (102 with data), 5.0 kB

Installing the PHP/Java Bridge J2EE Component
---------------------------------------------


Installing and testing the frontend and backend on Linux
--------------------------------------------------------

On RedHat Enterprise Linux >= 4 or Fedora Linux >= 4 download the RPM
files and type:

    rpm -i tomcat5-5.0.30-5jpp_6fc.i386.rpm
    rpm -i php-java-bridge-x.y.z-1.i386.rpm
    rpm -i php-java-bridge-tomcat-x.y.z-1.i386.rpm

then re-start apache and tomcat, e.g. with the commands:

    service tomcat5 restart
    service httpd restart

and check:

    http://localhost:8080/JavaBridge/test.php 
    http://yourHost/JavaBridge/test.php



Installing and testing the backend on Unix, Windows
---------------------------------------------------

* Download and install a J2EE application server or servlet engine,
  for example Oracle 10g, IBM WebSphere6 or Tomcat 4 or higher.

* Download JavaBridge.war and deploy it into the running servlet
  engine or j2ee server using the application server tools.

* Test the AS backend: Browse to http://localhost:<port#>/JavaBridge
  and run the supplied examples. For example:

    http://localhost:8080/JavaBridge/test.php


Installing and testing the frontend on Unix, Windows
----------------------------------------------------

* Check if your php extension_dir contains the java extension. If not,
  copy the appropriate java-<architecture>-<os>.so or
  java-<architecture>-<os>.dll from the JavaBridge.war file to your php
  extension directory and rename it to java.so (Unix) or
  php_java.dll (Windows). Check if the java .ini entry (usually
  /usr/local/lib/php.ini or c:\windows\php.ini) loads the java extension
  and connects php to the servlet backend, e.g.:
  
    extension = java.so
    ; extension = php_java.dll
    [java]
    java.hosts   = 127.0.0.1:8080
    java.servlet = User
  
* Test the Apache or IIS frontent: Check if the HTTP document root
  directory is shared with the AS "webapps" directory. If not, change
  the java.servlet option to "On" or to "/JavaBridge/JavaBridge.php":

    extension = java.so
    ; extension = php_java.dll
    [java]
    java.hosts   = 127.0.0.1:8080
    java.servlet = On

  Then re-start apache and check "java status" and "java server":

   http://yourHost.com/JavaBridge/test.php


* Please report bugs/problems to the mailing list:

    php-java-bridge-users@lists.sourceforge.net


Individual users can create .war files which use their own php
version. Please see the WEB-INF/cgi/README for details.

When Apache or IIS is not available, the administrator may start a PHP
standalone server for all users, for example:

  export X_JAVABRIDGE_OVERRIDE_HOSTS="/"
  export PHP_FCGI_CHILDREN="20"
  export PHP_FCGI_MAX_REQUESTS="500"
  /usr/bin/php-cgi -dlog_errors=On -ddisplay_errors=Off -b 127.0.0.1:9667


When Apache or IIS is available, the administrator may set up the
mod_jk adapter to forward JSP/Servlet requests to the J2EE AS, for
example:

  internet
  clients  <->  :80---> Apache or IIS                        --->  J2EE AS
                             | |                            /  /    |   |
                             |  mod_jk <-- jsp/servlet req./  /     |   |
                             |                               /     jsp  |
                             --- php                        /           |
                             --- php  <-- P-J-B PROTOCOL --/         servlet
                                 ...                                   ...

    J2EE port not visible to internet clients. Apache/IIS document root
    not used.


or he/she may connect both, apache and the j2ee server to the
internet, example:

                :80---> Apache or IIS
            /                |
           / php req.        ---- php
          /                  ---- php  <--| 
                                  ...     |
  internet                                |
  clients                                 |
          \                               |P-J-B
           \jsp/servlet req.              |PROTOCOL
            \                             |
                                          |
           |--> :8080--> J2EE AS          |
           |                 |            |
           |                 ---- jsp     |
           |                 ---- servlet |
           |                      ...     |
           -------------------------------|

    Apache/IIS and J2EE ports are accessible from the
    internet. Apache/IIS and the J2EE AS share the same document root.

Known AS Issues 
---------------

* If you see a script exception when running java-server-faces/index.php
  and the name is displayed as "null", check if apache is able to
  execute the script. If not, stop apache or change the script
  location from "@80:/java-server-faces/helloWorld.php" to
  "/java-server-faces/helloWorld.php".

* If you want to allow clients to access your backend from a remote
  host, set java.servlet=On and set allow_http_tunnel to On in the
  web.xml.