{"id":347,"date":"2010-12-13T22:04:45","date_gmt":"2010-12-13T13:04:45","guid":{"rendered":"https:\/\/deskplate.net\/blog\/2010\/12\/13\/mod_python-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%83%a1%e3%83%a2\/"},"modified":"2010-12-13T22:04:45","modified_gmt":"2010-12-13T13:04:45","slug":"mod_python-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%83%a1%e3%83%a2","status":"publish","type":"post","link":"https:\/\/deskplate.net\/blog\/archives\/347","title":{"rendered":"mod_python \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2"},"content":{"rendered":"<p># yum install python-devel<br \/>\n# wget http:\/\/archive.apache.org\/dist\/httpd\/modpython\/mod_python-3.3.1.tgz<br \/>\n# tar xvzf mod_python-3.3.1.tgz<br \/>\n# cd mod_python-3.3.1<br \/>\n# cp -p src\/connobject.c src\/connobject.c.org<br \/>\n# grep &#8216;APR_BRIGADE_SENTINEL(b)&#8217; src\/connobject.c<br \/>\n# echo &#8220;APR_BRIGADE_SENTINEL(b)&#8221; | sed &#8216;s\/APR_BRIGADE_SENTINEL(b)\/APR_BRIGADE_SENTINEL(bb)\/&#8217;<br \/>\n# sed -i &#8216;s\/APR_BRIGADE_SENTINEL(b)\/APR_BRIGADE_SENTINEL(bb)\/&#8217; src\/connobject.c<br \/>\n# diff src\/connobject.c src\/connobject.c.org<br \/>\n# which python<br \/>\n# .\/configure &#8211;with-python=\/usr\/bin\/python &#8211;with-apxs=\/usr\/local\/apache2\/bin\/apxs<br \/>\n# make<br \/>\n# make instal<br \/>\nhttpd.conf\u306b\u8ffd\u52a0<br \/>\nLoadModule python_module modules\/mod_python.so<br \/>\n# mod_python test<br \/>\n<Directory \/usr\/local\/apache2\/htdocs\/test><br \/>\nAddHandler mod_python .py<br \/>\nPythonHandler mptest<br \/>\nPythonDebug On<br \/>\n<\/Directory><br \/>\n\/usr\/local\/apache2\/htdocs\/test\/mptest.py\u306b\u4ee5\u4e0b\u3092\u8a18\u8ff0<br \/>\nfrom mod_python import apache<br \/>\ndef handler(req):<br \/>\nreq.write(&#8220;Hello World!&#8221;)<br \/>\nreturn apache.OK<br \/>\n\u30d6\u30e9\u30a6\u30b6\u3067\/test\/mptest.py\u3078\u30a2\u30af\u30bb\u30b9\u3002\u300cHello World!\u300d\u3068\u8868\u793a\u3055\u308c\u308c\u3070mod_python\u306e\u57fa\u672c\u52d5\u4f5c\u78ba\u8a8d\u306f\u5b8c\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"<p># yum install python<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,6],"tags":[],"class_list":["post-347","post","type-post","status-publish","format-standard","hentry","category-apache","category-linux"],"_links":{"self":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts\/347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":0,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"wp:attachment":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}