head	1.8;
access;
symbols
	RELENG_8_4:1.8.0.2
	RELENG_9_1_0_RELEASE:1.6.62.1.4.2
	RELENG_9_1:1.6.62.1.0.4
	RELENG_9_1_BP:1.6.62.1
	RELENG_8_3_0_RELEASE:1.6.56.1.8.1
	RELENG_8_3:1.6.56.1.0.8
	RELENG_8_3_BP:1.6.56.1
	RELENG_9_0_0_RELEASE:1.6.62.1.2.1
	RELENG_9_0:1.6.62.1.0.2
	RELENG_9_0_BP:1.6.62.1
	RELENG_9:1.6.0.62
	RELENG_9_BP:1.6
	RELENG_7_4_0_RELEASE:1.6.60.1
	RELENG_8_2_0_RELEASE:1.6.56.1.6.1
	RELENG_7_4:1.6.0.60
	RELENG_7_4_BP:1.6
	RELENG_8_2:1.6.56.1.0.6
	RELENG_8_2_BP:1.6.56.1
	RELENG_8_1_0_RELEASE:1.6.56.1.4.1
	RELENG_8_1:1.6.56.1.0.4
	RELENG_8_1_BP:1.6.56.1
	RELENG_7_3_0_RELEASE:1.6.58.1
	RELENG_7_3:1.6.0.58
	RELENG_7_3_BP:1.6
	RELENG_8_0_0_RELEASE:1.6.56.1.2.1
	RELENG_8_0:1.6.56.1.0.2
	RELENG_8_0_BP:1.6.56.1
	RELENG_8:1.6.0.56
	RELENG_8_BP:1.6
	RELENG_7_2_0_RELEASE:1.6.54.1
	RELENG_7_2:1.6.0.54
	RELENG_7_2_BP:1.6
	RELENG_7_1_0_RELEASE:1.6.52.1
	RELENG_6_4_0_RELEASE:1.6.50.1
	RELENG_7_1:1.6.0.52
	RELENG_7_1_BP:1.6
	RELENG_6_4:1.6.0.50
	RELENG_6_4_BP:1.6
	RELENG_7_0_0_RELEASE:1.6
	RELENG_6_3_0_RELEASE:1.6
	RELENG_7_0:1.6.0.48
	RELENG_7_0_BP:1.6
	RELENG_6_3:1.6.0.46
	RELENG_6_3_BP:1.6
	RELENG_7:1.6.0.44
	RELENG_7_BP:1.6
	RELENG_6_2_0_RELEASE:1.6
	RELENG_6_2:1.6.0.42
	RELENG_6_2_BP:1.6
	RELENG_5_5_0_RELEASE:1.6
	RELENG_5_5:1.6.0.40
	RELENG_5_5_BP:1.6
	RELENG_6_1_0_RELEASE:1.6
	RELENG_6_1:1.6.0.38
	RELENG_6_1_BP:1.6
	RELENG_6_0_0_RELEASE:1.6
	RELENG_6_0:1.6.0.36
	RELENG_6_0_BP:1.6
	RELENG_6:1.6.0.34
	RELENG_6_BP:1.6
	RELENG_5_4_0_RELEASE:1.6
	RELENG_5_4:1.6.0.32
	RELENG_5_4_BP:1.6
	RELENG_4_11_0_RELEASE:1.6
	RELENG_4_11:1.6.0.30
	RELENG_4_11_BP:1.6
	RELENG_5_3_0_RELEASE:1.6
	RELENG_5_3:1.6.0.28
	RELENG_5_3_BP:1.6
	RELENG_5:1.6.0.26
	RELENG_5_BP:1.6
	RELENG_4_10_0_RELEASE:1.6
	RELENG_4_10:1.6.0.24
	RELENG_4_10_BP:1.6
	RELENG_5_2_1_RELEASE:1.6
	RELENG_5_2_0_RELEASE:1.6
	RELENG_5_2:1.6.0.22
	RELENG_5_2_BP:1.6
	RELENG_4_9_0_RELEASE:1.6
	RELENG_4_9:1.6.0.20
	RELENG_4_9_BP:1.6
	RELENG_5_1_0_RELEASE:1.6
	RELENG_5_1:1.6.0.18
	RELENG_5_1_BP:1.6
	RELENG_4_8_0_RELEASE:1.6
	RELENG_4_8:1.6.0.16
	RELENG_4_8_BP:1.6
	RELENG_5_0_0_RELEASE:1.6
	RELENG_5_0:1.6.0.14
	RELENG_5_0_BP:1.6
	RELENG_4_7_0_RELEASE:1.6
	RELENG_4_7:1.6.0.12
	RELENG_4_7_BP:1.6
	RELENG_4_6_2_RELEASE:1.6
	RELENG_4_6_1_RELEASE:1.6
	RELENG_4_6_0_RELEASE:1.6
	RELENG_4_6:1.6.0.10
	RELENG_4_6_BP:1.6
	RELENG_4_5_0_RELEASE:1.6
	RELENG_4_5:1.6.0.8
	RELENG_4_5_BP:1.6
	RELENG_4_4_0_RELEASE:1.6
	RELENG_4_4:1.6.0.6
	RELENG_4_4_BP:1.6
	RELENG_4_3_0_RELEASE:1.6
	RELENG_4_3:1.6.0.4
	RELENG_4_3_BP:1.6
	RELENG_4_2_0_RELEASE:1.6
	RELENG_4_1_1_RELEASE:1.6
	PRE_SMPNG:1.6
	RELENG_4_1_0_RELEASE:1.6
	RELENG_3_5_0_RELEASE:1.2.2.3
	RELENG_4_0_0_RELEASE:1.6
	RELENG_4:1.6.0.2
	RELENG_4_BP:1.6
	RELENG_3_4_0_RELEASE:1.2.2.3
	RELENG_3_3_0_RELEASE:1.2.2.3
	RELENG_3_2_PAO:1.2.2.2.0.2
	RELENG_3_2_PAO_BP:1.2.2.2
	RELENG_3_2_0_RELEASE:1.2.2.2
	RELENG_3_1_0_RELEASE:1.2.2.1
	RELENG_3:1.2.0.2
	RELENG_3_BP:1.2
	RELENG_3_0_0_RELEASE:1.2
	v0_4:1.1.1.1
	PICOBSD:1.1.1;
