Pegasus 2.3
目次- 1.0.0 More directories in $web
- 1.1.0 What was a problem?
- 1.2.0 Example
- 2.0.0 CGI timeout for each CGI
- 2.1.0 What was a problem?
- 2.2.0 Example 1
- 2.3.0 Example 2
- 3.0.0 New option for hfmt
- 3.1.0 What was a problem?
- 3.2.0 Example
Last Update: 2006/12/18
Bug fix and new features.
The source is in http://plan9.aichi-u.ac.jp/netlib/
This page describes only the new feature. Basic features are unchanged. Look Pegasus 2.2 documents for more detail.
More directories in $web
What was a problem?
Let's $web be httpd root for Pegasus.We had restriction that only three directories "bin", "etc" and "doc" can be added in $web. Now the restriction has been removed.
Pegasus 2.3 internally executes (in rc notation)
bind -a $web /usr/web
Therefore, remove empty directory "/usr/web/doc"
Example
Now we can locate a private files such as users information for a web service as following$web/usersthen the file "users" is outside of document root, and therefore only accessible via CGI.
CGI timeout for each CGI
What was a problem?
Some CGIs take much time to complete the task. The time is CGI dependent.Therefore I enabled dynamical resetting of CGI timeout for each CGI.
A environment variable "hpid" is introduced for this purpose.
The "pid" is that of Pegasus in service.
Example 1
In starting service, executeecho -n timeout 180 > /proc/$hpid/notewhich will reset CGI timeout to 180 seconds.
Example 2
The example below written in Python is extracted from a script on my server.def settimeout(n): note="/proc/%d/note"%hpid f=open(note, "w") if f==None: print "unable to open %s"%note print "timeout is not set" return f.write("timeout %d"%n) f.close() e=os.environ hpid=0 if e.has_key("hpid"): hpid=int(e["hpid"]) if hpid: settimeout(180) # continues heavy loaded tasks
New option for hfmt
New option "-x" is added to a CGI tool "hfmt" so that non-ascii runes in path name can be converted to %HH format.What was a problem?
Microsoft IE sometimes fails to handle UTF-8 encoded path name in href value.Example
The following code in rit scrit will produce local references to all files in the current directory.<pre>${ ls | hfmt -x '<a href="%U">%H</a>' 1 1}</pre>