HTTPD
NAME
httpd
SYNOPSIS
httpd [-Mmuw] [-C conf] [-p port] [-c certificate]
DESCRIPTION
Pegasus is a web server that is running in sandboxed name space. Look first Introduction if you are new to Pegasus.
Options
-C
conf-
path to configuration file. The default is
/sys/lib/httpd.conf
.
-c
certificate-
path to certificate of PEM format that needs for https.
You need mon to specify private key for the certificate.
-p
port-
port address. The default is 80.
-m
-
allow mount in
$web/etc/namespace_$port
, where$port
is the port given by-p
.
-u
-
httpd is served as the user who invoked httpd.
Without this option, the httpd runs as user none.
Look also mon.
-w
-
httpd does not automatically allow service
/usr/$user/web
to the public.
(this flag may be discarded in future. because it is unable to make service without help of system administrator even if this flag is absent.)
-M
-
httpd is used with mon.
where $web
is a http root for the web document.
The following option in older versions is discarded because new Pegasus alway runs as server mode.
-s: execute httpd as server mode.
The following options in older versions are discarded because they can be given in httpd.conf.
-n: namespace configuration file. The default is /lib/namespace.httpd.
-R: URI rewrite file. The default is /sys/lib/httpd.rewrite.
-t: time out for CGI programs.
Document root of real and virtual servers can be anywhere.
The recommented place is:
/usr/yourname/www/docThe location is configured in
/sys/lib/httpd.rewrite
(by default).You will find example configuration in the distribution package.
The following configuration is a live example of mine:
http://plan9 */usr/arisawa/www https://plan9 */usr/arisawa/www http://202.250.160.122 */usr/arisawa/www https://202.250.160.122 */usr/arisawa/www http://cpa */usr/cpa/www / */usr/arisawa/httpwhere
plan9
is a IP based virtual host, and cpa
is a name based virtual host.The final line is for real hosts.
EXECUTION
The standard location of httpd of Pegasus is/usr/local/bin/$objtype
.Pegasus usually runs as user
web
so that Pegasus can do services in secure manner.Mon is a helper program that enable Pegasus run as user
web
.The following is my script to run Pegasus as user
web
with the help of mon
.b=/usr/local/bin/$objtype $b/mon -du web $b/httpd -uM c=/sys/lib/tls/cert r=/sys/lib/tls/key $b/mon -du web -r $r $b/httpd -uM -p443 -c $cYou may also execute Pegasus like this:
b=/usr/local/bin/$objtype $b/httpdThen Pegasus runs as user
none
. However this is not recommended in multi-user environment if you have files that should be private for you or that should be written only by your CGI.
LOCATION
/usr/local/bin/$objtype/httpd
SOURCE
http://plan9.aichi-u.ac.jp/netlib/pegasus/
KNOWN BUG
ver.2.8
- bad Etag in CGI environment, not a problem though.
You need remove duplicated file suffix entry for pjpeg in /sys/lib/mimetype.
.jpg image jpeg - y #.jpg image pjpeg - y
ver.2.8a
- incorrect file suffix comparison to /sys/lib/mimetype.
the comparison should be case insensitive.
- some incorrect error messages: "internal error" that should be "not found"
SEE ALSO
RELATED FILES
/sys/lib/httpd.conf
/lib/namespace.httpd
/sys/lib/mimetype
/sys/lib/httpd.rewrite
/usr/web/
/sys/log/http
/sys/log/blacklist
/sys/log/rejectdb
/lib/ndb/local
$web/etc/allow
$web/etc/passwd
$web/etc/handler
$web/etc/namespace_80
$web/etc/namespace_443
$web/bin/$objtype
$web/bin/rc