locks; strict;
comment	@# @;


1.8
date	2012.11.17.01.50.17;	author svnexp;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2012.01.07.16.09.43;	author uqs;	state Exp;
branches;
next	1.6;

1.6
date	99.08.28.01.33.59;	author peter;	state Exp;
branches
	1.6.2.1
	1.6.34.1
	1.6.44.1
	1.6.50.1
	1.6.52.1
	1.6.54.1
	1.6.56.1
	1.6.58.1
	1.6.60.1
	1.6.62.1;
next	1.5;

1.5
date	99.08.22.21.45.20;	author dwhite;	state Exp;
branches;
next	1.4;

1.4
date	99.05.05.07.22.33;	author abial;	state Exp;
branches;
next	1.3;

1.3
date	99.02.12.20.36.13;	author abial;	state Exp;
branches;
next	1.2;

1.2
date	98.09.15.11.17.07;	author abial;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	98.08.27.17.38.45;	author abial;	state Exp;
branches
	1.1.1.1;
next	;

1.8.2.1
date	2012.11.17.01.50.17;	author svnexp;	state dead;
branches;
next	1.8.2.2;

1.8.2.2
date	2013.03.28.13.03.30;	author svnexp;	state Exp;
branches;
next	;

1.6.2.1
date	2012.11.17.07.24.23;	author svnexp;	state Exp;
branches;
next	;

1.6.34.1
date	2012.11.17.07.41.10;	author svnexp;	state Exp;
branches;
next	;

