Sun Microsystems Logo



Sun Java System Web Server
FastCGI Scripts
To set up and run the sample, follow these steps :
  1. Download the FastCGI enabled Sun Java System Web Server 7.0 PHP Add-On 1.0.

    Download it to a directory say /export/home.

  2. Configure PHP as a FastCGI server on Web Server. To do so, follow the below steps.
    • Unzip phppack-5_2_0*.zip in /export/home .
    •  $ cd /export/home; unzip phppack-5_2_0*.zip 

      FastCGI enabled php binary will be in /export/home/php/bin directory.

    • Start the Admin server.
      $ <webserver-install-root>/admin-server/bin/startserv
    • Configure FastCGI handler as below, using GUI:

      Note: Below example assumes https-test to be the name of an existing Web Server Instance

      • Login to Admin Server GUI page using the below URL:
        http://<host-name>:<admin-server-port>
      • From the Common Tasks page, click on Edit Virtual Server > Content Handling > FastCGI tab.
      • Click New to create a new URI with FastCGI handler mapping.
        Specify the following values:

        Applies To: choose “New URI” and specify “/fastcgi/*”
        Role: Responder
        Application Path: /export/home/php/bin/php
        Environment Variables: “PHPRC=/export/home/php”,”LD_LIBRARY_PATH=/export/home/php”,”LD_LIBRARY_PATH_64=/export/home/php/64”

      • Click on OK to save changes.
      • Click on Deployment Pending link, followed by a click on Deploy button to deploy the configuration to all nodes.
      • If you are creating a handler for the first time, you will be prompted to restart the instances. Choose Now and click OK to restart the instance(s).

  3. Create a soft link from <webserver-install-root>/samples/fastcgi directory to <webserver-instance-docroot> directory.
    $ ln -s <webserver-install-root>/samples/fastcgi <webserver-instance-docroot> 
  4. Run the samples as below:
    • Hello World sample URL:
      http://<host-name>:<webserver-instance-port>/fastcgi/HelloWorld.php
    • Directory Listing sample URL:
      http://<host-name>:<webserver-instance-port>/fastcgi/directory.php
    • Page counter sample URL:
      http://<host-name>:<webserver-instance-port>/fastcgi/pageCounter.php
    • Server information sample URL:
      http://<host-name>:<webserver-instance-port>/fastcgi/serverinfo.php

References: