

Installation
目次- 1.0.0 Creating
/usr/web
- 2.0.0 Where to place web documents ?
- 3.0.0 How to configure
/sys/lib/httpd.rewrite
? - 4.0.0 How to configure
/lib/namespace.httpd
? - 5.0.0 httpd service under
listen
- 6.0.0 Confirm Pegasus does service
- 7.0.0 Access control and security
- 8.0.0 How to support system user ?
1. get pegasus-1.2.tgz
2. unpack
term% gunzip pegasus-1.2.tgz term% tar -xf pegasus-1.2.tarthen directory
pegasus
will be created in the directory in which you execute tar
.term% cd pegasus term% cd httpd term% mk lib term% mkThe default installation place is:
/usr/local/bin/386Create 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 bebob
, then/usr/bob/www/docis 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 configurationexample/lib/namespace.httpdin the Pegasus distribution. However if you don't make CGI service,
bind /usr/bob/www/doc /usr/web/docwill be enough.
httpd service under listen
Let's make httpd service under listen
. That is enough for small servers.Make
/rc/bin/service/tcp80The content is:
#!/bin/rc exec /usr/local/bin/$cputype/httpd $*with permission:
--rwxrwxr-x
Confirm Pegasus does service
Assume your user name isbob
. Make a HTML document/usr/bob/www/doc/index.htmland 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/docHttpd will see the directory as
/docNote 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/etcFor 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/docwithout changing configuration files.
Then you will find her index.html using browser with document path:
/~aliceIn alice's directory
/usr/alice/www/etcalice 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.