1.6.44.1
date	2012.11.17.08.03.29;	author svnexp;	state Exp;
branches;
next	;

1.6.50.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.6.52.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.6.54.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.6.56.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.6.56.1.2.1
	1.6.56.1.4.1
	1.6.56.1.6.1
	1.6.56.1.8.1;
next	1.6.56.2;

1.6.56.2
date	2012.11.17.10.36.14;	author svnexp;	state Exp;
branches;
next	;

1.6.56.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.6.56.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.6.56.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.6.56.1.8.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.6.56.1.8.2;

1.6.56.1.8.2
date	2012.11.17.08.24.55;	author svnexp;	state Exp;
branches;
next	;

1.6.58.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.6.60.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.6.60.2;

1.6.60.2
date	2012.11.17.08.16.53;	author svnexp;	state Exp;
branches;
next	;

1.6.62.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.6.62.1.2.1
	1.6.62.1.4.1;
next	1.6.62.2;

1.6.62.2
date	2012.11.17.11.36.30;	author svnexp;	state Exp;
branches;
next	;

1.6.62.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.6.62.1.2.2;

1.6.62.1.2.2
date	2012.11.17.08.36.30;	author svnexp;	state Exp;
branches;
next	;

1.6.62.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.6.62.1.4.2;

1.6.62.1.4.2
date	2012.11.17.08.47.20;	author svnexp;	state Exp;
branches;
next	;

1.2.2.1
date	99.02.05.12.21.41;	author abial;	state Exp;
branches;
next	1.2.2.2;

1.2.2.2
date	99.05.05.07.31.32;	author abial;	state Exp;
branches;
next	1.2.2.3;

1.2.2.3
date	99.08.29.15.53.40;	author peter;	state Exp;
branches;
next	;

1.1.1.1
date	98.08.27.17.38.45;	author abial;	state Exp;
branches;
next	;


desc
@@


1.8
log
@Switching exporter and resync
@
text
@Simple_httpd  -  A small and free Web server

"Simple_httpd is like /usr/bin/mail is to mail clients, no frills."

This HTTP server can be used in any FreeBSD/PicoBSD application.

It has been tested under FreeBSD 2.2.x, 3.x and 4.x. It might work 
on other OS systems, but it's for FreeBSD primarily.

The main advantage to Simple_httpd is that it is very small.
The 25K binary can satisfy most needs in a small or embedded
appplication.  If you want a full featured server see 
/usr/ports/www/apache* or http://www.apache.org 

Simple_httpd is released under a BSD style copyright that unlike
GPL is embedded developer friendly.

The server is designed to be run in one of two modes.  The standard
mode is a httpd server running in the background serving up a directory
of html,gif,cgi whatever.  Your traditional www server.

The "fetch" mode supports file transfer over httpd.  This 
is best thought of as mate for fetch(1).  This feature can be
useful to transfer a file from one host to another.

Simple_httpd has the ability to run CGI scripts.  All CGI
scripts must be located in ${DOCUMENT_ROOT}/cgi-bin.  The
server currently only sets 3 environment variables before calling
the script.

CGI Environment variables are below:

SERVER_SOFTWARE = FreeBSD/PicoBSD
REMOTE_HOST = client.canada_lower_taxes.com
REMOTE_ADDR = 200.122.13.108

In most target applications for this server the extra DNS traffic from
the remote_addr lookup will likely be on the local lan anyway and not
on the other side of the internet.  You can turn it off yourself in
the code if you want to speed the whole process up.  Be sure to turn
it off for the logfile also.

How to use it?
==============

Compile with make, run as follows

usage: simple_httpd 	[-vD]
			[-d directory]
			[-g grpid]
			[-l logfile]
			[-p port]
or
usage: simple_httpd [-p port] -f filename

-v
Run the server verbose.  Show the program options that will be used for this
process.  Will only show information during startup, no messages will
be displayed while serving requests.  In other words you can still 
daemonize without fear of output on stdout.

