#!/bin/rc if(~ $1 v){ peep $0 exit } cat<<-eof-
I mean by the word `user':
$$home/web
pegasus.aichi-u.ac.jp
is one of virtual hosts of this
server. It is defined in /sys/lib/httpd.rewrite
:
http://pegasus */usr/pegasus/www
First of all, I would like to notice you that this is a CGI program of Pegasus. You can look the code. click
ls -l /
-eof- ls -l / cat<<-eof-This name space is configured in the file:
/lib/namespace.httpd
.
User can merge his/her files (in `afer' mode of bind) to the directories provided by the server administrator.
Directories /doc
and /etc
are very special.
They are provide by the user.
Each user has these two directories and they are hided from other users.
(Even if these direcories have already provided by system administrator,
they are replaced by users one.)
Directory /doc
is the document root of each user, and
some files in /etc
controls access
or redirects the request to his/her web page.
/doc
Let's look directories under the document root.
ls -l /doc
The output is:
-eof- ls -l /doc cat<<-eof-Note that they are directories of this home page.
There are some other home pages in our server. All of their document root have a same
name
/doc
. However you can't see them in this name space. They are hidden!
It is a power of Plan9/Pegasus.
/etc
. In this directory user can have some files such as passwd
, allow
and rewrite
to control accesses or redirect requests to his/her web pages.
-eof- ls -l /etc cat<<-eof-
/lib/namespace.httpd
.The directories:
-eof- ls -l / |grep sys cat<<-eof-came from:
/usr/web/*
On the other hands the directories:
-eof- ls -l /|grep -v sys cat<<-eof-came from:
/usr/pegasus/www/*
These directories are mixed in the name space of http service.
Note that virtual host pegasus is one of users of this server.
You will see similar result for other users.
Name space of official home page is organized in /lib/namespace.httpd
. The real document root can be located anywhere.
Home page of virtual host is assigned in
/sys/lib/httpd.rewrite
.
This file defines the rule to translate URI to URI so that the server can redirect the request from the clients.
You can find the line in the file:
http://pegasus */usr/pegasus
The line with *
in the beginning of second field is special.
Such a line defines the location of directory for virtual host in real name space.
User's home directory in URI is conventionally expressed like:
/~alice
where alice
stands for any user of httpd server.
A user who has a directory named web/doc
under his/her home directory
can have his/her home page. The directory automatically becomes a home page without any configuration in system file such as
/lib/namespace.httpd
nor /sys/lib/httpd.rewrite.
Thus, user alice
who has:
/usr/alice/web/doc/index.html
have her home page, and the page will be seen as
/doc/index.html
in the name space of http service
see this script
-eof-