{"id":1110,"date":"2012-10-09T13:13:03","date_gmt":"2012-10-09T05:13:03","guid":{"rendered":"http:\/\/www.huzs.top\/?p=1110"},"modified":"2014-03-03T11:01:21","modified_gmt":"2014-03-03T03:01:21","slug":"yum%e6%90%ad%e5%bb%balnmp%e7%8e%af%e5%a2%83%ef%bc%88centos6","status":"publish","type":"post","link":"https:\/\/www.huzs.top\/?p=1110","title":{"rendered":"yum\u642d\u5efalnmp\u73af\u5883\uff08CentOS)V2014-1-29"},"content":{"rendered":"<p><strong>\u672c\u6587\u4e00\u952e\u5b89\u88c5\u5305<\/strong><br \/>\u7528\u4e8eCentOS 5.x<\/p>\n<pre>yum install wget -y;wget http:\/\/www.huzs.top\/soft\/lnmp5.sh;sh lnmp5.sh<\/pre>\n<p>\u7528\u4e8eCentOS 6.x<\/p>\n<pre>yum install wget -y;wget http:\/\/www.huzs.top\/soft\/lnmp.sh;sh lnmp.sh<\/pre>\n<p>\u4e00\u952e\u5b89\u88c5\u8bf4\u660e<br \/>NGINX\uff1a\/etc\/nginx\/nginx.conf<br \/>NGINX\u865a\u62df\u4e3b\u673a\uff1a\/etc\/nginx\/conf.d\/<br \/>PHP\uff1a\/etc\/php.ini<br \/>PHP-FPM\uff1a\/etc\/php-fpm.d\/www.conf<br \/>MYSQL\uff1a\/etc\/my.cnf<br \/>MYSQL\u6570\u636e\u5e93\u4f4d\u7f6e\uff1a\/var\/lib\/mysql\/<br \/>MYSQL\u9ed8\u8ba4root\u7528\u6237\u5bc6\u7801\uff1a\u7a7a<br \/>phpinfo\uff1ahttp:\/\/IP\/index.php<br \/>phpmyadmin\uff1ahttp:\/\/IP\/phpmyadmin<\/p>\n<p>1.\u51c6\u5907\u7cfb\u7edf<br \/>\u8bbe\u7f6e\u7cfb\u7edf\u5b57\u7b26\u96c6\uff0c\u9632\u6b62\u663e\u793a\u4e71\u7801<\/p>\n<pre>mv \/etc\/sysconfig\/i18n \/etc\/sysconfig\/i18n.default<br>vim \/etc\/sysconfig\/i18n<\/pre>\n<p>\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre>LANGUAGE=\"zh_CN.GB18030:zh_CN.GB2312:zh_CN\"<br>SUPPORTED=\"zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en\"<br>SYSFONT=\"latarcyrheb-sun16\"<br>export LC_ALL=\"zh_CN.GB18030\"<\/pre>\n<p>\u67e5\u770b\u7cfb\u7edf\u65f6\u95f4\u548c\u4fee\u6539\u65f6\u533a<\/p>\n<pre>date<br>#\u5982\u679c\u65f6\u95f4\u548c\u65f6\u533a\u4e0d\u6b63\u786e\uff0c\u505a\u5982\u4e0b\u64cd\u4f5c<br>rm -rf \/etc\/localtime<br>ln -s \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<\/pre>\n<p>\u6e05\u7406\u539f\u6709\u7a0b\u5e8f\uff0c\u6dfb\u52a0\u8fd0\u884c\u7528\u6237\u548c\u7ec4\u3002<\/p>\n<pre>yum remove httpd php mysql<br>\/usr\/sbin\/groupadd www<br>\/usr\/sbin\/useradd -s \/sbin\/nologin -g www www<br>ulimit -SHn 65535<\/pre>\n<p>2\u3001\u4f7f\u7528NGINX\u5b98\u65b9\u6e90\u5b89\u88c5NGINX\u3002<br \/><strong>\u5b89\u88c5NGINX\u5b98\u65b9\u6e90\uff1a<\/strong><\/p>\n<pre>vi \/etc\/yum.repos.d\/nginx.repo<\/pre>\n<p>\u7c98\u8d34\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre>[nginx]<br>name=nginx repo<br>baseurl=http:\/\/nginx.org\/packages\/centos\/$releasever\/$basearch\/<br>gpgcheck=0<br>enabled=1<\/pre>\n<p>\u5b89\u88c5NGINX\uff1a<\/p>\n<pre>yum install nginx<\/pre>\n<p>\u5b89\u88c5\u540e\u7684\u76f8\u5173\u76ee\u5f55\u5982\u4e0b\uff1a<br \/>\/etc\/nginx\u00a0 \u4e3b\u76ee\u5f55<br \/>\/etc\/sysconfig\/nginx\u00a0 # \u670d\u52a1\u914d\u7f6e<br \/>\/etc\/rc.d\/init.d\/nginx\u00a0 # \u542f\u52a8\u811a\u672c<br \/>\/usr\/share\/nginx # HTML\u76ee\u5f55<br \/>\/usr\/sbin\/nginx\u00a0 #\u4e3b\u7a0b\u5e8f<br \/>\/var\/log\/nginx\u00a0 # \u65e5\u5fd7\u76ee\u5f55<br \/>3\u3001\u3010\u53ef\u9009\u3011\u914d\u7f6eCentOS 6 YUM atomic\u6e90,\u9ed8\u8ba4\u7684\u6807\u51c6\u6e90\u91cc\u6ca1\u6709\u6700\u65b0\u7684php\u548cMYSQL\u7b49\u5de5\u5177\u5305\u3002<\/p>\n<pre>wget http:\/\/www.atomicorp.com\/installers\/atomic;sh .\/atomic<\/pre>\n<p>\u4e0b\u8f7datomic yum\u6e90\uff08\u6b64\u6e90\u5305\u542b\u7684\u8f6f\u4ef6\u6bd4\u8f83\u65b0\u7684\u7a33\u5b9a\u7248\u3002\uff09<br \/>\u5b89\u88c5\u63d0\u793a\u8f93\u5165\u65f6\u8f93yes\u6216\u8005\u76f4\u63a5\u56de\u8f66<\/p>\n<p>4.\u5b89\u88c5\u5f00\u53d1\u5305\u548c\u5e93\u6587\u4ef6<\/p>\n<pre>yum install ntp make openssl openssl-devel pcre pcre-devel libpng libpng-devel libjpeg-6b libjpeg-devel-6b freetype freetype-devel gd gd-devel zlib zlib-devel gcc gcc-c++ libXpm libXpm-devel ncurses ncurses-devel libmcrypt libmcrypt-devel libxml2 libxml2-devel imake autoconf automake screen sysstat compat-libstdc++-33 curl curl-devel<\/pre>\n<p><strong>5.\u5b89\u88c5php<\/strong><\/p>\n<pre>yum install php php-fpm php-devel php-common php-cli php-pdo php-odbc php-mysql php-mssql<\/pre>\n<p><\/p>\n<pre>yum install php-gd php-imap php-ldap php-mbstring php-mcrypt php-snmp php-soap php-tidy php-xml php-xmlrpc php-pear php-bcmath php-process<\/pre>\n<p><strong>6.\u5b89\u88c5\u914d\u7f6eMYSQL-SERVER\u3002<\/strong><\/p>\n<pre>yum install mysql mysql-devel mysql-server<\/pre>\n<p><strong>\u5982\u679c\u4f60\u7684\u5185\u5b58\u5c0f\u4e8e1G\uff0cmysql\u8bf7\u4f7f\u75285.5\u4ee5\u4e0b\u7248\u672c\u3002<\/strong>atomic\u6e90\u9ed8\u8ba4\u662f5.5\u7684\u6570\u636e\u5e93\u3002MySQL5.5 \u5f00\u59cb\u9ed8\u8ba4\u4f7f\u7528InnoDB\u5f15\u64ce\u3002\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u5185\u5b58\uff08\u5305\u62ec\u865a\u62df\u5185\u5b58\uff09\u5c0f\u4e8e512M\uff0c\u8bf7\u4e0d\u8981\u9a6c\u4e0a\u542f\u52a8\u6570\u636e\u5e93,\u5426\u5219\u4f1a\u56e0\u4e3a\u5185\u5b58\u4e0d\u8db3\u800c\u542f\u52a8\u5931\u8d25\u3002\u8fd9\u6837\u6211\u5c31\u9700\u8981\u624b\u52a8\u6307\u5b9a\u4f7f\u7528\u6700\u7701\u5185\u5b58\u7684\u4e0d\u652f\u6301\u4e8b\u52a1\u65e5\u5fd7\u7684MyISAM\u5f15\u64ce\u6765\u5b58\u50a8\u3002\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\/etc\/my.cnf\u540e\u518d\u542f\u52a8\u3002\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre>mv \/etc\/my.cnf \/etc\/my.cnf.default<br>vi \/etc\/my.cnf<\/pre>\n<p><\/p>\n<pre>[mysqld]<br>datadir=\/var\/lib\/mysql<br>socket=\/var\/lib\/mysql\/mysql.sock<br>user=mysql<br>character_set_server = utf8<br>default-character-set = utf8<br>#\u6307\u5b9aMyISAM\u5f15\u64ce<br>default-storage-engine = MyISAM<br>#\u505c\u7528innodb<br>skip-innodb<br>#\u5f00\u542fbin-log\u65e5\u5fd7<br>#log-bin<br>#\u8bbe\u7f6e\u4e3b\u670d\u52a1\u5668<br>#server-id = 1<br>#\u8bbe\u7f6e\u4ece\u670d\u52a1\u5668<br>#server-id = 2<br>#master-host = 192.168.1.180<br>#master-user = slave<br>#master-password = 123456<br>#master-port = 3306<br><br>[mysqld_safe]<br>log-error=\/var\/log\/mysqld.log<br>pid-file=\/var\/run\/mysqld\/mysqld.pid<br><br>[client]<br>default-character-set = utf8<\/pre>\n<p><!--more--><\/p>\n<p>7\u3001\u5f00\u542fLNMP\u670d\u52a1\u5668<\/p>\n<pre>service nginx start<br>service php-fpm start<br>service mysqld start<\/pre>\n<p><strong>8.\u8bbe\u7f6eLNMP\u670d\u52a1\u5728\u7cfb\u7edf\u542f\u52a8\u540e\u81ea\u52a8\u8fd0\u884c\u3002<\/strong><\/p>\n<pre>chkconfig nginx on<br>chkconfig php-fpm on<br>chkconfig mysqld on<\/pre>\n<p><strong>9.\u8bbe\u7f6eMYSQL\u6570\u636e\u5e93\u7684\u5bc6\u7801\uff08\u9ed8\u8ba4\u5bc6\u7801\u4e3a\u7a7a\uff09<\/strong><br \/>\u65b9\u6cd51\uff08\u63a8\u8350\uff09\uff1a\u4f7f\u7528\u5b89\u5168\u5b89\u88c5\u5411\u5bfc\u8bbe\u7f6e\uff08\u6309\u63d0\u793a\u64cd\u4f5c\uff09<\/p>\n<pre>mysql_secure_installation<\/pre>\n<p>\u65b9\u6cd52\uff1a\u76f4\u63a5\u8bbe\u7f6eroot\u7684\u5bc6\u7801\u4e3a123456<\/p>\n<pre>[root@CentOS ~]# mysqladmin -u root password \"123456\"<\/pre>\n<p><strong>10.\u914d\u7f6enginx<\/strong><br \/>\u5907\u4efd\u5f53\u524d\u7684NGINX\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<pre>mv \/etc\/nginx\/nginx.conf \/etc\/nginx\/nginx.conf.default<\/pre>\n<p>\u65b0\u5efaNGINX\u4e3b\u914d\u7f6e\u6587\u6863<\/p>\n<pre>vim \/etc\/nginx\/nginx.conf<\/pre>\n<p>\u4f7f\u7528\u5982\u4e0b\u914d\u7f6e\u6587\u6863<\/p>\n<pre>user  www;<br>worker_processes  auto;<br><br>error_log  \/var\/log\/nginx\/error.log warn;<br>pid        \/var\/run\/nginx.pid;<br><br>events {<br>    worker_connections  1024;<br>}<br><br>http {<br>    include       \/etc\/nginx\/mime.types;<br>    default_type  application\/octet-stream;<br>    log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '<br>                      '$status $body_bytes_sent \"$http_referer\" '<br>                      '\"$http_user_agent\" \"$http_x_forwarded_for\"';<br>    access_log  \/var\/log\/nginx\/access.log  main;<br><br>    sendfile        on;<br>    #tcp_nopush     on;<br>\tclient_max_body_size 20m;<br>\tserver_tokens off;<br>    keepalive_timeout  65;<br><br>\tfastcgi_intercept_errors on;<br>\terror_page 404 = http:\/\/www.huzs.top\/404.html;<br><br>    gzip on;<br>\tgzip_comp_level 5;<br>\tgzip_min_length 1000;<br>\tgzip_proxied expired no-cache no-store private auth;<br>\tgzip_types text\/plain application\/x-javascript text\/css application\/xml;<br>\tgzip_disable \"MSIE [1-6]\\.\";<br><br>    include \/etc\/nginx\/conf.d\/*.conf;<br>}<\/pre>\n<p>NGINX\u7684\u914d\u7f6e\u6587\u4ef6\u76f8\u5173\u8bf4\u660e\uff1a<br \/>\u8bbe\u7f6e\u4f7f\u7528www\u7528\u6237\u8fd0\u884cnginx\u3002<\/p>\n<pre>user www;<\/pre>\n<p>Nginx \u7684\u8fdb\u7a0b\u63a7\u5236\u3002worker_processes\u6307\u660e\u4e86nginx\u8981\u5f00\u542f\u7684\u8fdb\u7a0b\u6570\uff0c\u636e\u5b98\u65b9\u8bf4\u6cd5\uff0c\u4e00\u822c\u5f00\u4e00\u4e2a\u5c31\u591f\u4e86\uff0c\u591a\u5f00\u51e0\u4e2a\uff0c\u53ef\u4ee5\u51cf\u5c11\u673a\u5668io\u5e26\u6765\u7684\u5f71\u54cd\u3002 \u4e00\u822c\u4e3a\u5f53\u524d\u673a\u5668\u603bcpu\u6838\u5fc3\u6570\u76841\u52302\u500d\u3002\u5982\uff0c\u6211\u7684\u673a\u5668\u4e3a\u53cc\u6838\uff0c\u90a3\u4e48\u5f004\u4e2a\u8db3\u591f\u4e86\u3002\u6ce8\u610f\uff0c\u4e00\u4e2a\u7ebf\u7a0b\u4e5f\u7b97\u4e00\u4e2aCPU\u3002\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff1a<br \/>\u5f53\u8bbe\u7f6e\u6210auto\uff0c\u5c06\u81ea\u52a8\u542f\u52a8\u4e0ecpu\u6570\u91cf\u76f8\u540c\u7684worker\u8fdb\u7a0b\u3002<\/p>\n<pre>worker_processes  auto;<\/pre>\n<p><strong> \u8bbe\u7f6eNGINX\u4e0a\u4f20\u6587\u4ef6\u5927\u5c0f<\/strong>\u3002\u627e\u5230http{}\u6bb5\uff0c\u6dfb\u52a0<\/p>\n<pre>client_max_body_size 20m;<\/pre>\n<p><strong>\u5f00\u542fnginx\u7684GZIP\u9875\u9762\u538b\u7f29\uff0c\u4ee5\u63d0\u9ad8\u9875\u9762\u6253\u5f00\u901f\u5ea6\u548c\u964d\u4f4e\u5bbd\u5e26\u8d39\u7528\u3002\u5728http\u6bb5\u4e2d\u52a0\u5165\u4e0b\u9762\u51e0\u884c\u914d\u7f6e<\/strong><\/p>\n<pre> gzip on;<br>gzip_comp_level 5;<br>gzip_min_length 1000;<br>gzip_proxied expired no-cache no-store private auth;<br>gzip_types text\/plain application\/x-javascript text\/css application\/xml;<br>gzip_disable \"MSIE [1-6]\\.\";<\/pre>\n<p>\u9690\u85cfNGINX\u7684\u7248\u672c\u53f7\u3002\u4e0d\u540c\u7248\u672c\uff0c\u7279\u522b\u662f\u4f4e\u7248\u672c\u7684nginx\u53ef\u80fd\u5b58\u5728\u6f0f\u6d1e\uff0c\u5c31\u4e0d\u5e0c\u671b\u80fd\u88ab\u4eba\u8f7b\u6613\u83b7\u53d6\u5230\u7cfb\u7edf\u7248\u672c\u53f7\u3002<\/p>\n<pre>server_tokens off;<\/pre>\n<p>\u5982\u679c\u5ba2\u6237\u6ca1\u6709\u81ea\u5b9a\u4e49\u81ea\u5df1\u7684\u9519\u8bef\u9875\u9762\uff0c\u5219\u7ed9\u4e00\u4e2a\u7edf\u4e00\u7684\u9519\u8bef\u9875\u9762\u3002<\/p>\n<pre>fastcgi_intercept_errors on;<br>error_page 404 = http:\/\/www.huzs.top\/404.html;<\/pre>\n<p><strong>11.\u7ad9\u70b9\u7684\u914d\u7f6e<\/strong><\/p>\n<pre>mv \/etc\/nginx\/conf.d\/default.conf \/etc\/nginx\/<\/pre>\n<p>\u521b\u5efanginx\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0fastcgi\u652f\u6301\u3002\u201c\/etc\/nginx\/conf.d\/\u201d\u8fd9\u91cc\u662f\u6240\u6709\u7ad9\u70b9\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u5982\u679c\u9700\u8981\u7ed9\u54ea\u4e2a\u7ad9\u70b9\u6dfb\u52a0\u652f\u6301\uff0c\u5c31\u7f16\u8f91\u8d77\u914d\u7f6e\u6587\u4ef6xxx.conf<\/p>\n<pre>vi \/etc\/nginx\/conf.d\/default.conf<\/pre>\n<p><\/p>\n<pre>server {<br>\tlisten 80;<br>\tserver_name localhost;<br>\troot \/www\/web\/default;<br>\tindex index.html index.htm index.php;<br><br>\t#charset utf-8;<br><br>\terror_page 404 \/404.html;<br><br>\tlocation = \/robots.txt { access_log off; log_not_found off; }<br>\tlocation = \/favicon.ico { access_log off; log_not_found off; }<br><br>\tlocation ~ \\.php$ {<br>\tfastcgi_pass 127.0.0.1:9000;<br>\tinclude fastcgi_params;<br>\tfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br><br>\t}<br><br>\tlocation ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)$ {<br>\texpires 7d;<br>\t}<br><br>\tlocation ~ .*\\.(js|css)?$ {<br>\texpires 12h;<br>\t}<br>}<\/pre>\n<p>\u521b\u5efa\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u9700\u8981\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u4f7f\u5176\u751f\u6548\u3002\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<pre>service nginx restart<\/pre>\n<p><strong>12\u3001PHP\u7684\u914d\u7f6e<\/strong><\/p>\n<pre>vim \/etc\/php.ini<\/pre>\n<p>\u8bbe\u7f6ePHP\u4e0a\u4f20\u6587\u4ef6\u3002\u7f16\u8f91\u6587\u4ef6php.ini\uff0c\u5206\u522b\u8bbe\u7f6e\u4f7fPHP CGI\u4fee\u6b63\u5176\u8def\u5f84\u4ee5\u9075\u5b88\u89c4\u683c\u548c<strong>\u8bbe\u7f6ePHP\u5141\u8bb8\u4e0a\u4f20\u7684\u6587\u4ef6\u5927\u5c0f<\/strong>\u3002<\/p>\n<pre>vi \/etc\/php.ini<\/pre>\n<p><\/p>\n<pre>cgi.fix_pathinfo=1<br>upload_max_filesize = 20M<br>date.timezone =\"Asia\/Shanghai\"<\/pre>\n<p>\u4e00\u4e9b\u9700\u8981\u7981\u7528\u7684PHP\u5371\u9669\u51fd\u6570\uff0c\u67e5\u627e\u5230 disable_functions \uff0c\u6dfb\u52a0\u9700\u7981\u7528\u7684\u51fd\u6570\u540d(\u4e00\u822c\u5c4f\u853d\u9ad8\u5371\u7ea7\u5373\u53ef)\uff0c\u5982\u4e0b\uff1a<br \/>\u5371\u9669\u7b49\u7ea7\uff1a\u9ad8<\/p>\n<pre>eval,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,symlink,popepassthru,fsocket,fsockopen<\/pre>\n<p>\u5371\u9669\u7b49\u7ea7\uff1a\u4e2d<\/p>\n<pre>phpinfo,stream_socket_server,readlink,syslog,scandir<\/pre>\n<p>\u5371\u9669\u7b49\u7ea7\uff1a\u4f4e<\/p>\n<pre>error_log<\/pre>\n<p>\u8be6\u7ec6\u8bf4\u660e\u6d4f\u89c8\uff1a<a title=\"\u4e00\u4e9b\u9700\u8981\u7981\u7528\u7684PHP\u5371\u9669\u51fd\u6570(disable_functions)\" href=\"http:\/\/www.huzs.top\/?p=2000\" target=\"_blank\">http:\/\/www.huzs.top\/?p=2000<\/a><\/p>\n<p><strong>13.PHP-FPM\u914d\u7f6e<\/strong><\/p>\n<pre>vim \/etc\/php-fpm.d\/www.conf<\/pre>\n<p>\u8bbe\u7f6e\u4f7f\u7528www\u7528\u6237\u8fd0\u884cphp-fpm\u3002<\/p>\n<pre>user = www<br>group = www<\/pre>\n<p>PHP \u7684\u8fdb\u7a0b\u6570\u63a7\u5236\uff0c\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff1a<br \/><strong>\u3000\u3000php5.3\u7684fasgcgi\u6a21\u5f0f\u4e0b\u7684\u8fdb\u7a0b\u7684\u7ba1\u7406\u5b58\u5728\u4e24\u79cd\u98ce\u683c\u2014\u2014static\u548cdynamic\u3002<\/strong><br \/>\u5982\u679c\u8bbe\u7f6e\u6210static\uff0cphp-fpm\u8fdb\u7a0b\u6570\u81ea\u59cb\u81f3\u7ec8\u90fd\u662fpm.max_children\u6307\u5b9a\u7684\u6570\u91cf\uff0c\u4e0d\u518d\u589e\u52a0\u6216\u51cf\u5c11\u3002\u5982\u679c\u8bbe\u7f6e\u6210 dynamic\uff0c\u5219php-fpm\u8fdb\u7a0b\u6570\u662f\u52a8\u6001\u7684\uff0c\u6700\u5f00\u59cb\u662fpm.start_servers\u6307\u5b9a\u7684\u6570\u91cf\uff0c\u5982\u679c\u8bf7\u6c42\u8f83\u591a\uff0c\u5219\u4f1a\u81ea\u52a8\u589e\u52a0\uff0c \u4fdd\u8bc1\u7a7a\u95f2\u7684\u8fdb\u7a0b\u6570\u4e0d\u5c0f\u4e8epm.min_spare_servers\uff0c\u5982\u679c\u8fdb\u7a0b\u6570\u8f83\u591a\uff0c\u4e5f\u4f1a\u8fdb\u884c\u76f8\u5e94\u6e05\u7406\uff0c\u4fdd\u8bc1\u591a\u4f59\u7684\u8fdb\u7a0b\u6570\u4e0d\u591a\u4e8e pm.max_spare_servers\u3002<br \/>\u6211\u4eec\u505a\u5982\u4e0b\u8bbe\u7f6e\uff1a<\/p>\n<pre>pm.max_children\uff1a50 \/\/\u9759\u6001\u65b9\u5f0f\u4e0b\u5f00\u542f\u7684php-fpm\u8fdb\u7a0b\u6570\u91cf\u3002\uff08\u9ed8\u8ba450\uff09<br>pm.start_servers\uff1a1 \/\/\u52a8\u6001\u65b9\u5f0f\u4e0b\u7684\u8d77\u59cbphp-fpm\u8fdb\u7a0b\u6570\u91cf\u3002\uff08\u9ed8\u8ba45\uff09<br>pm.min_spare_servers\uff1a1 \/\/\u52a8\u6001\u65b9\u5f0f\u4e0b\u7684\u6700\u5c0fphp-fpm\u8fdb\u7a0b\u6570\u91cf\u3002\uff08\u9ed8\u8ba45\uff09<br>pm.max_spare_servers\uff1a 2 \/\/\u52a8\u6001\u65b9\u5f0f\u4e0b\u7684\u6700\u5927php-fpm\u8fdb\u7a0b\u6570\u91cf\u3002\uff08\u9ed8\u8ba435\uff09<\/pre>\n<p>\u7531\u4e8eyum\u5b89\u88c5\u7684php\u9ed8\u8ba4\u7528\u6237\u662fapache\uff0c\u5728\u6211\u4eec\u6539\u53d8\u7528\u6237\u4e3awww\u540e\uff0c\/var\/lib\/php\/session\u6743\u9650\u4ecd\u672aapache\u3002\u5bfc\u81f4phpmyadmin\u65e0\u6cd5\u8fd0\u884c\u3002\u6240\u4ee5\uff0c\u9700\u6267\u884c\u5982\u4e0b\u64cd\u4f5c\uff0c\u53d8\u66f4\u6743\u9650\u3002<\/p>\n<pre>chown -R www:www \/var\/lib\/php\/session<br>service php-fpm restart<\/pre>\n<p><strong>14.\u5efa\u7acbinfo.php\u6587\u4ef6<\/strong><\/p>\n<pre>mkdir -p \/www\/web\/default<br>chown -R www:www \/www\/<br>chmod -R 750 \/www\/<br>echo \"<!--?php phpinfo();?-->\"&gt;\/www\/web\/default\/index.php<\/pre>\n<p>\u6d4b\u8bd5nginx\u662f\u5426\u89e3\u6790php<\/p>\n<p><strong>MySQL\u7684\u5e38\u7528\u64cd\u4f5c<\/strong><br \/><strong>\u5efa\u7acb\u4e00\u4e2a\u4e0e\u7528\u6237\u540d\uff08wordpress\u5bc6\u7801\u4e3a:password\uff09\u540c\u540d\u7684\u6570\u636e\u5e93\uff0c\u5e76\u8d4b\u4e88\u6743\u9650\u3002<\/strong><\/p>\n<pre>CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'password';<br>GRANT USAGE ON * . * TO 'wordpress'@'localhost' IDENTIFIED BY 'password' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;<br>CREATE DATABASE IF NOT EXISTS `wordpress` ;<br>GRANT ALL PRIVILEGES ON `wordpress` . * TO 'wordpress'@'localhost';<\/pre>\n<p>\u542f\u52a8 mysql \u670d\u52a1\u7684\u65f6\u5019\u62a5\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n<p>Fatal error: Can&#8217;t open and lock privilege tables: Table &#8216;mysql.host&#8217; doesn&#8217;t exist<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<p>mysql_install_db &#8211;user=mysql \u521d\u59cb\u5316\u6570\u636e\u5e93\u5373\u53ef<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4e00\u952e\u5b89\u88c5\u5305\u7528\u4e8eCentOS 5.x yum install wget -y;wget http:\/\/www [&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":[],"class_list":["post-1110","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/1110","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=1110"}],"version-history":[{"count":50,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/1110\/revisions"}],"predecessor-version":[{"id":2078,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/1110\/revisions\/2078"}],"wp:attachment":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}