-D
Do not daemonize.  The server will not run in the background.  It will
stay attached to the tty.  This is useful for debugging.  In this
mode no log file is created.  Logging info is to stdout.

This option is automatically selected if fetch option is selected.

-d directory
The html document directory, if nothing is provided the default is 
/httphome if UID is root, otherwise document root is ${HOME}/public_html

-l logfile
Set the logfile to use. Log messages will be written to /var/log/jhttpd.log
if you are root and ${HOME}/jhttpd.log otherwise. If you don't want a 
log file try "-l /dev/null"

-p port
Set the port httpd server will listen to.  Default is port 80 if
you are root and 1080 if you are not. 

-f filename
This is the only option needed to use the "fetch" feature.  The file
specified will be the ONLY file served to ANY GET request from a browser
or fetch(1).

Example
=======

Standard Mode:
--------------
If you have the FreeBSD handbook installed on your machine and would 
like to serve it up over http for a quick look you could do this

simple_httpd -d /usr/share/doc/handbook -l /usr/tmp/jlog.txt -p 1088 -v

Any browser would be able to look at the handbook with
http://whatever_host/handbook.html:1088

I'm using 1088 as the port since I already have apache running on port 80
and port 1080 on my host.

Please note, the handbook is not installed by default in FreeBSD 3.x
It must be installed from the ports collection first if you want to
try this.

Another simple example is to browse your local ports collection:

cd /usr/ports
make readmes   #wait about 1 hour!
simple_httpd -p 1080 -v -d /usr/ports

Then point your browser at http://whatever_host/README.html

Fetch Mode:
--------------
This is designed to be used in conjunction with fetch(3).  It allows
for easy transfer of files from one host to another without messy
authentication or pathnames required with ftp.  The file to be
served up must be readable by the user running simple_httpd.
This is not a magic way to avoid permissions and read files.

The daemon will only serve up ONE file.  The file specified will 
be returned for every GET request regardless of what the browser
asks for.  This allows for on the fly naming.

sender# simple_httpd -f /usr/tmp/big_file.tgz
receiver# fetch http://sender.com/Industrial_Secrets.tgz

big_file.tgz was transferred from one machine to another and renamed
Industrial_Secrets.tgz at the same time.

Tunneling over other TCP ports.  Choose something that firewall
will probably pass. See /etc/services.

sender# simple_httpd -p 53 -f /usr/tmp/big_file.tgz
receiver# fetch http://sender.com:53/Industrial_Secrets.tgz

To Do
=====

Simple authentication would be very useful [understatment].
/etc/passwd or PAM would be nice.

I think a netmask option would be good. Most internet appliances
probably want to restrict traffic to local ethernet anyway.
ie: Allow anything from my class C.

The server always has 1 zombie process hanging around when it
runs as a daemon.  Should fix so that it doesn't happen.

Anything to make it faster!

Man page

If anyone has any improvements or ways to easily implement something
please let me <wlloyd@@slap.net> know.  If you make some neat embedded
device with PicoBSD I want to know too!

Credits
=======

This program was originally contributed by Marc Nicholas <marc@@netstor.com>

Major rewrite by William Lloyd <wlloyd@@slap.net>

$FreeBSD: head/release/picobsd/tinyware/simple_httpd/README 229779 2012-01-07 16:09:43Z uqs $
@


1.8.2.1
log
@file README was added on branch RELENG_8_4 on 2013-03-28 13:03:30 +0000
@
text
@d1 167
@


1.8.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 167
Simple_httpd  -  A small and free Web server

"Simple_httpd is like /usr/bin/mail is to mail clients, no frills."

This HTTP server can be used in any FreeBSD/PicoBSD application.

It has been tested under FreeBSD 2.2.x, 3.x and 4.x. It might work 
on other OS systems, but it's for FreeBSD primarily.

The main advantage to Simple_httpd is that it is very small.
The 25K binary can satisfy most needs in a small or embedded
appplication.  If you want a full featured server see 
/usr/ports/www/apache* or http://www.apache.org 

