{"id":28796,"date":"2023-06-30T15:25:45","date_gmt":"2023-04-26T04:53:53","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/"},"modified":"2025-08-12T10:08:45","modified_gmt":"2025-08-12T02:08:45","slug":"%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/","title":{"rendered":"\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883"},"content":{"rendered":"<h1>\u5b89\u88c5\u8f6f\u4ef6\u5305<\/h1>\n<pre class=\"post-pre\"><code>yum <span class=\"nb\">install <\/span>httpd php php-mysqlnd mariadb-server\r\n<\/code><\/pre>\n<h2>httpd \u662f\u4e00\u79cd\u7528\u4e8e\u642d\u5efa\u7f51\u9875\u670d\u52a1\u5668\u7684\u8f6f\u4ef6\uff0c\u800c php \u5219\u662f\u4e00\u79cd\u5e38\u7528\u7684\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00\u3002<\/h2>\n<pre class=\"post-pre\"><code><span class=\"nb\">mkdir<\/span> <span class=\"nt\">-p<\/span> \/var\/log\/httpd\/\r\n<span class=\"nb\">mkdir<\/span> <span class=\"nt\">-p<\/span> \/var\/www\/html\/\r\n<span class=\"nb\">echo<\/span> <span class=\"s2\">\"&lt;?php echo 'hoge'; ?&gt;\"<\/span> <span class=\"o\">&gt;<\/span> \/var\/www\/html\/index.php\r\n\r\napachectl <span class=\"nt\">-S<\/span>\r\nsystemctl start httpd\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>systemctl <span class=\"nb\">enable <\/span>httpd\r\n<\/code><\/pre>\n<h2>MariaDB<\/h2>\n<pre class=\"post-pre\"><code>  [mysqld]\r\n<span class=\"gi\">+ character-set-server = utf8\r\n<\/span><\/code><\/pre>\n<pre class=\"post-pre\"><code>systemctl start mariadb\r\nsystemctl <span class=\"nb\">enable <\/span>mariadb\r\nmysql <span class=\"nt\">-uroot<\/span>\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>MariaDB <span class=\"o\">[(<\/span>none<span class=\"o\">)]&gt;<\/span> status\r\n...\r\nServer characterset:    utf8\r\nDb     characterset:    utf8\r\nClient characterset:    utf8\r\nConn.  characterset:    utf8\r\n...\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5\u8f6f\u4ef6\u5305 yum install httpd php php-mysqlnd mariadb-server  [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-28796","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"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>\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883\u7684\u6280\u672f\u6587\u7ae0\" \/>\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\/\u5728lxc\u7684centos7\u4e0a\u521b\u5efalamp\u73af\u5883\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728lxc\u7684centos7\u4e0a\u521b\u5efalamp\u73af\u5883\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-26T04:53:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T02:08:45+00:00\" \/>\n<meta name=\"author\" content=\"\u65b0, \u97f5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u65b0, \u97f5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/\",\"name\":\"\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-26T04:53:53+00:00\",\"dateModified\":\"2025-08-12T02:08:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\"},\"description\":\"\u5173\u4e8e\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883\"}]},{\"@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\/4ba4019495123db3038fd0809e6959c9\",\"name\":\"\u65b0, \u97f5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"caption\":\"\u65b0, \u97f5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883 - Blog - Silicon Cloud","description":"\u5173\u4e8e\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883\u7684\u6280\u672f\u6587\u7ae0","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\/\u5728lxc\u7684centos7\u4e0a\u521b\u5efalamp\u73af\u5883\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883","og_description":"\u5173\u4e8e\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728lxc\u7684centos7\u4e0a\u521b\u5efalamp\u73af\u5883\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-26T04:53:53+00:00","article_modified_time":"2025-08-12T02:08:45+00:00","author":"\u65b0, \u97f5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u65b0, \u97f5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/","name":"\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-26T04:53:53+00:00","dateModified":"2025-08-12T02:08:45+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9"},"description":"\u5173\u4e8e\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728LXC\u7684CentOS7\u4e0a\u521b\u5efaLAMP\u73af\u5883"}]},{"@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\/4ba4019495123db3038fd0809e6959c9","name":"\u65b0, \u97f5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","caption":"\u65b0, \u97f5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8lxc%e7%9a%84centos7%e4%b8%8a%e5%88%9b%e5%bb%balamp%e7%8e%af%e5%a2%83%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\/28796","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\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=28796"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28796\/revisions"}],"predecessor-version":[{"id":56519,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28796\/revisions\/56519"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=28796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=28796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=28796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}