Sun ONE logo      Previous      Contents      Index      Next     

Sun ONE Web Server 6.1 Getting Started Guide

Chapter 9
Using Sun ONE Active Server Pages

Sun ONE Web Server 6.1 supports Sun™ ONE Active Server Pages version 4.0.1 (formerly Sun Chili!Soft ASP). This means that the Web server passes processing of all pages having the .asp file name extension to the Sun ONE Active Server Pages Server.

To use the Active Server Pages Server, you need to install and configure Sun ONE Active Server Pages against the Web server. The Sun ONE Active Server Pages installer is available on the Companion CD if you purchased the Sun ONE Web Server Media Kit, or by download from the following location:

http://wwws.sun.com/software/chilisoft/index.html

Note that you need to log in as root to install Sun ONE Active Server Pages.

When you install Sun ONE Active Server Pages, you can choose to configure it against any of the Web server instances that the Active Server Pages installer automatically detects. The Active Server Pages installer configures a URL to connect from a browser. For example: http://plaza:5100

To administer Sun ONE Active Server Pages, type the specified URL on a browser window.

Figure showing the Server Management interface of the Sun ONE Active Server Pages software.

You can fine-tune the Active Server Pages server to work with the Web server. Consult the product documentation included with Sun ONE Active Server Pages for more details on what you need to do to achieve this.

In this section, we will deploy a simple application, index.asp, which displays the current date, and run it off the Web Server.

  1. Use a text editor to create a file called index.asp and copy the following lines into it:
  2. <html>

    <body>

    <h1> Today’s date is :<%response.write (date())%> </h1>

    </body>

    </html>

  3. Next, we need to create a directory for this program.
  4. mkdir /opt/casp/sampleapp

  5. Copy the index.asp file into the newly created /opt/casp/sampleapp directory.
  6. Access the Active Server Pages Server interface on a browser and click the “Add a new application” link.

  7. Figure showing the Applications page in the Sun ONE Active Server Pages server interface.

  8. In the Add Application page, specify sample as the name of the application and /opt/casp/sampleapp as the directory name, and then click Save.

  9. Figure showing the Add Application page in the Sun ONE Active Server Pages server interface.

  10. Open a browser window and type the following URL:
  11. http://web-server-hostname/sample/index.asp

    The sample application displays the current date in the browser.


    Figure showing the sample .asp application running in a browser window.



Previous      Contents      Index      Next     


Copyright 2003 Sun Microsystems, Inc. All rights reserved.