Simple_httpd is released under a BSD style copyright that unlike
GPL is embedded developer friendly.

The server is designed to be run in one of two modes.  The standard
mode is a httpd server running in the background serving up a directory
of html,gif,cgi whatever.  Your traditional www server.

The "fetch" mode supports file transfer over httpd.  This 
is best thought of as mate for fetch(1).  This feature can be
usefull to transfer a file from one host to another.

Simple_httpd has the ability to run CGI scripts.  All CGI
scripts must be located in ${DOCUMENT_ROOT}/cgi-bin.  The
server currently only sets 3 enviroment variables before calling
the script.

CGI Enviroment variables are below:

SERVER_SOFTWARE = FreeBSD/PicoBSD
REMOTE_HOST = client.canada_lower_taxes.com
REMOTE_ADDR = 200.122.13.108

In most target applications for this server the extra DNS traffic from
the remote_addr lookup will likely be on the local lan anyway and not
on the other side of the internet.  You can turn it off yourself in
the code if you want to speed the whole process up.  Be sure to turn
it off for the logfile also.

How to use it?
==============

Compile with make, run as follows

usage: simple_httpd 	[-vD]
			[-d directory]
			[-g grpid]
			[-l logfile]
			[-p port]
or
usage: simple_httpd [-p port] -f filename

-v
Run the server verbose.  Show the program options that will be used for this
process.  Will only show information during startup, no messages will
be displayed while serving requests.  In other words you can still 
daemonize without fear of output on stdout.

-D
Do not daemonize.  The server will not run in the background.  It will
stay attached to the tty.  This is usefull for debugging.  In this
mode no log file is created.  Logging info is to stdout.

This option is automatically selected if fetch option is selected.

-d directory
The html document directory, if nothing is provided the default is 
/httphome if UID is root, otherwise document root is ${HOME}/public_html

-l logfile
Set the logfile to use. Log messages will be written to /var/log/jhttpd.log
if you are root and ${HOME}/jhttpd.log otherwise. If you don't want a 
log file try "-l /dev/null"

-p port
Set the port httpd server will listen to.  Default is port 80 if
you are root and 1080 if you are not. 

-f filename
This is the only option needed to use the "fetch" feature.  The file
specified will be the ONLY file served to ANY GET request from a browser
or fetch(1).

Example
=======

Standard Mode:
--------------
If you have the FreeBSD handbook installed on your machine and would 
like to serve it up over http for a quick look you could do this

simple_httpd -d /usr/share/doc/handbook -l /usr/tmp/jlog.txt -p 1088 -v

Any browser would be able to look at the handbook with
http://whatever_host/handbook.html:1088

I'm using 1088 as the port since I already have apache running on port 80
and port 1080 on my host.

Please note, the handbook is not installed by default in FreeBSD 3.x
It must be installed from the ports collection first if you want to
try this.

Another simple example is to browse your local ports collection:

cd /usr/ports
make readmes   #wait about 1 hour!
simple_httpd -p 1080 -v -d /usr/ports

Then point your browser at http://whatever_host/README.html

Fetch Mode:
--------------
This is designed to be used in conjunction with fetch(3).  It allows
for easy transfer of files from one host to another without messy
authentication or pathnames required with ftp.  The file to be
served up must be readable by the user running simple_httpd.
This is not a magic way to avoid permissions and read files.

The daemon will only serve up ONE file.  The file specified will 
be returned for every GET request regardless of what the browser
asks for.  This allows for on the fly naming.

sender# simple_httpd -f /usr/tmp/big_file.tgz
receiver# fetch http://sender.com/Industrial_Secrets.tgz

big_file.tgz was transferred from one machine to another and renamed
Industrial_Secrets.tgz at the same time.

Tunneling over other TCP ports.  Choose something that firewall
will probably pass. See /etc/services.

