Sean Hincheeinitial push75d07b48 years agoHistory
341 lines · 3.9 KB · HTML
RawDownload
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />	<meta name="keywords" content="9p, 9p2000, research, Plan 9, Inferno, Unix, Open Source, Bell Labs" />	<meta name="description" content="Open source distributed operating system Plan 9 from Bell Labs." />	<link rel="stylesheet" href="/wiki-style.css" media="all" type="text/css" />	<title>web_server (Plan 9 wiki)</title></head><body><h1><a name="top"></a>web_server</h1> <div class='body'> <!-- ***************************** --> ThePlan9webserver<a href="http://plan9.bell-labs.com/magic/man2html/8/httpd"><i>httpd</i>(8)</a>hassomeinterestingfeatures.ItalsokeptmescratchingmyheadalldaygettingitgoingsoIthoughtI'dshareafewthings.<p class='para'>Whenthehttpdrunsitsetsitselftouser"none"andruns<a href="http://plan9.bell-labs.com/magic/man2html/2/newns"><i>newns</i>(2)</a>andthen<a href="http://plan9.bell-labs.com/magic/man2html/2/addns"><i>addns</i>(2)</a>usingthenamespaceprovidedonthecommandline(or/lib/namespace.httpdifyoudidn'tgiveita-n).Thismeansthatwhateveryousupplyforthenamespacefilehastoexistinthenewnamespace.ip/httpd/httpd-n/cfg/$sysname/namespace.httpdwasmysolution.</p> <p class='para'>WhileexperimentingIhadtheproblemofhowtokillaprocessownedbynone,here'showtodoit:</p> <pre>p = `{ps | grep httpd}chmod 777 /proc/$p(2) ^/note &amp;&amp; echo kill &gt; /proc/$p(2) ^/note</pre> <p class='para'>I'massumingonlyoneprogramcalledhttpdisrunning,ofcourse.</p> <p class='para'>Forextrafunip/httpd/mirrorwasmissingfrommydistribution(Sept07)andIdidn'tnoticeforages.</p> <p class='para'>momohereisaUnixboxrunningu9fs-anoneandI'musingaterminaltoplayonsotermrcitis</p> <p class='para'>cat/cfg/$sysname/termrc</p> <pre>fn start_httpd {	rfork	bind /n/momo/home/plan9/httpd /usr	bind /usr/httpd.rewrite /sys/lib/httpd.rewrite	ip/httpd/httpd -n /cfg/$sysname/namespace.httpd} 9fs momo start_httpd &amp;</pre> <p class='para'>Thefolder/n/momo/home/plan9/httpdhasinit:</p> <pre>bin/web/httpd.rewrite</pre> <p class='para'>cat/cfg/$sysname/namespace.httpd</p> <pre>mount /srv/momo /n/momobind /n/momo/home/plan9/httpd/bin /bin/ip/httpd</pre> <p class='para'>Sonowmy/magic/filesarekeptonmomosoIdon'tpollute/bin/ip/httpd</p> <p class='para'>Ialsofoundabugwithvhostsandsubmitteda<a href="http://plan9.bell-labs.com/magic/man2html/1/patch"><i>patch</i>(1)</a>httpd-post-portbecausevhostsrunningonnon-defaultportwereimpossibleasthe:portwasbeingstrippedwhenthevhostswereparsedbutnotwhenmatchinghttprequests.Leavingthe:portonisthecorrectbehaviouraccordingtoRFC261614.23.</p>  </div> <!-- ***************************** --> <hr class='banner_sep' /> <div class='banner'><ul>	<li><a href="../plan_9_wiki/">Wiki</a></li>	<li><a href="../Documentation/">Docs</a></li>	<li><a href="../news/">News</a></li>	<li><a href="../development/">Devel</a></li>	<li><a href="../papers/">Papers</a></li>	<li><a href="../download/">Download</a></li> </ul></div> <hr class='footer_sep' /> <div class='footer'><a href="history.html">History</a> -<a href="diff.html">Diff</a> - <a href="#top">Top of this page</a> -<span class='last_mod'>Last modified Mon Oct 13 13:45:39 EDT 2008</span> <br />	<div class='about_wiki'><a href="http://plan9.bell-labs.com/plan9"><img align="middle" src="http://plan9.bell-labs.com/plan9/img/power36.gif" alt="Powered by Plan 9" /></a>	<a href="../about.html">About this Wiki</a>	</div>  </div> </body></html>	<!-- <a href="http://plan9.bell-labs.com/plan9dist/glenda.html"><img align="middle" src="http://plan9.bell-labs.com/plan9dist/img/9logo.jpg" alt="Glenda" /></a> -->

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t