Skip to content

Gforth basic webserver with Gforth scriping as the main feature!

License

Notifications You must be signed in to change notification settings

darrylhein/gforth_webserver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!
	
	

About

Gforth basic webserver with Gforth scriping as the main feature!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • F# 100.0%