sender# simple_httpd -p 53 -f /usr/tmp/big_file.tgz
receiver# fetch http://sender.com:53/Industrial_Secrets.tgz

To Do
=====

Simple authentication would be very usefull[understatment].
/etc/passwd or PAM would be nice.

I think a netmask option would be good. Most internet appliances
probably want to restrict traffic to local ethernet anyway.
ie: Allow anything from my class C.

The server always has 1 zombie process hanging around when it
runs as a daemon.  Should fix so that it doesn't happen.

Anything to make it faster!

Man page

If anyone has any improvements or ways to easily implement something
please let me <wlloyd@@slap.net> know.  If you make some neat embedded
device with PicoBSD I want to know too!

Credits
=======

This program was originally contributed by Marc Nicholas <marc@@netstor.com>

Major rewrite by William Lloyd <wlloyd@@slap.net>

$FreeBSD: releng/8.4/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.7
log
@SVN rev 229779 on 2012-01-07 16:09:43Z by uqs

Spelling fixes for release/
@
text
@d167 1
a167 1
$FreeBSD$
@


1.6
log
@$Id$ -> $FreeBSD$
@
text
@d24 1
a24 1
usefull to transfer a file from one host to another.
d28 1
a28 1
server currently only sets 3 enviroment variables before calling
d31 1
a31 1
CGI Enviroment variables are below:
d64 1
a64 1
stay attached to the tty.  This is usefull for debugging.  In this
d142 1
a142 1
Simple authentication would be very usefull[understatment].
@


1.6.44.1
log
@Switch importer
@
text
@d167 1
a167 1
$FreeBSD: stable/7/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.34.1
log
@Switch importer
@
text
@d167 1
a167 1
$FreeBSD: stable/6/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.2.1
log
@Switch importer
@
text
@d167 1
a167 1
$FreeBSD: stable/4/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.62.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.6.62.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d167 1
a167 1
$FreeBSD: stable/9/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.62.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.6.62.1.4.2
log
@Switch importer
@
text
@d167 1
a167 1
$FreeBSD: releng/9.1/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.62.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.6.62.1.2.2
log
@Switch importer
@
text
@d167 1
a167 1
$FreeBSD: releng/9.0/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.60.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.6.60.2
log
@Switch importer
@
text
@d167 1
a167 1
$FreeBSD: releng/7.4/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.58.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.6.56.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.6.56.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d167 1
a167 1
$FreeBSD: stable/8/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.56.1.8.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.6.56.1.8.2
log
@Switch importer
@
text
@d167 1
a167 1
$FreeBSD: releng/8.3/release/picobsd/tinyware/simple_httpd/README 50479 1999-08-28 01:35:59Z peter $
@


1.6.56.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.6.56.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.6.56.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.6.54.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.6.52.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.6.50.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.5
log
@Major PicoBSD update by luigi with some debugging help from myself.

. Now builds on -STABLE (-CURRENT is broken due to bugs)
. etc directory contents centralized instead of in each
  type directory (can exclude & override as desired)
. Removed extraneous language files (lang files for rc really necessary?)
. dialog-based build tool with support for custom floppy builds
. MFS image loads as a mfs_root module instead of compiled into kernel

THIS IS BROKEN ON CURRENT.  I'll MFC to -STABLE immediately following.
luigi tells me I have an OK from jkh on the MFC.

Submitted by:	luigi
@
text
@d167 1
a167 1
$Id: README,v 1.2.2.2 1999/05/05 07:31:32 abial Exp $
@


1.4
log
@Simple_HTTPd on steroids - major rework of the original program, by
William Lloyd. New features include:

* many additional command line options
* "fetch" mode
* less bugs :-)
* better README.

Submitted by:	William Lloyd <wlloyd@@lap.net>
Reviewed by:	abial
@
text
@d167 1
a167 1
$Id:$
@


