{"id":36520,"date":"2023-11-26T20:34:27","date_gmt":"2024-03-07T17:15:25","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/"},"modified":"2024-05-04T10:55:27","modified_gmt":"2024-05-04T02:55:27","slug":"%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/","title":{"rendered":"\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker"},"content":{"rendered":"<h1>\u4e3a\u4e86\u4ec0\u4e48<\/h1>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d299337434c4406c4482f\/1-0.png\" alt=\"image.png\" \/><\/div>\n<h1>\u73af\u5883<\/h1>\n<pre class=\"post-pre\"><code><span class=\"o\">[<\/span>uniqpirlo]<span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span> \/etc\/redhat-release\r\nCentOS Linux release 7.2.1511 <span class=\"o\">(<\/span>Core<span class=\"o\">)<\/span>\r\n<span class=\"o\">[<\/span>uniqpirlo]<span class=\"nv\">$ <\/span>apachectl <span class=\"nt\">-v<\/span>\r\nServer version: Apache\/2.4.6 <span class=\"o\">(<\/span>CentOS<span class=\"o\">)<\/span>\r\nServer built:   Apr 20 2018 18:10:38\r\n<span class=\"o\">[<\/span>uniqpirlo]<span class=\"nv\">$ <\/span>python3.6 <span class=\"nt\">--version<\/span>\r\nPython 3.6.4\r\n<span class=\"o\">[<\/span>uniqpirlo]<span class=\"nv\">$ <\/span>docker <span class=\"nt\">--version<\/span>\r\nDocker version 1.12.6, build 3e8e77d\/1.12.6\r\n<\/code><\/pre>\n<h1>\u6b65\u9aa4<\/h1>\n<h2>Apache\u76f8\u5173<\/h2>\n<p>\u8bbe\u5b9a\u6587\u4ef6<\/p>\n<pre class=\"post-pre\"><code>\u30fb\u30fb\u30fb\r\n&lt;Directory <span class=\"s2\">\"\/var\/www\/cgi-bin\"<\/span><span class=\"o\">&gt;<\/span>\r\n    AllowOverride None\r\n    <span class=\"c\">#Options None<\/span>\r\n    Options ExecCGI\r\n    Require all granted\r\n    AddHandler cgi-script .py\r\n&lt;\/Directory&gt;\r\n\u30fb\u30fb\u30fb\r\n<\/code><\/pre>\n<p>\u66f4\u6539\u4e0a\u8ff0\u8bbe\u7f6e\u540e\u91cd\u65b0\u542f\u52a8apache\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"o\">[<\/span>uniqpirlo]# systemctl restart httpd\r\n<\/code><\/pre>\n<p>\u5c06apache\u7528\u6237\u6dfb\u52a0\u5230docker\u7ec4\u4e2d<\/p>\n<pre class=\"post-pre\"><code><span class=\"o\">[<\/span>uniqpirlo]# usermod <span class=\"nt\">-aG<\/span> docker apache\r\n<\/code><\/pre>\n<p>\u66f4\u6539\u4e0a\u8ff0\u8bbe\u7f6e\u540e\u91cd\u65b0\u542f\u52a8Docker\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"o\">[<\/span>uniqpirlo]# systemctl restart docker\r\n<\/code><\/pre>\n<h2>Python\u76f8\u5173<\/h2>\n<p>\u8bf7\u5728\u4ee5\u4e0b\u6587\u4ef6\u5939\u4e2d\u521b\u5efaPython\u811a\u672c\uff08\u4f7f\u7528root\u7528\u6237\u6216apache\u7528\u6237\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"o\">[<\/span>uniqpirlo]<span class=\"nv\">$ <\/span><span class=\"nb\">pwd<\/span>\r\n\/var\/www\/cgi-bin\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4e86\u4ec0\u4e48 \u73af\u5883 [uniqpirlo]$ cat \/etc\/redhat-release CentOS Lin [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-36520","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528apache\u548cpython\u6765\u7ba1\u7406docker\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker\" \/>\n<meta property=\"og:description\" content=\"\u4e3a\u4e86\u4ec0\u4e48 \u73af\u5883 [uniqpirlo]$ cat \/etc\/redhat-release CentOS Lin [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528apache\u548cpython\u6765\u7ba1\u7406docker\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-07T17:15:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-04T02:55:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d299337434c4406c4482f\/1-0.png\" \/>\n<meta name=\"author\" content=\"\u6e05, \u626c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u626c\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/\",\"name\":\"\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2024-03-07T17:15:25+00:00\",\"dateModified\":\"2024-05-04T02:55:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\",\"name\":\"\u6e05, \u626c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u626c\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528apache\u548cpython\u6765\u7ba1\u7406docker\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker","og_description":"\u4e3a\u4e86\u4ec0\u4e48 \u73af\u5883 [uniqpirlo]$ cat \/etc\/redhat-release CentOS Lin [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528apache\u548cpython\u6765\u7ba1\u7406docker\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-07T17:15:25+00:00","article_modified_time":"2024-05-04T02:55:27+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d299337434c4406c4482f\/1-0.png"}],"author":"\u6e05, \u626c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u626c"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/","name":"\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2024-03-07T17:15:25+00:00","dateModified":"2024-05-04T02:55:27+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528Apache\u548cPython\u6765\u7ba1\u7406Docker"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461","name":"\u6e05, \u626c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","caption":"\u6e05, \u626c"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8apache%e5%92%8cpython%e6%9d%a5%e7%ae%a1%e7%90%86docker%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/36520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=36520"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/36520\/revisions"}],"predecessor-version":[{"id":97903,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/36520\/revisions\/97903"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=36520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=36520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=36520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}