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
Note: Apparently, this can also be named plt-web-server-text or some times web-server-text.
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
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
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\.
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>This is a title.</title></head>
<body>This is a text.</body>
</html>
Save the documents as
htdocs\homepage.html.
To test the page, enter the address:
http://localhost/homepage.html
in your browser.
Congratulations, you are now a web master.
An Introduction to Web Development with PLT Scheme:
part 1,
part 2
--
JensAxelSoegaard - 27 Apr 2004