﻿{"id":127,"date":"2013-09-16T13:43:36","date_gmt":"2013-09-16T05:43:36","guid":{"rendered":"http:\/\/blog.sway.com.cn\/?p=127"},"modified":"2013-09-16T19:08:13","modified_gmt":"2013-09-16T11:08:13","slug":"centos-yum%e5%ae%89%e8%a3%85lighttpd%e9%99%84%e5%b8%a6php%e5%92%8cmysql%e6%94%af%e6%8c%81","status":"publish","type":"post","link":"http:\/\/blog.sway.com.cn\/?p=127","title":{"rendered":"CentOS yum\u5b89\u88c5Lighttpd\u9644\u5e26PHP\u548cMySQL\u652f\u6301"},"content":{"rendered":"<h1>\u4e00\u3001\u5b89\u88c5lighttpd<\/h1>\n<p>\u7531\u4e8eCentOS\u5b98\u65b9\u7684\u6e90\u4e2d\u6ca1\u6709Lighttpd\u5305\uff0c\u56e0\u6b64\u9700\u8981\u624b\u52a8\u5bfc\u5165RPMforge\u6e90:<\/p>\n<p>\u5982\u679c\u4f60\u662f64\u4f4d\u7684\u7cfb\u7edf\uff1a<\/p>\n<pre class=\"lang:sh decode:true\">wget http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm\r\nrpm -Uvh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm<\/pre>\n<p>\u5982\u679c\u662f32\u4f4d\u7cfb\u7edf\uff1a<\/p>\n<pre class=\"lang:sh decode:true\">wget http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.2-2.el5.rf.i386.rpm\r\nrpm -Uvh rpmforge-release-0.5.2-2.el5.rf.i386.rpm<\/pre>\n<p>\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u50cf\u8fd9\u6837\u5b89\u88c5Lighttpd\uff1a<\/p>\n<pre class=\"lang:sh decode:true\">yum install lighttpd<\/pre>\n<p>\u63a5\u7740\u6211\u4eec\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8lighttpd\u5e76\u7acb\u5373\u542f\u52a8\u5b83\uff1a<\/p>\n<pre class=\"lang:sh decode:true\">chkconfig --levels 235 lighttpd on\r\n\/etc\/init.d\/lighttpd start<\/pre>\n<h2>\u00a0\u95ee\u98981\uff1a<\/h2>\n<p>\u5982\u679c\u5728\u542f\u52a8\u7684\u65f6\u5019\u63d0\u793a\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n<pre class=\"lang:sh decode:true\">(network.c.203) socket failed: Address family not supported by protocol<\/pre>\n<p>\u5219\u6253\u5f00 <i>\/etc\/lighttpd\/lighttpd.conf<\/i> \u6587\u4ef6\uff0c\u627e\u5230server.use-ipv6\u4e00\u884c\u914d\u7f6e\u8282\uff0c\u5c06enable\u6539\u4e3adisable\uff0c\u57fa\u672c\u4e0a\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\u3002<\/p>\n<p>\u95ee\u98982\uff1a<\/p>\n<p>\u5982\u679c\u542f\u52a8\u65f6\u51fa\u73b0\u5982\u4e0b\u9519\u8bef\uff1acouldn\u2019t set \u2018maxfiledescriptors\u2019 Operation not permitted<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n<p>1\uff09\u5173\u95edselinux\uff1a<\/p>\n<pre class=\"lang:sh decode:true\"># vi \/etc\/selinux\/config<\/pre>\n<p>\u5c06SELINUX=enforcing\u6539\u4e3aSELINUX=disabled\u540e\u91cd\u542f\u3002<\/p>\n<p>2\uff09\u521b\u5efa\u4e00\u4e2aselinux\u6a21\u5757\u5141\u8bb8lighttpd\u6709\u6743\u9650\u8bbe\u7f6efiledescriptor\u9650\u5236<\/p>\n<pre class=\"lang:sh decode:true\"># \/usr\/sbin\/semodule -DB\r\n# service auditd restart\r\n# service lighttpd restart<\/pre>\n<p>\u95ee\u9898\u89e3\u51b3\uff01\u95ee\u9898\u51fa\u73b0\u539f\u56e0\uff1a\u56e0\u4e3a\u4f7f\u7528root\u6743\u9650\u767b\u5f55\u7684CentOS\uff0c\u6240\u4ee5\u4e0d\u5b58\u5728\u6743\u9650\u7684\u95ee\u9898\uff0c\u5176\u5b9e\u662fselinux\u9650\u5236\u4e86\u7a0b\u5e8f\u8bbe\u7f6e\u6700\u5927\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0c\u5173\u95ed\u9650\u5236\u540e\u5c31\u53ef\u4ee5\u91cd\u542f<\/p>\n<p>&nbsp;<\/p>\n<h1>\u4e8c\u3001\u6dfb\u52a0php\u652f\u6301<\/h1>\n<pre class=\"lang:sh decode:true\">yum install lighttpd-fastcgi php-cli<\/pre>\n<p>\u5b89\u88c5\u597d\u5bf9\u5e94\u7684fastcgi\u4ee5\u53caphp\u6a21\u5757\u540e\u5bf9lighttpd\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<p>1 \u3001\u6253\u5f00 \/etc\/php.ini \u6587\u4ef6<\/p>\n<p>\u5728\u6587\u4ef6\u7684\u6700\u540e\uff08END\u524d\uff09\u6dfb\u52a0\u4e00\u53e5<\/p>\n<pre class=\"lang:sh decode:true\">cgi.fix_pathinfo = 1<\/pre>\n<p>2\u3001\u6253\u5f00 \/etc\/lighttpd\/modules.conf \u6587\u4ef6<\/p>\n<p>\u5c06 include \u201cconf.d\/fastcgi.conf\u201d \u4e00\u884c\u53d6\u6d88\u6ce8\u91ca\u5e76\u4fdd\u5b58<\/p>\n<p>3\u3001\u6253\u5f00 \/etc\/lighttpd\/conf.d\/fastcgi.conf \u6587\u4ef6<\/p>\n<p>\u627e\u5230 fastcgi.server\u8fd9\u4e00\u8282\u914d\u7f6e\u6bb5\uff0c\u5e76\u5c06\u5176\u5168\u90e8\u53cd\u6ce8\u91ca\uff08\u4f7f\u4e4b\u751f\u6548\uff09\uff0c\u5e76\u4fee\u6539\u4e3a\u5982\u4e0b\uff08\u6ce8\u610f\u7ea2\u8272\u4e3a\u4fee\u6539\u90e8\u5206\uff09\uff1a<\/p>\n<pre class=\"lang:default mark:4-5,20-21 decode:true\">fastcgi.server = ( \u201c.php\u201d =&gt;\r\n( \u201cphp-local\u201d =&gt;\r\n(\r\n\u201csocket\u201d =&gt; \u201c\/tmp\/php-fastcgi-1.socket\u201c,\r\n\u201cbin-path\u201d =&gt; \u201c\/usr\/bin\/php-cgi\u201c,\r\n\u201cmax-procs\u201d =&gt; 1,\r\n\u201cbroken-scriptfilename\u201d =&gt; \u201cenable\u201d,\r\n)\r\n),\r\n( \u201cphp-tcp\u201d =&gt;\r\n(\r\n\u201chost\u201d =&gt; \u201c127.0.0.1\u2033,\r\n\u201cport\u201d =&gt; 9999,\r\n\u201ccheck-local\u201d =&gt; \u201cdisable\u201d,\r\n\u201cbroken-scriptfilename\u201d =&gt; \u201cenable\u201d,\r\n)\r\n),\r\n( \u201cphp-num-procs\u201d =&gt;\r\n(\r\n\u201csocket\u201d =&gt; \u201c\/tmp\/php-fastcgi-2.socket\u201c,\r\n\u201cbin-path\u201d =&gt; \u201c\/usr\/bin\/php-cgi\u201c,\r\n\u201cbin-environment\u201d =&gt; (\r\n\u201cPHP_FCGI_CHILDREN\u201d =&gt; \u201c16\u2033,\r\n\u201cPHP_FCGI_MAX_REQUESTS\u201d =&gt; \u201c10000\u2033,\r\n),\r\n\u201cmax-procs\u201d =&gt; 5,\r\n\u201cbroken-scriptfilename\u201d =&gt; \u201cenable\u201d,\r\n)\r\n),\r\n)<\/pre>\n<p>\u6700\u540e\u4fdd\u5b58\u5373\u53ef\u3002<\/p>\n<p>\u73b0\u5728\u53ef\u4ee5\u91cd\u542fLighttpd\u4f7f\u4e4b\u751f\u6548\uff1a<\/p>\n<pre class=\"lang:sh decode:true\"># \/etc\/init.d\/lighttpd restart<\/pre>\n<p>\u4e09\u3001\u6dfb\u52a0php\u5bf9mysql\u7684\u652f\u6301<\/p>\n<pre class=\"lang:sh decode:true\">yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc<\/pre>\n<p>\u4e0a\u8ff0\u547d\u4ee4\u5df2\u7ecf\u540c\u65f6\u5b89\u88c5\u597d\u4e86php\u7684MySQL\u3001GD\u56fe\u5f62\u5e93\u3001IMAP\u3001ODBC\u3001Pear\u3001xml\u7b49\u652f\u6301\u7ec4\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5b89\u88c5lighttpd \u7531\u4e8eCentOS\u5b98\u65b9\u7684\u6e90\u4e2d\u6ca1\u6709Lighttpd\u5305\uff0c\u56e0\u6b64\u9700\u8981\u624b\u52a8\u5bfc\u5165RPMforge\u6e90 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-lighttpd"],"_links":{"self":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=127"}],"version-history":[{"count":6,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":140,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions\/140"}],"wp:attachment":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}