回答編集履歴
1
edit
test
CHANGED
@@ -7,3 +7,43 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
やりたいことの意図がわからないので、的外れかもしれませんが。
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
---
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
https://anopara.net/2013/12/11/ubuntulubuntu13-04でpythonwsgiapacheのhelloworld/
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
`index.cgi`
|
22
|
+
|
23
|
+
```python
|
24
|
+
|
25
|
+
#!/home/ユーザーID/.pyenv/versions/3.4.2/bin/python
|
26
|
+
|
27
|
+
from wsgiref.handlers import CGIHandler
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
def application(environ, start_response):
|
32
|
+
|
33
|
+
status = '200 OK'
|
34
|
+
|
35
|
+
output = 'Hello World!\n'
|
36
|
+
|
37
|
+
response_headers = [('Content-type', 'text/plain'),
|
38
|
+
|
39
|
+
('Content-Length', str(len(output)))]
|
40
|
+
|
41
|
+
start_response(status, response_headers)
|
42
|
+
|
43
|
+
return [output]
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
CGIHandler().run(application)
|
48
|
+
|
49
|
+
```
|