s c h e m a t i c s : c o o k b o o k

/ WebProgramming? / Cookbook.WebPLTWebServer

This Web


WebHome 
WebChanges 
TOC (with recipes)
NewRecipe 
WebTopicList 
WebStatistics 

Other Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Schematics


Schematics Home
Sourceforge Page
SchemeWiki.org
Original Cookbook
RSS

Scheme Links


Schemers.org
Scheme FAQ
R5RS
SRFIs
Scheme Cross Reference
PLT Scheme SISC
Scheme48 SCM
MIT Scheme scsh
JScheme Kawa
Chicken Guile
Bigloo Tiny
Gambit LispMe
GaucheChez

Lambda the Ultimate
TWiki.org

The PLT Web Server

Starting the PLT Web Server

Starting the web server on your computer is easy. Start a commmand prompt and execute the command:

plt-web-server

The web server will begin listening to port 80, the normal port for used for web servers. If you are working on a non-private computer, it is possible that you are not allowed to start programs listening to ports below 1024. In that case use the parameter -p to decide which port should be used:

plt-web-server -p 8042

Test the Web Server

To test the web server, enter this address your browser:

http://localhost

(If you are using port 8042 then use http://localhost:8042)

If everything works, you should get the message:

Welcome to the PLT Web Server

How to Add Contents to the Web Server

Location of Pages

The web server shows contents from the folder (if you haven't changed the default settings):

(simplify-path (build-path (collection-path "web-server") "default-web-root" "htdocs"))
To see where it is, enter the above in the interaction window of DrScheme. On my machine I get:

> (simplify-path (build-path (collection-path "web-server") "default-web-root" "htdocs"))
"c:\\program files\\plt\\collects\\web-server\\default-web-root\\htdocs"

This shows that the web server files is located in the folder c:\Program Files\plt\collects\web-server\default-web-root\htdocs\.

Write a Test Page

The pages in the subfolder

htdocs
is delivered as is by the server to the reader. Make a small text document in a text editor with the following contents:

    <html>
      <head><title>Dette er en titel</title></head>
      <body>Dette er en tekst.</body>
    </html>

Save the documents as htdocs\homepage.html.

Test the Test Page

To test the page, enter the address:

http://localhost/homepage.html

in your browser.

Congratulations, you are now a web master.

Tutorials

An Introduction to Web Development with PLT Scheme: part 1, part 2

Contributors

-- JensAxelSoegaard - 27 Apr 2004

CookbookForm
TopicType: Recipe
ParentTopic: WebRecipes
TopicOrder: 050

 
 
Copyright © 2004 by the contributing authors. All material on the Schematics Cookbook web site is the property of the contributing authors.
The copyright for certain compilations of material taken from this website is held by the SchematicsEditorsGroup - see ContributorAgreement & LGPL.
Other than such compilations, this material can be redistributed and/or modified under the terms of the GNU Lesser General Public License (LGPL), version 2.1, as published by the Free Software Foundation.
Ideas, requests, problems regarding Schematics Cookbook? Send feedback.
/ You are Main.guest