1.3
log
@Merge from RELENG_3.
@
text
@d1 41
a41 3
This is a small HTTP server. This version is under BSD license.
It's very simple, yet sufficient for serving basic Web contents,
including ability to run CGI scripts.
d46 53
a98 1
Compile, and run:
d100 2
a101 1
	simple_httpd <port>
d103 3
a105 3
If you're root, the document directory will be /httphome. If you're
not, then first of all you need to use the <port> option (>1023).
Then, the document root will be ${HOME}/httphome.
d107 52
a158 1
Log messages will be written out to /var/log/jhttpd.log .
d163 3
a165 1
This program was contributed by Marc Nicholas <marc@@netstor.com>
d167 1
a167 1
$Id: README,v 1.2.2.1 1999/02/05 12:21:41 abial Exp $
@


1.2
log
@This server is not so non-forking as it seemed at first glance...

Submitted by:	Jonathan H N Chin <jc254@@newton.cam.ac.uk>
@
text
@d1 3
a3 1
Contributed by Marc Nicholas <marc@@netstor.com>
d5 2
a6 2
This is a simple HTTP server. It is free for non-commercial
use only - see the source code for info on commercial licensing.
d8 16
a23 1
$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
@


1.2.2.1
log
@New version of simple_httpd. Added short install&run instructions.

Contributed by:	Marc Nicholas <marc@@netstor.com>
@
text
@d1 1
a1 3
This is a small HTTP server. This version is under BSD license.
It's very simple, yet sufficient for serving basic Web contents,
including ability to run CGI scripts.
d3 2
a4 2
How to use it?
==============
d6 1
a6 16
Compile, and run:

	simple_httpd <port>

If you're root, the document directory will be /httphome. If you're
not, then first of all you need to use the <port> option (>1023).
Then, the document root will be ${HOME}/httphome.

Log messages will be written out to /var/log/jhttpd.log .

Credits
=======

This program was contributed by Marc Nicholas <marc@@netstor.com>

$Id: README,v 1.2 1998/09/15 11:17:07 abial Exp $
@


1.2.2.2
log
@MFC: new revision of Simple_HTTPd.

Submitted by:	William Lloyd <wlloyd@@slap.net>
Reviewed by:	abial
@
text
@d1 3
a3 41
Simple_httpd  -  A small and free Web server

"Simple_httpd is like /usr/bin/mail is to mail clients, no frills."

This HTTP server can be used in any FreeBSD/PicoBSD application.

It has been tested under FreeBSD 2.2.x, 3.x and 4.x. It might work 
on other OS systems, but it's for FreeBSD primarily.

The main advantage to Simple_httpd is that it is very small.
The 25K binary can satisfy most needs in a small or embedded
appplication.  If you want a full featured server see 
/usr/ports/www/apache* or http://www.apache.org 

Simple_httpd is released under a BSD style copyright that unlike
GPL is embedded developer friendly.

The server is designed to be run in one of two modes.  The standard
mode is a httpd server running in the background serving up a directory
of html,gif,cgi whatever.  Your traditional www server.

The "fetch" mode supports file transfer over httpd.  This 
is best thought of as mate for fetch(1).  This feature can be
usefull to transfer a file from one host to another.

Simple_httpd has the ability to run CGI scripts.  All CGI
scripts must be located in ${DOCUMENT_ROOT}/cgi-bin.  The
server currently only sets 3 enviroment variables before calling
the script.

CGI Enviroment variables are below:

SERVER_SOFTWARE = FreeBSD/PicoBSD
REMOTE_HOST = client.canada_lower_taxes.com
REMOTE_ADDR = 200.122.13.108

In most target applications for this server the extra DNS traffic from
the remote_addr lookup will likely be on the local lan anyway and not
on the other side of the internet.  You can turn it off yourself in
the code if you want to speed the whole process up.  Be sure to turn
it off for the logfile also.
d8 1
a8 53
Compile with make, run as follows

usage: simple_httpd 	[-vD]
			[-d directory]
			[-g grpid]
			[-l logfile]
			[-p port]
