Python Server Pages Installation


Requirements:

Configuring Your Computer Before PSP Installation

Since PSP is written in Java it can be deployed on virtually any system that supports a web server, Java, and Java Servlets.  By far the hardest part of installing PSP is installing support for Java Servlets since quite a few web servers do not support them natively.  If your web server does not support Java servlets you can download and install the JRun servlet engine from Live Software.  JRun supports Netscape, Apache, and IIS and we have tested PSP on Solaris, Linux, and Windows NT by using JRun.

After your have confirmed or installed support for Java Servlets you need to install the JPython scripting language.  You can download JPython from www.jpython.org.  JPython is freely available and does not require a license fee.  A future version of PSP will include a runtime version of JPython, but for now you must complete this part on your own.  Currently, PSP only works with version 1.0.3 of JPython, not 1.1.  Installation of JPython is easily accomplished whether you are using Unix or Windows.

Installing PSP

The following command will install PSP on your computer:

jpython -jar psp100.jar

The installation script will ask you where to install PSP.  If the directory doesn't exist then it will be created.  An entire run of the installation script is shown below (for a Windows NT computer):

C:\>jpython -jar psp100.jar
Directory to install Python Server Pages: c:\psp
Installing to: c:\psp
. . . . . . . . . . . . . . .
Python Server Pages installed.

C:\>

One final step to installing PSP is required, the documenation.   Change directories to the directory where you installed PSP (c:\psp in the example above).  The documentation is in another JAR file called pspdocs.jar.   The documentation should be extracted to your web server's public directory.   Again for a Windows NT computer running IIS:

C:\psp>jpython -jar pspdocs.jar
Directory to install PSP Documentation: c:\inetpub\wwwroot\psp
Installing to: c:\inetpub\wwwroot\psp
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PSP Documentation installed.

C:\psp>

You can install the documentation somewhere else, but parts of the documentationr require PSP to work properly.

Configuring the Java Servlet

To configure your Java Servlet engine to load PSP properly requires two steps:

  1. Configure the engine's classpath to contain both psp.jar and jpython.jar.
  2. Map the *.PSP file extension to the com.vmc.psp.PSPServlet class.

The instructions for carrying out those steps are given for JRun v2.3, however your servlet engine will probably have some similar way of performing these activities.

Configuring JRun

From the JRun "Application Control" panel, press the "Start" button in the administrator box.  Select the "General" tab and then the "Java' tab that is displayed beneath the first set of tabs.   This section is used to specify the options used when starting up the Java Virtual Machine.  This is just the thing we need to add the two jar files to the JVM's classpath.  In the "Java Classpath" text field, add the location and name of jpython.jar and psp.jar.  Here is an example of what you're classpath field may look like:

C:/JRun/classes;C:/JRun/jsm-default/classes;<other jrun stuff>;C:/JPython-1.0/jpython.jar;C:/PSP/psp.jar

Press the "Save" button to commit the changes and you will have completed step 1!

Click back to the "Services" tab in the JRun adminstrator.   Select the "jse" (Java Servlet Engine) service from the list and press the "Service Config" button. 

To map the *.PSP extension to the PSP servlet, first, click on the "Mappings" tab.  Press the "Add" button to add a new extension.   In the new row that was created, enter:

Virtual Path/Extension

Servlet Invoked

*.psp psp

Click on the "Aliases" tab and press the "Add" button to add a new Servlet Alias:

Name Class Name Init Arguments Pre-Load
psp com.vmc.psp.PSPServlet   Checked

After pressing the "Save" and "Close" buttons for the "jse (Service Config)" and "JRunAdmin" application you will be almost ready to test PSP.  The final step is to press the "Restart" button on the "Application Control" window for JRun.

Testing Python Server Pages

If everything went Ok above, then testing PSP should be a snap.   The PSP documenation contains several sample PSP pages that can be used to test your installation.  The following command in your web browser should load up the PSP Programmers Reference:

http://localhost/psp

Select "Samples" from the menu on the left and try out the "Hello World" sample.  If you see your own IP address returned to you then everything has been installed correctly and you are ready to begin developing PSP applications.