Logo address

Installation

目次

1. get pegasus-1.2.tgz
2. unpack

	term% gunzip pegasus-1.2.tgz
	term% tar -xf pegasus-1.2.tar
then directory pegasus will be created in the directory in which you execute tar.
	term% cd pegasus
	term% cd httpd
	term% mk lib
	term% mk
The default installation place is:
	/usr/local/bin/386
Create the directory and:
	term% mk install

Creating /usr/web

The directory /usr/web is a base directory on which Pegasus configures namespace.
( You can use other directory by httpd option.)
You need not register user web to /adm/users if you do not run Pegasus as server mode.
If CGI service is not required, the following directories are enough.
	/usr/web/doc
	/usr/web/etc
	/usr/web/mnt

Where to place web documents ?

Assume your user name be bob, then
	/usr/bob/www/doc
is the recommended place.

How to configure /sys/lib/httpd.rewrite ?

This file is used for supporting virtual host and URI redirection.
Empty file is OK because you probably have no needs for that temporally.

How to configure /lib/namespace.httpd ?

You will find an example configuration
	example/lib/namespace.httpd
in the Pegasus distribution. However if you don't make CGI service,
	bind /usr/bob/www/doc /usr/web/doc
will be enough.

httpd service under listen

Let's make httpd service under listen. That is enough for small servers.
Make
	/rc/bin/service/tcp80
The content is:
	#!/bin/rc
	exec /usr/local/bin/$cputype/httpd $*
with permission:
	--rwxrwxr-x

Confirm Pegasus does service

Assume your user name is bob. Make a HTML document
	/usr/bob/www/doc/index.html
and try to access using a browser.

Access control and security

Pegasus serves only files under document root. Document root in this case is:
	/usr/bob/www/doc
Httpd will see the directory as
	/doc
Note that we have two expression for same directory.
The former is called real space and the latter service space.

Pegasus rejects to send a file that begins with period `.'.

Besides above two generic rules you can define directories that can be controlled by IP or password. The control files are in

	/usr/bob/www/etc
For details see access control.

How to support system user ?

Every user in your host are allowed to have his/her Web pages. For example, alice will have her pages simply by placing index.html in
	/usr/alice/web/doc
without changing configuration files.
Then you will find her index.html using browser with document path:
	/~alice
In alice's directory
	/usr/alice/www/etc
alice is allowed to have files for access-control to her web document.
Note that these directries are also seen by httpd as /doc and /etc respectively.
That is the distinct feature of Pegasus.