or
usage: simple_httpd [-p port] -f filename

-v
Run the server verbose.  Show the program options that will be used for this
process.  Will only show information during startup, no messages will
be displayed while serving requests.  In other words you can still 
daemonize without fear of output on stdout.

-D
Do not daemonize.  The server will not run in the background.  It will
stay attached to the tty.  This is usefull for debugging.  In this
mode no log file is created.  Logging info is to stdout.

This option is automatically selected if fetch option is selected.

-d directory
The html document directory, if nothing is provided the default is 
/httphome if UID is root, otherwise document root is ${HOME}/public_html

-l logfile
Set the logfile to use. Log messages will be written to /var/log/jhttpd.log
if you are root and ${HOME}/jhttpd.log otherwise. If you don't want a 
log file try "-l /dev/null"

-p port
Set the port httpd server will listen to.  Default is port 80 if
you are root and 1080 if you are not. 

-f filename
This is the only option needed to use the "fetch" feature.  The file
specified will be the ONLY file served to ANY GET request from a browser
or fetch(1).

Example
=======

Standard Mode:
--------------
If you have the FreeBSD handbook installed on your machine and would 
like to serve it up over http for a quick look you could do this

simple_httpd -d /usr/share/doc/handbook -l /usr/tmp/jlog.txt -p 1088 -v

Any browser would be able to look at the handbook with
http://whatever_host/handbook.html:1088
d10 1
a10 2
I'm using 1088 as the port since I already have apache running on port 80
and port 1080 on my host.
d12 3
a14 3
Please note, the handbook is not installed by default in FreeBSD 3.x
It must be installed from the ports collection first if you want to
try this.
d16 1
a16 52
Another simple example is to browse your local ports collection:

cd /usr/ports
make readmes   #wait about 1 hour!
simple_httpd -p 1080 -v -d /usr/ports

Then point your browser at http://whatever_host/README.html

Fetch Mode:
--------------
This is designed to be used in conjunction with fetch(3).  It allows
for easy transfer of files from one host to another without messy
authentication or pathnames required with ftp.  The file to be
served up must be readable by the user running simple_httpd.
This is not a magic way to avoid permissions and read files.

The daemon will only serve up ONE file.  The file specified will 
be returned for every GET request regardless of what the browser
asks for.  This allows for on the fly naming.

sender# simple_httpd -f /usr/tmp/big_file.tgz
receiver# fetch http://sender.com/Industrial_Secrets.tgz

big_file.tgz was transferred from one machine to another and renamed
Industrial_Secrets.tgz at the same time.

Tunneling over other TCP ports.  Choose something that firewall
will probably pass. See /etc/services.

sender# simple_httpd -p 53 -f /usr/tmp/big_file.tgz
receiver# fetch http://sender.com:53/Industrial_Secrets.tgz

To Do
=====

Simple authentication would be very usefull[understatment].
/etc/passwd or PAM would be nice.

I think a netmask option would be good. Most internet appliances
probably want to restrict traffic to local ethernet anyway.
ie: Allow anything from my class C.

The server always has 1 zombie process hanging around when it
runs as a daemon.  Should fix so that it doesn't happen.

Anything to make it faster!

Man page

If anyone has any improvements or ways to easily implement something
please let me <wlloyd@@slap.net> know.  If you make some neat embedded
device with PicoBSD I want to know too!
d21 1
a21 3
This program was originally contributed by Marc Nicholas <marc@@netstor.com>

Major rewrite by William Lloyd <wlloyd@@slap.net>
d23 1
a23 1
$Id:$
@


1.2.2.3
log
@$Id$ -> $FreeBSD$
@
text
@d167 1
a167 1
$FreeBSD$
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
This is a simple, non-forking WWW server. It is free for non-commercial
d6 1
a6 1
$Id: README,v 1.1 1998/08/19 16:24:06 abial Exp $
@


1.1.1.1
log
@Initial import of PicoBSD v0.4 tree.
@
text
@@
