7月14日(火・1)
ps -x でプロセスを確認netstat -an | grep LISTEN で、8080ポートが LISTEN 状態にあることを確認$ cd $ cd www/htdocs $ ls $ touch test.html
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>テスト</title> </head> <body> <h1>テスト</h1> こんにちは、私の名前は○山×男です。 </body> </html>
$ tail ~/www/logs/access_log 127.0.0.1 - - [22/Jul/2008:08:50:30 +0900] "GET /test.html HTTP/1.1" 200 215
$ telnet localhost 8080 Connected to localhost. Escape character is '^]'. GET /test.html HTTP/1.0 HTTP/1.1 200 OK Date: ...
$ chmod -r test.htmlchmod +r test.html で戻しておくGET /../ HTTP/1.0DELETE /test.html HTTP/1.0HOGE / HTTP/1.0/ (スラッシュ) が最後に付く URI へリダイレクトするOptions Indexes が指定されていると、そのディレクトリの一覧が返される$ mkdir testhttp://localhost:8080/test を開く -> 最後に / が付くことを確認304 - が記録されるcd ~/www/cgi-bin して、chmod +x test.pyhttp://localhost:8080/cgi-bin/test.py にブラウザでアクセスimport cgireq = cgi.FieldStorage() で、req オブジェクトに QUERY_STRING その他を読み込むreq.getvalue("who") で QUERY_STRING から who を取り出す