{"id":78,"date":"2009-11-02T22:05:31","date_gmt":"2009-11-02T22:05:31","guid":{"rendered":"http:\/\/www.huzs.top\/?p=78"},"modified":"2009-11-02T22:05:31","modified_gmt":"2009-11-02T22:05:31","slug":"78","status":"publish","type":"post","link":"https:\/\/www.huzs.top\/?p=78","title":{"rendered":"\u3010Linux\u670d\u52a1\u5668\u914d\u7f6e\u3011yum\u5b89\u88c5WEB\u670d\u52a1\u5668&#124;LAMP v1.1"},"content":{"rendered":"<p style=\"text-align: center;\"><strong><span style=\"font-size: 24px;\">yum\u5b89\u88c5Linux+apache+Mysql+PHP\u8be6\u7ec6\u914d\u7f6e<\/span><\/strong><\/p>\n<p>\\n<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"font-size: 24px;\">\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d<\/span><\/strong><br \/>\\n&nbsp;&nbsp;<\/p>\n<p>\\n<\/p>\n<p>&nbsp;\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d<\/p>\n<p>\\n<\/p>\n<p>&nbsp;#\u4e3a\u4e86\u907f\u514d\u51fa\u9519\uff0c\u5148\u5173\u6389\u9632\u706b\u5899\uff1aservice iptables stop\u6216\/etc\/init.d\/iptables stop<\/p>\n<p>\\n<\/p>\n<p>\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d<\/p>\n<p>\\n<\/p>\n<p><strong>\u4f7f\u7528\u4e00\u4e0b\u547d\u4ee4\u4e0b\u8f7d\u5e76\u5b89\u88c5Linux+apache+Mysql+PHP\u3002<\/strong><br \/>\\n&nbsp;yum install httpd mysql-server php php-devel php-mysql php-mbstring php-mcrypt php-gd<br \/>\\n<strong>\u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u8fd0\u884c\u670d\u52a1<\/strong><br \/>\\nchkconfig &#8211;level 235 httpd on<br \/>\\nchkconfig &#8211;level 235 mysqld on<br \/>\\n<strong>\u73b0\u5728\u8fd0\u884cHTTP\u548c\u6570\u636e\u5e93\u670d\u52a1<\/strong><br \/>\\nservice httpd start<br \/>\\nservice mysqld start<\/p>\n<p>\\n<\/p>\n<p>\\n\u4e0b\u9762\u8fd9\u4e9b\u90fd\u662f\u91cd\u8981\u7684\u914d\u7f6e\u6587\u4ef6\u6216\u4f4d\u7f6e<br \/>\\n<strong>apache\u7684<\/strong><br \/>\\n&nbsp;\/etc\/httpd\/conf\/httpd.conf<br \/>\\n\/var\/www\/html\/<br \/>\\n\/var\/www\/error\/<br \/>\\n\/var\/log\/httpd\/<br \/>\\n\u521d\u6b65\u914d\u7f6e\uff1avi&nbsp; \/etc\/httpd\/conf\/httpd.conf<br \/>\\n1\u3001\u4fee\u6539 ServerName <strong>localhost<\/strong>:80<br \/>\\n2\u3001\u4fee\u6539 DirectoryIndex \u6dfb\u52a0\u51e0\u4e2a\u9ed8\u8ba4\u6587\u6863\u5982<strong>index.htm<\/strong>\u548c<strong>index.php<\/strong><br \/>\\n3\u3001\u4fee\u6539 AddDefaultCharset <strong>GB2312<\/strong><br \/>\\n<br \/>\\n<strong>MySQL\u7684<\/strong><br \/>\\n\/etc\/my.cnf<br \/>\\n\/var\/lib\/mysql\/   \u6570\u636e\u5e93\u653e\u7f6e\u4f4d\u7f6e<br \/>\\n\u5f00\u542fMySQL\u7684\u670d\u52a1\u3002\u65b9\u6cd51\u3001service mysqld start\u3000\u3000\u65b9\u6cd52\u3001\/etc\/init.d\/mysqld start<br \/>\\n\u6d4b\u8bd5MYSQL\u8fd0\u884c\u662f\u5426\u6b63\u5e38<br \/>\\n[root@CentOS-Josen cache]# netstat -tuln | grep &#8216;:3306&#8217;<br \/>\\ntcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN     <br \/>\\n\u8fdb\u5165mysql,\u7b2c\u4e00\u6b21\u8fdb\u5165\u4e0d\u9700\u8981\u5bc6\u7801\uff0c\u7136\u540e\u8bbe\u7f6e\u5bc6\u7801<br \/>\\nmysql -u root &nbsp;\u7136\u540e\u9000\u51faquit<br \/>\\nmysqladmin -u root password &#8216;yourpassword&#8217;<br \/>\\n\u7528\u521a\u624d\u8bbe\u7f6e\u7684\u5bc6\u7801\u8fdb\u5165:mysql -u root &nbsp;-p<\/p>\n<p>\\n<\/p>\n<p>\u8ba9\u4e0d\u540c\u7684\u7528\u6237\u7ba1\u7406\u4e0d\u540c\u7684\u6570\u636e\u5e93(\u4f8b\u5982\uff1a\u7528\u6237testdb\u7ba1\u7406testdb\u7528\u6237)<br \/>\\n<span style=\"color: rgb(255, 0, 0);\">[\u6ce8\u610f\uff0c\u8fdb\u5165\u6570\u636e\u5e93\u540e\uff0c\u6240\u6709\u547d\u4ee4\u540e\u9762\u5fc5\u987b\u8ddf\u4e00\u4e2a\u5206\u53f7\uff0c\u5426\u5219\u64cd\u4f5c\u65e0\u6548\u5e76\u62a5\u9519\uff01]<\/span><br \/>\\nmysql&gt;create database testdb;<br \/>\\nmysql&gt;grant all privileges on testdb.* to testdb@localhost indentified by &#8216;yourpassword&#8217;;<br \/>\\n\u6d4b\u8bd5\u4e00\u4e0b\uff1a\u7528testdb\u8fdb\u5165\u6570\u636e\u5e93\uff1amysql -u testdb -p &nbsp; &nbsp; \u8fdb\u53bb\u540e\u7528\uff1amysql&gt;show databases;\u770b\u662f\u5426\u6709\u6570\u636e\u5e93<br \/>\\n<br \/>\\n<br \/>\\n<strong>PHP\u7684<\/strong>\u914d\u7f6e\u6587\u4ef6\u548c\u6d4b\u8bd5<br \/>\\n\/usr\/lib\/httpd\/modules\/libphp4.so<br \/>\\n\/etc\/httpd\/conf.d\/php.conf<br \/>\\n\/etc\/php.ini<br \/>\\n\/etc\/hphp.d\/mysql.ini \/usr\/lib\/php4\/mysql.so<\/p>\n<p>\\n<\/p>\n<p>vi \/var\/www\/html\/info.php<br \/>\\n&lt;?php<br \/>\\nphpinfo();<br \/>\\n?&gt;<\/p>\n<p>\\n<\/p>\n<p>&nbsp;<\/p>\n<p>\\n<\/p>\n<p><strong><span style=\"font-size: 20px;\">\u5b89\u88c5phpmyadmin<\/span><\/strong>(php5.2+\u624d\u80fd\u4f7f\u7528phpMyAdmin3)<br \/>\\n\u4e0b\u8f7dphpmyadmin\u5305\uff1ahttp:\/\/www.phpmyadmin.net\/home_page\/downloads.php<br \/>\\nwget http:\/\/nchc.dl.sourceforge.net\/project\/phpmyadmin\/phpMyAdmin\/2.11.10\/phpMyAdmin-2.11.10-all-languages.tar.gz<br \/>\\n<br \/>\\n\u7136\u540e\u89e3\u538b tar zxvf phpmyadmin*.tar.gz<br \/>\\n\u6539\u540d( mv phpMyAdmin-3.3.0-all-languages phpmyadmin)\u5e76\u653e\u5230\/var\/www\/html\/phpmyadmin<br \/>\\n\u62f7\u8d1d\u914d\u7f6e\u6587\u4ef6phpmyadmin\/libraries\/config.default.php \u5230phpmyadmin\/config.inc.php<br \/>\\nvi \/var\/www\/html\/phpmyadmin\/config.inc.php<br \/>\\n&nbsp;1\u3001$cfg[&#8216;PmaAbsoluteUri&#8217;] = &#8216;http:\/\/192.168.1.6\/phpmyadmin\/&#8217;;<br \/>\\n2\u3001\u67e5\u627e $cfg[&#8216;Servers&#8217;][$i][&#8216;password&#8217;] = &#8221;;\u586b\u4e0a\u81ea\u5df1\u7684MYSQL\u5bc6\u7801<br \/>\\n&nbsp;3\u3001$cfg[&#8216;Servers&#8217;][$i][&#8216;auth_type&#8217;] =&lsquo;cookie&rsquo; &nbsp;\u8bbe\u7f6e\u4e3acookie<br \/>\\n\u4fdd\u5b58\u5e76\u5bf9\u51fa\u3002<\/p>\n<p>\\n<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u6743\u9650\u6267\u884c\uff0c\u5219\u7ed9phpmyadmin\u76ee\u5f55\u7684\u6240\u6709\u6587\u4ef6\u5939\u4e0a755\u5c5e\u6027\u3002chmod -R 755 phpmyadmin<br \/>\\n\u5230\u6b64\u5c31\u914d\u7f6e\u5b8c\u6210\uff0c\u5728\u6d4f\u89c8\u5668\u91cc\u8f93\u5165\u5730\u5740\u67e5\u770b\u662f\u5426\u53ef\u4ee5\u6d4f\u89c8\u3002\u6ce8\u610f\uff0c\u4e0d\u8981\u662f777\u3002\u5426\u5219\u53ef\u80fd\u51fa\u73b0\u4ee5\u4e0b\u9519\u8bef:&quot;\u914d\u7f6e\u6587\u4ef6\u9519\u8bef\u7684\u6743\u9650\uff0c\u4e0d\u5e94\u8be5\u662f\u53ef\u5199\u7684\uff01&quot;<\/p>\n<p>\\n<\/p>\n<p>\u5e38\u89c1\u95ee\u9898\uff1a<br \/>\\n1\u3001\u51fa\u73b0&ldquo;\u914d\u7f6e\u6587\u4ef6\u73b0\u5728\u9700\u8981\u7edd\u5bc6\u7684\u77ed\u8bed\u5bc6\u7801&rdquo;\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a\u5728 $cfg[&#8216;blowfish_secret&#8217;] = &#8216; &#8216;  \u91cc\u968f\u4fbf\u586b\u4e2a\u5b57\u7b26\u4e32\u5373\u53ef<\/p>\n","protected":false},"excerpt":{"rendered":"<p>yum\u5b89\u88c5Linux+apache+Mysql+PHP\u8be6\u7ec6\u914d\u7f6e \\n \uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[26],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78"}],"version-history":[{"count":0,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}