forked from harrypower/gforth_webserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
40 lines (35 loc) · 2.12 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
httpd.fs
string.fs
proxy.fs
sockets.fs
These files are from the gforth 0.7.0 distributed files. They work together to make a basic webserver.
These files can be found at /usr/share/gforth/0.7.0 if you have installed gforth via $ apt-get install gforth
The httpd.fs was writen by Bernd Paysan so the credit goes to him for all the work here!
The other files i am unsure of who the authors are but Bernd may be also responsible for them.
I have not tested the proxy stuff yet or set it up to be used yet.
This code needs the inetd service running and this can be installed with $ apt-get install inetutils-inetd
I have made this repository for the purpose of enabling other Raspberry Pi users to learn and use forth
as another programming lanugauge. This repository is used on a raspberry pi with debian wheezy distro running!
To use this server you need to install Gforth, inetd and then configure this service and adjust the path for the web files. The steps are below( do this on the pi or via sshing into the pi)
-Install stuff
$ sudo apt-get install gforth
$ sudo apt-get install inetutils-inetd
-Adjust the path for your web content
$ sudo nano httpd.fs
Find the following line in the code:
Variable DocumentRoot s" /home/pi/git/gforth_webserver/htdocs/" DocumentRoot $!
Change the /home/pi/git/gforth_webserver/htdocs/ to match where the index.html and other web docs are.
Save the file with control x, y enter.
-Configure inetd service and start the webserver
$ sudo nano /etc/inetd.conf
Move the curser to the end of the document and enter the following text:
gforth stream tcp nowait.100 pi /home/pi/git/gforth_webserver/httpd.fs
( Note if you want this to work on port 80 then replace gforth with http in above line. )
Save the file with control x y enter
$ sudo nano /etc/services
Move to the bottom of the document and add the following line:
gforth 4444/tcp
Save the file with control x y enter
Now at this moment you can restart your pi as follows:
$ sudo shutdown "now" -r
When the pi starts up it will server your index.html and other web stuff on port 4444 or 80 if you did the http change in the note above!