 
		 
		{"id":156,"date":"2017-11-15T11:51:31","date_gmt":"2017-11-15T03:51:31","guid":{"rendered":"http:\/\/www.softeng.cn\/?p=156"},"modified":"2017-11-15T11:51:31","modified_gmt":"2017-11-15T03:51:31","slug":"%e5%9c%a8centos-7%e4%b8%8b%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85nginxphpmysql%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/www.softeng.cn\/?p=156","title":{"rendered":"\u5728CentOS 7\u4e0b\u7f16\u8bd1\u5b89\u88c5Nginx+PHP+MySQL\u73af\u5883"},"content":{"rendered":"<h1>1\u3001\u524d\u8a00<\/h1>\n<p>\u672c\u6587\u9002\u5408\u4e8e\u5df2\u7ecf\u5bf9Linux\u64cd\u4f5c\u7cfb\u7edf\u5177\u6709\u57fa\u672c\u64cd\u4f5c\u7ecf\u9a8c\uff0c\u5e76\u4e14\u80fd\u591f\u5728Linux\u6216Windows\u4e0a\u901a\u8fc7\u4e00\u952e\u642d\u5efa\u5de5\u5177\u6216\u8005yum\u547d\u4ee4\u884c\u8fdb\u884c\u73af\u5883\u642d\u5efa\u7684\u8bfb\u8005\uff0c\u9605\u8bfb\u672c\u6587\u9700\u5177\u6709\u4e00\u5b9a\u7684\u4e13\u4e1a\u77e5\u8bc6\uff0c\u672c\u6587\u4e0d\u5efa\u8bae\u521d\u5b66\u8005\u9605\u8bfb\u3002<\/p>\n<p>\u672c\u6587\u6240\u63cf\u8ff0\u7684\u662f\u5728\u6807\u51c6\u7684CentOS 7.2 64\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u4e0b\uff0c\u5b89\u88c5Nginx 1.12.2 + PHP 7.1.11 + MySQL 5.7.20\u73af\u5883\u3002\u91c7\u7528\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5\u7684\u65b9\u5f0f\uff0c\u867d\u7136\u8f83\u76f4\u63a5\u4f7f\u7528yum\u547d\u4ee4\u5b89\u88c5\u8f83\u4e3a\u590d\u6742\uff0c\u4f46\u662f\u6e90\u7801\u5b89\u88c5\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6307\u5b9a\u5b89\u88c5\u8def\u5f84\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u914d\u7f6e\u5b89\u88c5\u914d\u5957\u7684\u5e93\u548c\u63d2\u4ef6\uff0c\u8fd9\u6837\u670d\u52a1\u5668\u8fd0\u7ef4\u4eba\u5458\u5c06\u66f4\u6e05\u695a\u81ea\u5df1\u670d\u52a1\u5668\u7684\u60c5\u51b5\uff0c\u4ece\u800c\uff0c\u5728\u65e5\u540e\u7684\u73af\u5883\u3001\u63d2\u4ef6\u7684\u5347\u7ea7\u548c\u66f4\u65b0\u64cd\u4f5c\u4e2d\uff0c\u5c06\u53d8\u5f97\u66f4\u52a0\u7b80\u4fbf\u548c\u5bb9\u6613\u3002<\/p>\n<h1><!--more-->2\u3001\u51c6\u5907\u5b89\u88c5\u5de5\u5177<\/h1>\n<h2>2.1\u3001\u5b89\u88c5make<\/h2>\n<blockquote><p>yum -y install gcc automake autoconf libtool make<\/p><\/blockquote>\n<h2>2.2\u3001\u5b89\u88c5g++<\/h2>\n<blockquote><p>yum install gcc gcc-c++ glibc<\/p><\/blockquote>\n<h2>2.3\u3001\u521b\u5efa\u5b89\u88c5\u76ee\u5f55<\/h2>\n<p>\u672c\u6587\u662f\u5728\u963f\u91cc\u4e91\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\uff0c\u6240\u4ee5\u5728\u670d\u52a1\u5668\u6839\u76ee\u5f55\u4e0b\u521b\u5efaalidata\u76ee\u5f55\uff0c\u7136\u540e\u5728alidata\u76ee\u5f55\u91cc\u9762\u5206\u522b\u521b\u5efaserver\u76ee\u5f55\u3001webapps\u76ee\u5f55\u548cpackage\u76ee\u5f55\uff0c\u5176\u4e2dserver\u76ee\u5f55\u5b58\u653e\u6240\u6709\u7684\u670d\u52a1\u5668\u8f6f\u4ef6\uff08\u672c\u6587\u4e2d\u6240\u6d89\u53ca\u5230\u7684nginx\u3001php\u3001mysql\u7b49\uff09\uff0cwebapps\u76ee\u5f55\u5b58\u653e\u6240\u6709\u90e8\u7f72\u7684\u4ee3\u7801\u53ca\u7a0b\u5e8f\uff0cpackage\u76ee\u5f55\u7528\u6765\u5b58\u653e\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8981\u7528\u5230\u7684\u7f16\u8bd1\u540e\u7684\u5e93\u6587\u4ef6\u3002<br \/>\n\u9700\u4ee5root\u6743\u9650\uff0c\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>mkdir \/alidata<br \/>\nmkdir \/alidata\/package<br \/>\nmkdir \u2013p \/alidata\/server<br \/>\nmkdir \u2013p \/alidata\/webapps<br \/>\nmkdir \u2013p \/alidata\/logs<\/p><\/blockquote>\n<p>\u8fd9\u91cc\u9700\u8981\u8bf4\u660e\uff0c\u4e0a\u8ff0\u7684server\u76ee\u5f55\uff0c\u662f\u6307\u73af\u5883\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u7a0b\u5e8f\u6240\u5728\u7684\u76ee\u5f55\uff0c\u5e76\u975enginx\u7b49\u7a0b\u5e8f\u7684\u6e90\u7801\u5b58\u653e\u76ee\u5f55\uff0c\u4e3a\u4e86\u65b9\u4fbf\uff0c\u672c\u6587\u5c06\u4e0b\u8f7d\u5230\u7684\u8fd9\u4e9b\u8fd0\u884c\u73af\u5883\u7a0b\u5e8f\u7684\u6e90\u7801\u7edf\u4e00\u5b58\u653e\u4e8e\/root\u76ee\u5f55\u4e0b\uff0c\u8bfb\u8005\u53ef\u6839\u636e\u81ea\u8eab\u60c5\u51b5\u53ca\u559c\u597d\uff0c\u5c06\u8fd0\u884c\u73af\u5883\u7a0b\u5e8f\u6e90\u7801\u5b58\u653e\u4e8e\u4efb\u610f\u4e0d\u662f\/alidata\/server\u7684\u76ee\u5f55\u4e0b\u3002<\/p>\n<h1>3\u3001\u5b89\u88c5Nginx<\/h1>\n<h2>3.1\u3001\u4e0b\u8f7d\u5e76\u89e3\u538bpcre<\/h2>\n<p>\u5b98\u7f51\uff1a<a href=\"http:\/\/www.pcre.org\/\">http:\/\/www.pcre.org\/<\/a><br \/>\n\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/root\/<br \/>\nwget https:\/\/sourceforge.net\/projects\/pcre\/files\/pcre\/8.41\/pcre-8.41.tar.gz<br \/>\ntar -zxvf pcre-8.41.tar.gz<\/p><\/blockquote>\n<h2>3.2\u3001\u4e0b\u8f7d\u5e76\u89e3\u538bzlib<\/h2>\n<p>\u5b98\u7f51\uff1a<a href=\"http:\/\/zlib.net\/\">http:\/\/zlib.net\/<\/a><br \/>\n\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/root\/<br \/>\nwget https:\/\/sourceforge.net\/projects\/libpng\/files\/zlib\/1.2.11\/zlib-1.2.11.tar.gz<br \/>\ntar \u2013zxvf zlib-1.2.11.tar.gz<\/p><\/blockquote>\n<h2>3.3\u3001\u4e0b\u8f7d\u5e76\u89e3\u538bopenssl<\/h2>\n<p>\u5b98\u7f51\uff1a<a href=\"https:\/\/www.openssl.org\/\">https:\/\/www.openssl.org\/<\/a><br \/>\n\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/root\/<br \/>\nwget https:\/\/www.openssl.org\/source\/openssl-1.1.0b.tar.gz<br \/>\ntar \u2013zxvf openssl-1.1.0b.tar.gz<\/p><\/blockquote>\n<h2>3.4\u3001\u4e3anginx\u6dfb\u52a0\u7528\u6237\u53ca\u7ec4<\/h2>\n<p>nginx\u7684\u5de5\u4f5c\u8fdb\u7a0b\u9700\u8981\u4ee5\u67d0\u4e00\u4e2a\u7528\u6237\u7684\u6743\u9650\u8fdb\u884c\u8fd0\u884c\uff0c\u4e3a\u4e86\u670d\u52a1\u5668\u5b89\u5168\uff0c\u4e00\u822c\u6307\u5b9a\u4e00\u4e2a\u666e\u901a\u7528\u6237\u6743\u9650\u7684\u8d26\u53f7\u505a\u4e3anginx\u7684\u8fd0\u884c\u89d2\u8272\uff0c\u6839\u636e\u4e2a\u4eba\u4e60\u60ef\uff0c\u8fd9\u91cc\u4f7f\u7528www\u7528\u6237\u505a\u4e3anginx\u5de5\u4f5c\u8fdb\u7a0b\u7684\u7528\u6237\uff0c\u540e\u7eed\u5b89\u88c5\u7684PHP\u4e5f\u4ee5www\u7528\u6237\u505a\u4e3a\u5de5\u4f5c\u8fdb\u7a0b\u7528\u6237\uff0c\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u521b\u5efa\u7528\u6237\u53ca\u7528\u6237\u7ec4<\/p>\n<blockquote><p>groupadd -r www<br \/>\nuseradd -r -g www www<\/p><\/blockquote>\n<h2>3.5\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5nginx<\/h2>\n<p>\u5b98\u7f51\uff1a<a href=\"http:\/\/nginx.org\/\">http:\/\/nginx.org\/<\/a><br \/>\n\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/root\/<br \/>\nwget http:\/\/nginx.org\/download\/nginx-1.12.2.tar.gz<br \/>\ntar \u2013zxvf nginx-1.12.2.tar.gz<\/p><\/blockquote>\n<p>\u4ee5\u4e0a\u547d\u4ee4\u5b8c\u6210\u4e0b\u8f7d\u548c\u89e3\u538b\u64cd\u4f5c\uff0c\u63a5\u4e0b\u6765\u8fdb\u884c\u5b89\u88c5\u64cd\u4f5c<\/p>\n<blockquote><p>.\/configure &#8211;prefix=\/alidata\/server\/nginx-1.12.2 &#8211;sbin-path=\/alidata\/server\/nginx-1.12.2\/sbin\/nginx &#8211;conf-path=\/alidata\/server\/nginx-1.12.2\/nginx.conf &#8211;pid-path=\/alidata\/server\/nginx-1.12.2\/nginx.pid &#8211;user=www &#8211;group=www &#8211;with-http_ssl_module &#8211;with-http_flv_module &#8211;with-http_mp4_module &#8211;with-http_stub_status_module &#8211;with-select_module &#8211;with-poll_module &#8211;error-log-path=\/alidata\/logs\/nginx\/error.log &#8211;http-log-path=\/alidata\/logs\/nginx\/access.log &#8211;with-pcre=\/root\/pcre-8.41 &#8211;with-zlib=\/root\/zlib-1.2.11 &#8211;with-openssl=\/root\/openssl-1.1.0b<br \/>\nmake<br \/>\nmake install<\/p><\/blockquote>\n<p>\u5176\u4e2d\uff0c.\/configure\u662f\u5bf9\u5b89\u88c5\u8fdb\u884c\u914d\u7f6e\uff1b<br \/>\n&#8211;prefix\u8868\u793anginx\u8981\u5b89\u88c5\u5230\u54ea\u4e2a\u8def\u5f84\u4e0b\uff0c\u8fd9\u91cc\u6307\u5b9a\u521a\u624d\u65b0\u5efa\u597d\u7684\/alidata\/server\u76ee\u5f55\u4e0b\u7684nginx-1.12.2\uff1b<br \/>\n&#8211;sbin-path\u8868\u793anginx\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5b58\u653e\u8def\u5f84<br \/>\n&#8211;conf-path\u8868\u793anginx\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u8def\u5f84\uff0cnginx\u5141\u8bb8\u4f7f\u7528\u4e0d\u540c\u7684\u914d\u7f6e\u6587\u4ef6\u542f\u52a8\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u4e2d\u7684-c\u9009\u9879<br \/>\n&#8211;pid-path\u8868\u793anginx.pid\u6587\u4ef6\u7684\u5b58\u653e\u8def\u5f84\uff0c\u5c06\u5b58\u50a8\u7684\u4e3b\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u53f7\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u968f\u65f6\u6539\u53d8\u7684\u6587\u4ef6\u540d \uff0c \u5728nginx.conf\u914d\u7f6e\u6587\u4ef6\u4e2d\u4f7f\u7528 PID\u6307\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6587\u4ef6\u540d \u4e3aprefix\/logs\/nginx.pid<br \/>\n&#8211;error-log-path\u8868\u793anginx\u7684\u4e3b\u9519\u8bef\u3001\u8b66\u544a\u3001\u548c\u8bca\u65ad\u6587\u4ef6\u5b58\u653e\u8def\u5f84<br \/>\n&#8211;http-log-path\u8868\u793anginx\u7684\u4e3b\u8bf7\u6c42\u7684HTTP\u670d\u52a1\u5668\u7684\u65e5\u5fd7\u6587\u4ef6\u7684\u5b58\u653e\u8def\u5f84<br \/>\n&#8211;user\u8868\u793anginx\u5de5\u4f5c\u8fdb\u7a0b\u7684\u7528\u6237<br \/>\n&#8211;group\u8868\u793anginx\u5de5\u4f5c\u8fdb\u7a0b\u7684\u7528\u6237\u7ec4<br \/>\n&#8211;with-select_module\u6216&#8211;without-select_module\u8868\u793a\u542f\u7528\u6216\u7981\u7528\u6784\u5efa\u4e00\u4e2a\u6a21\u5757\u6765\u5141\u8bb8\u670d\u52a1\u5668\u4f7f\u7528select()\u65b9\u6cd5<br \/>\n&#8211;with-poll_module\u6216&#8211;without-poll_module\u8868\u793a\u542f\u7528\u6216\u7981\u7528\u6784\u5efa\u4e00\u4e2a\u6a21\u5757\u6765\u5141\u8bb8\u670d\u52a1\u5668\u4f7f\u7528poll()\u65b9\u6cd5<br \/>\n&#8211;with-http_ssl_module\u8868\u793a\u4f7f\u7528https\u534f\u8bae\u6a21\u5757\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8be5\u6a21\u5757\u6ca1\u6709\u88ab\u6784\u5efa\u3002\u5efa\u7acb\u5e76\u8fd0\u884c\u6b64\u6a21\u5757\u7684OpenSSL\u5e93\u662f\u5fc5\u9700\u7684<br \/>\n&#8211;with-pcre\u8868\u793apcre\u7684\u6e90\u7801\u8def\u5f84\uff0c\u56e0\u4e3a\u89e3\u538b\u540e\u7684pcre\u662f\u653e\u5728root\u76ee\u5f55\u4e0b\u7684\uff0c\u6240\u4ee5\u662f\/root\/pcre-8.41\uff1b<br \/>\n&#8211;with-zlib\u8868\u793azlib\u7684\u6e90\u7801\u8def\u5f84\uff0c\u8fd9\u91cc\u56e0\u4e3a\u89e3\u538b\u540e\u7684zlib\u662f\u653e\u5728root\u76ee\u5f55\u4e0b\u7684\uff0c\u6240\u4ee5\u662f\/root\/zlib-1.2.11<br \/>\n&#8211;with-openssl\u8868\u793aopenssl\u5e93\u7684\u6e90\u7801\u8def\u5f84<br \/>\n\u914d\u7f6e\u6210\u529f\u540e\uff0c\u4f9d\u6b21\u6267\u884cmake\u548cmake install\u547d\u4ee4\uff0c\u5373\u53ef\u5b89\u88c5Nginx\uff0c\u5b89\u88c5\u6210\u529f\u540e\uff0c\u53ef\u4ee5\u770b\u5230\u5728\/alidata\/server\u76ee\u5f55\u4e0b\uff0c\u591a\u51fa\u4e86\u4e00\u4e2anginx-1.12.2\uff0c\u91cc\u9762\u5373\u662fnginx\u7684\u5b9e\u9645\u8fd0\u884c\u7a0b\u5e8f\u3002<\/p>\n<h2>3.6\u3001\u8bbe\u7f6enginx\u914d\u7f6e\u6587\u4ef6<\/h2>\n<p>\u672c\u6587\u914d\u7f6e\u7684nginx\u652f\u6301\u591a\u57df\u540d\uff0c\u6bcf\u4e2a\u57df\u540d\u7684\u914d\u7f6e\u6587\u4ef6\u5355\u72ec\u653e\u5728\/alidata\/server\/nginx-1.12.2\/conf\/vhosts\u8def\u5f84\u4e0b\uff0c\u4f7f\u7528vim\u547d\u4ee4\u6253\u5f00nginx.conf\u6587\u4ef6\uff0c\u5bf9\u5176\u5185\u5bb9\u8fdb\u884c\u4fee\u6539<\/p>\n<blockquote><p>user\u00a0 www www;<\/p>\n<p>worker_processes\u00a0 2;<\/p>\n<p>&nbsp;<\/p>\n<p>error_log\u00a0 \/alidata\/logs\/nginx\/error.log crit;<\/p>\n<p>&nbsp;<\/p>\n<p>pid\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/alidata\/server\/nginx-1.12.2\/logs\/nginx.pid;<\/p>\n<p>worker_rlimit_nofile 65535;<\/p>\n<p>&nbsp;<\/p>\n<p>events {<\/p>\n<p>use epoll;<\/p>\n<p>worker_connections\u00a0 65535;<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>http {<\/p>\n<p>include \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0mime.types;<\/p>\n<p>default_type\u00a0 application\/octet-stream;<\/p>\n<p>&nbsp;<\/p>\n<p>access_log\u00a0 \/alidata\/logs\/nginx\/access.log\u00a0 main;<\/p>\n<p>&nbsp;<\/p>\n<p>server_names_hash_bucket_size 128;<\/p>\n<p>client_header_buffer_size 32k;<\/p>\n<p>large_client_header_buffers 4 32k;<\/p>\n<p>client_max_body_size 8m;<\/p>\n<p>&nbsp;<\/p>\n<p>sendfile\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on;<\/p>\n<p>tcp_nopush\u00a0\u00a0\u00a0\u00a0 on;<\/p>\n<p>&nbsp;<\/p>\n<p>keepalive_timeout\u00a0 65;<\/p>\n<p>&nbsp;<\/p>\n<p>gzip\u00a0 on;<\/p>\n<p>gzip_min_length\u00a0 1k;<\/p>\n<p>gzip_buffers\u00a0\u00a0\u00a0\u00a0 4 16k;<\/p>\n<p>gzip_http_version 1.0;<\/p>\n<p>gzip_comp_level 2;<\/p>\n<p>gzip_types\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 text\/plain application\/x-javascript text\/css application\/xml;<\/p>\n<p>gzip_vary on;<\/p>\n<p>&nbsp;<\/p>\n<p>tcp_nodelay on;<\/p>\n<p>&nbsp;<\/p>\n<p>fastcgi_connect_timeout 300;<\/p>\n<p>fastcgi_send_timeout 300;<\/p>\n<p>fastcgi_read_timeout 300;<\/p>\n<p>fastcgi_buffer_size 64k;<\/p>\n<p>fastcgi_buffers 4 64k;<\/p>\n<p>fastcgi_busy_buffers_size 128k;<\/p>\n<p>fastcgi_temp_file_write_size 128k;<\/p>\n<p>&nbsp;<\/p>\n<p>log_format &#8216;<span class=\"katex math inline\">remote_addr &#8211;<\/span>remote_user [<span class=\"katex math inline\">time_local] &#8220;<\/span>request&#8221; &#8216;<\/p>\n<p>&#8216;<span class=\"katex math inline\">status<\/span>body_bytes_sent &#8220;<span class=\"katex math inline\">http_referer&#8221; &#8216;<\/p>\n<p>&#8216;&#8221;<\/span>http_user_agent&#8221; &#8220;$http_x_forwarded_for&#8221;&#8216;;<\/p>\n<p>&nbsp;<\/p>\n<p>include \/alidata\/server\/nginx-1.12.2\/conf\/vhosts\/*.conf;<\/p>\n<p>include \/alidata\/server\/nginx-1.12.2\/conf\/proxy\/*.conf;<\/p>\n<p>}<\/p><\/blockquote>\n<p>\u4e0a\u8ff0\u914d\u7f6e\u4e2d\uff0c\u5f15\u7528\u4e86\/alidata\/server\/nginx-1.12.2\/conf\/vhosts\/\u76ee\u5f55\u4e0b\u6240\u6709\u540e\u7f00\u540d\u662f.conf\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u73b0\u5728\u8fdb\u5165\u8be5\u76ee\u5f55\u7f16\u5199\u4e00\u4e2a\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6default.conf\uff0c\u5176\u5185\u5bb9\u662f<\/p>\n<blockquote><p>server {<\/p>\n<p>listen\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 80;<\/p>\n<p>server_name\u00a0 localhost;<\/p>\n<p>index index.html;<\/p>\n<p>root \/alidata\/webapps;<\/p>\n<p>location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)<span class=\"katex math inline\">{<\/p>\n<p>expires 30d;<\/p>\n<p>}<\/p>\n<p>location ~ .*\\.(js|css)?<\/span><\/p>\n<p>{<\/p>\n<p>expires 1h;<\/p>\n<p>}<\/p>\n<p>#\u4f2a\u9759\u6001\u89c4\u5219<\/p>\n<p>include \/alidata\/server\/nginx-1.12.2\/conf\/rewrite\/default.conf;<\/p>\n<p>access_log\u00a0 \/alidata\/logs\/nginx\/access\/default.log;<\/p>\n<p>error_log \/alidata\/logs\/nginx\/error\/default.log;<\/p>\n<p>}<\/p><\/blockquote>\n<p>\u5176\u4e2d\u5f15\u5165\u4e86\u4e00\u4e2a\/alidata\/server\/nginx-1.12.2\/conf\/rewrite\/default.conf\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u662f\u7528\u6765\u7f16\u5199rewrite\u89c4\u5219\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u7528\u6765\u5b9e\u73b0\u4f2a\u9759\u6001\uff0c\u5176\u5185\u5bb9\u662f<\/p>\n<blockquote><p>rewrite ^(.*)-htm-(.*)<span class=\"katex math inline\"><\/span>1.php?<span class=\"katex math inline\">2 last;<br \/>\nrewrite ^(.*)\/simple\/([a-z0-9\\_]+\\.html)<\/span> <span class=\"katex math inline\">1\/simple\/index.php?<\/span>2 last;<br \/>\nrewrite ^(.*)\/data\/(.*)\\.(htm|php)<span class=\"katex math inline\">404.html last;<br \/>\nrewrite ^(.*)\/attachment\/(.*)\\.(htm|php)<\/span> 404.html last;<br \/>\nrewrite ^(.*)\/html\/(.*)\\.(htm|php)$ 404.html last;<\/p><\/blockquote>\n<h2>3.7\u3001\u542f\u52a8nginx<\/h2>\n<p>\u4ee5\u672c\u6587\u4e3a\u4f8b\uff0c\u542f\u52a8nginx\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>\/alidata\/server\/nginx-1.12.2\/sbin\/nginx<\/p><\/blockquote>\n<p>\u542f\u52a8\u540e\uff0c\u4f7f\u7528\u547d\u4ee4<\/p>\n<blockquote><p>ps aux | grep nginx<\/p><\/blockquote>\n<p>\u67e5\u770b\u8fdb\u7a0b\uff0c\u82e5\u80fd\u591f\u770b\u5230\u76f8\u5173\u8fdb\u7a0b\uff0c\u5219\u8bc1\u660e\u542f\u52a8\u6210\u529f\u3002\u67e5\u8be2\u8fdb\u7a0b\u65f6\uff0c\u53ef\u4ee5\u770b\u5230\u8fdb\u7a0b\u662f\u4ee5www\u7528\u6237\u8eab\u4efd\u6267\u884c\u7684<\/p>\n<h2>3.8\u3001\u52a0\u5165\u7cfb\u7edf\u73af\u5883\u53d8\u91cf<\/h2>\n<p>\u4f7f\u7528vim\u547d\u4ee4\u6253\u5f00\/etc\/profile\u6587\u4ef6\uff0c\u5728\u6587\u4ef6\u6700\u672b\u5c3e\u52a0\u4e0a\u5982\u4e0b\u4ee3\u7801<\/p>\n<blockquote><p>export NGINX_HOME=\/alidata\/server\/nginx-1.12.2<br \/>\nexport PATH=<span class=\"katex math inline\">PATH:<\/span>NGINX_HOME\/sbin<\/p><\/blockquote>\n<p>\u4fdd\u5b58\u4fee\u6539\u540e\uff0c\u4f7f\u7528source\u547d\u4ee4\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>source \/etc\/profile<\/p><\/blockquote>\n<p>\u6267\u884c\u4e0a\u8ff0\u547d\u4ee4\u540e\uff0c\u53ef\u4f7f\u7528<\/p>\n<blockquote><p>echo $PATH<\/p><\/blockquote>\n<p>\u547d\u4ee4\u67e5\u770b\u73af\u5883\u53d8\u91cf\u4e2d\u662f\u5426\u5df2\u7ecf\u52a0\u5165\u4e86\u76f8\u5173\u7684\u8def\u5f84<\/p>\n<h2>3.9\u3001\u52a0\u5165\u7cfb\u7edf\u670d\u52a1<\/h2>\n<p>\u4f7f\u7528vim\u547d\u4ee4\u5728\/etc\/init.d\/\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2anginx\u6587\u4ef6\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>vim \/etc\/init.d\/nginx<\/p><\/blockquote>\n<p>\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b<\/p>\n<blockquote><p>#!\/bin\/bash<br \/>\n# chkconfig: &#8211; 85 15<br \/>\nPATH=\/alidata\/server\/nginx-1.12.2<br \/>\nDESC=&#8221;nginx daemon&#8221;<br \/>\nNAME=nginx<br \/>\nDAEMON=<span class=\"katex math inline\">PATH\/sbin\/<\/span>NAME<br \/>\nCONFIGFILE=<span class=\"katex math inline\">PATH\/<\/span>NAME.conf<br \/>\nPIDFILE=<span class=\"katex math inline\">PATH\/logs\/<\/span>NAME.pid<br \/>\nSCRIPTNAME=\/etc\/init.d\/<span class=\"katex math inline\">NAME<br \/>\nset -e<br \/>\n[ -x &#8220;<\/span>DAEMON&#8221; ] || exit 0<br \/>\ndo_start() {<br \/>\n<span class=\"katex math inline\">DAEMON -c<\/span>CONFIGFILE || echo -n &#8220;nginx already running&#8221;<br \/>\n}<br \/>\ndo_stop() {<br \/>\n<span class=\"katex math inline\">DAEMON -s stop || echo -n &#8220;nginx not running&#8221;<br \/>\n}<br \/>\ndo_reload() {<\/span>DAEMON -s reload || echo -n &#8220;nginx can&#8217;t reload&#8221;<br \/>\n}<br \/>\ncase &#8220;<span class=\"katex math inline\">1&#8243; in<br \/>\nstart)<br \/>\necho -n &#8220;Starting<\/span>DESC: <span class=\"katex math inline\">NAME&#8221;<br \/>\ndo_start<br \/>\necho &#8220;.&#8221;<br \/>\n;;<br \/>\nstop)<br \/>\necho -n &#8220;Stopping<\/span>DESC: <span class=\"katex math inline\">NAME&#8221;<br \/>\ndo_stop<br \/>\necho &#8220;.&#8221;<br \/>\n;;<br \/>\nreload|graceful)<br \/>\necho -n &#8220;Reloading<\/span>DESC configuration&#8230;&#8221;<br \/>\ndo_reload<br \/>\necho &#8220;.&#8221;<br \/>\n;;<br \/>\nrestart)<br \/>\necho -n &#8220;Restarting <span class=\"katex math inline\">DESC:<\/span>NAME&#8221;<br \/>\ndo_stop<br \/>\ndo_start<br \/>\necho &#8220;.&#8221;<br \/>\n;;<br \/>\n*)<br \/>\necho &#8220;Usage: $SCRIPTNAME {start|stop|reload|restart}&#8221; &gt;&amp;2<br \/>\nexit 3<br \/>\n;;<br \/>\nesac<br \/>\nexit 0<\/p><\/blockquote>\n<p>\u5176\u4e2d\uff0c\u9700\u8981\u6ce8\u610f\u51e0\u4e2a\u53d8\u91cf\uff0c\u5206\u522b\u662fPATH\u3001NAME\u3001DAEMON\u3001CONFIGFILE\u3001PIDFILE\u3001SCRIPTNAME\uff0c\u5176\u4e2d\uff0cPATH\u8bbe\u7f6e\u4e3anginx\u7684\u5b89\u88c5\u8def\u5f84\uff0cDAEMON\u8bbe\u7f6e\u4e3anginx\u542f\u52a8\u811a\u672c\u7684\u8def\u5f84\uff0cCONFIGFILE\u662fnginx.conf\u6587\u4ef6\u7684\u8def\u5f84\uff0cPIDFILE\u662f\u8fdb\u7a0b\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u9700\u8981\u4e0enginx.conf\u6587\u4ef6\u4e2d\u7684\u914d\u7f6e\u4e00\u81f4\uff0cSCRIPTNAME\u5219\u662f\u8981\u6307\u5411\u5f53\u524d\u6587\u4ef6\u8def\u5f84\/etc\/init.d\/nginx<br \/>\n\u5c06\u4e0a\u8ff0\u6587\u4ef6\u4fdd\u5b58\u540e\uff0c\u4e00\u5b9a\u8981\u8bb0\u5f97\u7ed9\u5176\u8d4b\u4e88\u53ef\u6267\u884c\u7684\u6743\u9650\uff0c\u5177\u4f53\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>chmod +x \/etc\/init.d\/nginx<\/p><\/blockquote>\n<p>\u81f3\u6b64\uff0c\u6211\u4eec\u5df2\u5c06nginx\u52a0\u5165\u4e86\u7cfb\u7edf\u670d\u52a1\uff0c\u7531\u4e8e\u672c\u6587\u63cf\u8ff0\u7684\u5b9e\u5728CentOS 7\u73af\u5883\u4e0b\u5b89\u88c5\uff0c\u6240\u4ee5\u4e0eCentOS 6\u4e0d\u540c\u7684\u662f\uff0c\u4e0d\u518d\u4f7f\u7528\u7c7b\u4f3c\u4e8e<\/p>\n<blockquote><p>service nginx start<\/p><\/blockquote>\n<p>\u8fd9\u6837\u7684\u547d\u4ee4\u6765\u5f00\u542f\u6216\u8005\u5173\u95ed\u670d\u52a1\uff0c\u800c\u662f\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5f00\u542f\u548c\u5173\u95ed\u670d\u52a1<\/p>\n<blockquote><p>\/bin\/systemctl start nginx<br \/>\n\/bin\/systemctl stop nginx<br \/>\n\/bin\/systemctl reload nginx<\/p><\/blockquote>\n<p>\u82e5\u6b64\u65f6\u65e0\u6cd5\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\uff0c\u9996\u5148\u8981\u786e\u8ba4\u4e4b\u524d\u6253\u5f00\u7684nginx\u8fdb\u7a0b\u5df2\u88ab\u6740\u6b7b\uff0c\u5176\u6b21\u53ef\u4ee5\u5c1d\u8bd5\u5148\u6267\u884c<\/p>\n<blockquote><p>systemctl enable nginx<\/p><\/blockquote>\n<p>\u547d\u4ee4\uff0c\u7136\u540e\u518d\u6267\u884c\u4e0a\u8ff0\u4e09\u4e2a\u547d\u4ee4\u3002<\/p>\n<h2>3.10\u3001\u8bbe\u7f6enginx\u5f00\u673a\u81ea\u542f\u52a8<\/h2>\n<p>\u7ecf\u8fc7\u4e0a\u9762\u7684\u64cd\u4f5c\uff0cnginx\u5df2\u88ab\u6dfb\u52a0\u4e3a\u7cfb\u7edf\u670d\u52a1\uff0c\u6240\u4ee5\u53ef\u4ee5\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f\u52a8\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u907f\u514d\u6bcf\u6b21\u670d\u52a1\u5668\u91cd\u542f\u4e4b\u540e\u9700\u8981\u624b\u52a8\u5f00\u542fnginx\u7684\u64cd\u4f5c\uff0c\u5177\u4f53\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>chkconfig &#8211;add nginx<br \/>\nchkconfig nginx on<\/p><\/blockquote>\n<p>\u6216\u8005<\/p>\n<blockquote><p>systemctl enable nginx<\/p><\/blockquote>\n<h1>4\u3001\u5b89\u88c5php<\/h1>\n<h2>4.1\u3001\u901a\u8fc7yum\u547d\u4ee4\u5b89\u88c5php\u9700\u8981\u7684\u5e38\u7528\u5e93<\/h2>\n<p>\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel<\/p><\/blockquote>\n<h2>4.2\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5php<\/h2>\n<p>\u5b98\u7f51\uff1a<a href=\"http:\/\/php.net\/\">http:\/\/php.net\/<\/a><br \/>\n\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/root\/<br \/>\nwget http:\/\/cn2.php.net\/distributions\/php-7.1.11.tar.gz<br \/>\ntar \u2013zxvf php-7.1.11.tar.gz<\/p><\/blockquote>\n<p>\u4ee5\u4e0a\u547d\u4ee4\u5b8c\u6210\u4e0b\u8f7d\u548c\u89e3\u538b\u64cd\u4f5c\uff0c\u63a5\u4e0b\u6765\u8fdb\u884c\u5b89\u88c5\u64cd\u4f5c<\/p>\n<blockquote><p>cd \/root\/php-7.1.11<br \/>\n.\/configure &#8211;prefix=\/alidata\/server\/php-7.1.11 &#8211;with-config-file-path=\/alidata\/server\/php-7.1.11\/etc &#8211;enable-fpm &#8211;with-mcrypt &#8211;enable-mbstring &#8211;enable-pdo &#8211;with-curl &#8211;disable-debug &#8211;disable-rpath &#8211;enable-inline-optimization &#8211;with-bz2 &#8211;with-zlib &#8211;enable-sockets &#8211;enable-sysvsem &#8211;enable-sysvshm &#8211;enable-pcntl &#8211;enable-mbregex &#8211;with-mhash &#8211;enable-zip &#8211;with-pcre-regex &#8211;with-mysqli &#8211;with-gd &#8211;with-jpeg-dir &#8211;with-freetype-dir &#8211;enable-calendar<br \/>\nmake<br \/>\nmake install<\/p><\/blockquote>\n<h2>4.3\u3001\u8bbe\u7f6ephp\u914d\u7f6e\u6587\u4ef6<\/h2>\n<p>\u5c06\u5b98\u65b9\u63d0\u4f9b\u7684\u914d\u7f6e\u6a21\u677f\u62f7\u8d1d\u5230\u914d\u7f6e\u53c2\u6570\u4e2d\u6240\u6307\u5b9a\u7684\u76ee\u5f55\u4e2d<\/p>\n<blockquote><p>cp \/root\/php-7.1.11\/php.ini-production \/alidata\/server\/php-7.1.11\/etc\/php.ini<\/p><\/blockquote>\n<p>\u7136\u540e\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u670d\u52a1\u5668\u7684\u9700\u6c42\uff0c\u5bf9php.ini\u6587\u4ef6\u7684\u5185\u5bb9\u8fdb\u884c\u4fee\u6539<\/p>\n<h2>4.4\u3001\u8bbe\u7f6ephp-fpm\u914d\u7f6e\u6587\u4ef6<\/h2>\n<p>\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/alidata\/server\/php-7.1.11\/etc<br \/>\ncp php-fpm.conf.default php-fpm.conf<br \/>\ncd \/alidata\/server\/php-7.1.11\/etc\/php-fpm.d<br \/>\ncp www.conf.default www.conf<\/p><\/blockquote>\n<p>\u4f7f\u7528vim\u547d\u4ee4\u5bf9php-fpm.conf\u7684\u5185\u5bb9\u8fdb\u884c\u5982\u4e0b\u4fee\u6539<\/p>\n<blockquote><p>pid= \/alidata\/server\/php-7.1.11\/var\/run\/php-fpm.pid<\/p><\/blockquote>\n<p>\u4f7f\u7528vim\u547d\u4ee4\u5bf9www.conf\u7684\u5185\u5bb9\u8fdb\u884c\u5982\u4e0b\u4fee\u6539<\/p>\n<blockquote><p>user = www<br \/>\ngroup = www<br \/>\nlisten = 127.0.0.1:9000<br \/>\npm.max_children = 100<br \/>\npm.start_servers = 20<br \/>\npm.min_spare_servers = 5<br \/>\npm.max_spare_servers = 35<\/p><\/blockquote>\n<p>\u5176\u4ed6\u914d\u7f6e\u53ef\u6839\u636e\u81ea\u5df1\u7684\u60c5\u51b5\u8fdb\u884c\u76f8\u5e94\u4fee\u6539<\/p>\n<h2>4.5\u3001\u542f\u52a8php-fpm<\/h2>\n<p>\u5b8c\u6210\u4ee5\u4e0a\u914d\u7f6e\u540e\uff0c\u5373\u53ef\u542f\u52a8php-fpm\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>\/alidata\/server\/php-7.1.11\/sbin\/php-fpm<\/p><\/blockquote>\n<p>\u542f\u52a8\u540e\uff0c\u4f7f\u7528<\/p>\n<blockquote><p>ps aux | grep php-fpm<\/p><\/blockquote>\n<p>\u547d\u4ee4\u67e5\u770b\u8fdb\u7a0b\uff0c\u82e5\u80fd\u591f\u770b\u5230\u76f8\u5173\u8fdb\u7a0b\uff0c\u5219\u8bc1\u660e\u542f\u52a8\u6210\u529f\u3002\u67e5\u8be2\u8fdb\u7a0b\u65f6\uff0c\u53ef\u4ee5\u770b\u5230\u8fdb\u7a0b\u662f\u4ee5www\u7528\u6237\u8eab\u4efd\u6267\u884c\u7684<\/p>\n<h2>4.6\u3001\u52a0\u5165\u7cfb\u7edf\u73af\u5883\u53d8\u91cf<\/h2>\n<p>\u4f7f\u7528vim\u547d\u4ee4\u6253\u5f00\/etc\/profile\u6587\u4ef6\uff0c\u5728\u6587\u4ef6\u6700\u672b\u5c3e\u52a0\u4e0a\u5982\u4e0b\u4ee3\u7801<\/p>\n<blockquote><p>export PHP_HOME=\/alidata\/server\/php-7.1.11<br \/>\nexport PATH=<span class=\"katex math inline\">PATH:<\/span>PHP_HOME\/bin:$PHP_HOME\/sbin<\/p><\/blockquote>\n<p>\u4fdd\u5b58\u4fee\u6539\u540e\uff0c\u4f7f\u7528source\u547d\u4ee4\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>source \/etc\/profile<\/p><\/blockquote>\n<p>\u6267\u884c\u4e0a\u8ff0\u547d\u4ee4\u540e\uff0c\u53ef\u4f7f\u7528<\/p>\n<blockquote><p>echo $PATH<\/p><\/blockquote>\n<p>\u547d\u4ee4\u67e5\u770b\u73af\u5883\u53d8\u91cf\u4e2d\u662f\u5426\u5df2\u7ecf\u52a0\u5165\u4e86\u76f8\u5173\u7684\u8def\u5f84<\/p>\n<h2>4.7\u3001\u52a0\u5165\u7cfb\u7edf\u670d\u52a1<\/h2>\n<p>\u4f7f\u7528vim\u547d\u4ee4\u5728\/etc\/init.d\/\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2aphp-fpm\u6587\u4ef6\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>vim \/etc\/init.d\/php-fpm<\/p><\/blockquote>\n<p>\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b<\/p>\n<blockquote><p>#!\/bin\/bash<br \/>\n# php-fpm startup script for the php-fpm<br \/>\n# php-fpm version:7.1.11<br \/>\n# chkconfig: &#8211; 85 15<br \/>\n# description: php-fpm<br \/>\n# processname: php-fpm<br \/>\n# pidfile: \/alidata\/server\/php-7.1.11\/var\/run\/php-fpm.pid<br \/>\n# config: \/alidata\/server\/php-7.1.11\/etc\/php-fpm.conf<\/p>\n<p>php_command=\/alidata\/server\/php-7.1.11\/sbin\/php-fom<br \/>\nphp_config=\/alidata\/server\/php-7.1.11\/etc\/php-fpm.conf<br \/>\nphp_pid=\/alidata\/server\/php-7.1.11\/var\/run\/php-fpm.pid<br \/>\nRETVAL=0<br \/>\nprog=&#8221;php-fpm&#8221;<\/p>\n<p>#start function<br \/>\nphp_fpm_start() {<br \/>\n\/alidata\/server\/php-7.1.11\/sbin\/php-fpm<br \/>\n}<\/p>\n<p>start(){<br \/>\nif [ -e <span class=\"katex math inline\">php_pid ]<br \/>\nthen<br \/>\necho &#8220;php-fpm already start&#8230;&#8221;<br \/>\nexit 1<br \/>\nfi<br \/>\nphp_fpm_start<br \/>\n}<\/p>\n<p>stop(){<br \/>\nif [ -e<\/span>php_pid ]<br \/>\nthen<br \/>\nparent_pid=`cat <span class=\"katex math inline\">php_pid`<br \/>\nall_pid=`ps -ef | grep php-fpm | awk &#8216;{if(&#8216;<\/span>parent_pid&#8217; == <span class=\"katex math inline\">3){print<\/span>2}}&#8217;`<br \/>\nfor pid in <span class=\"katex math inline\">all_pid<br \/>\ndo<br \/>\nkill<\/span>pid<br \/>\ndone<br \/>\nkill <span class=\"katex math inline\">parent_pid<br \/>\nfi<br \/>\nexit 1<br \/>\n}<\/p>\n<p>restart(){<br \/>\nstop<br \/>\nstart<br \/>\n}<\/p>\n<p># See how we were called.<br \/>\ncase &#8220;<\/span>1&#8243; in<br \/>\nstart)<br \/>\nstart<br \/>\n;;<br \/>\nstop)<br \/>\nstop<br \/>\n;;<br \/>\nrestart)<br \/>\nstop<br \/>\nstart<br \/>\n;;<br \/>\nstatus)<br \/>\nstatus <span class=\"katex math inline\">prog<br \/>\nRETVAL=<\/span>?<br \/>\n;;<br \/>\n*)<br \/>\necho <span class=\"katex math inline\">&#8220;Usage:<\/span>prog {start|stop|restart|status}&#8221;<br \/>\nexit 1<br \/>\nesac<br \/>\nexit $RETVAL<\/p><\/blockquote>\n<p>\u5176\u4e2d\uff0cphp_command\u8868\u793aphp-fpm\u53ef\u6267\u884c\u811a\u672c\u7684\u8def\u5f84\uff0cphp_config\u8868\u793aphp-fpm\u7684\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\uff0cphp_pid\u8868\u793aphp-fpm\u8fdb\u7a0b\u6587\u4ef6\u7684\u8def\u5f84<\/p>\n<h2>4.8\u3001\u8bbe\u7f6ephp-fpm\u5f00\u673a\u81ea\u542f\u52a8<\/h2>\n<p>\u7ecf\u8fc7\u4e0a\u9762\u7684\u64cd\u4f5c\uff0cphp-fpm\u5df2\u88ab\u6dfb\u52a0\u4e3a\u7cfb\u7edf\u670d\u52a1\uff0c\u6240\u4ee5\u53ef\u4ee5\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f\u52a8\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u907f\u514d\u6bcf\u6b21\u670d\u52a1\u5668\u91cd\u542f\u4e4b\u540e\u9700\u8981\u624b\u52a8\u5f00\u542fphp-fpm\u7684\u64cd\u4f5c\uff0c\u5177\u4f53\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>chkconfig &#8211;add php-fpm<br \/>\nchkconfig php-fpm on<\/p><\/blockquote>\n<p>\u6216\u8005<\/p>\n<blockquote><p>systemctl enable php-fpm<\/p><\/blockquote>\n<h1>5\u3001\u5b89\u88c5MySQL<\/h1>\n<h2>5.1\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5cmake<\/h2>\n<p>\u5b98\u7f51\uff1a<a href=\"https:\/\/cmake.org\/\">https:\/\/cmake.org\/<\/a><br \/>\n\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/root\/<br \/>\nwget https:\/\/cmake.org\/files\/v3.10\/cmake-3.10.0-rc5.tar.gz<br \/>\ntar \u2013zxvf cmake-3.10.0-rc5.tar.gz<\/p><\/blockquote>\n<p>\u4ee5\u4e0a\u547d\u4ee4\u5b8c\u6210\u4e0b\u8f7d\u548c\u89e3\u538b\u64cd\u4f5c\uff0c\u63a5\u4e0b\u6765\u8fdb\u884c\u5b89\u88c5\u64cd\u4f5c<\/p>\n<blockquote><p>cd cmake-3.10.0-rc5<br \/>\n.\/configure &#8211;prefix=\/alidata\/package\/cmake<br \/>\nmake<br \/>\nmake install<br \/>\nexport PATH=\/package\/cmake\/bin:$PATH<\/p><\/blockquote>\n<h2>5.2\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5ncurses<\/h2>\n<p>\u5b98\u7f51\uff1a<a href=\"http:\/\/invisible-island.net\/ncurses\/\">http:\/\/invisible-island.net\/ncurses\/<\/a><br \/>\n\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/root\/<br \/>\nwget http:\/\/ftp.gnu.org\/gnu\/ncurses\/ncurses-6.0.tar.gz<br \/>\ntar \u2013zxvf ncurses-6.0.tar.gz<\/p><\/blockquote>\n<p>\u4ee5\u4e0a\u547d\u4ee4\u5b8c\u6210\u4e0b\u8f7d\u548c\u89e3\u538b\u64cd\u4f5c\uff0c\u63a5\u4e0b\u6765\u8fdb\u884c\u5b89\u88c5\u64cd\u4f5c<\/p>\n<blockquote><p>cd ncurses-6.0<br \/>\n.\/configure &#8211;prefix=\/alidata\/package\/ncurses<br \/>\nmake<br \/>\nmake install<\/p><\/blockquote>\n<h2>5.3\u3001\u5b89\u88c5libaio\u5e93<\/h2>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>yum install libaio*<\/p><\/blockquote>\n<p>\u5b89\u88c5libaio\u548clibaio-devel\u8fd9\u4e24\u4e2a\u5e93<\/p>\n<h2>5.4\u3001\u4e3aMySQL\u6dfb\u52a0\u7528\u6237\u53ca\u7ec4<\/h2>\n<p>\u4e3a\u4e86\u4fdd\u8bc1\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u5168\uff0c\u8fd9\u91cc\u4e3amysql\u5de5\u4f5c\u8fdb\u7a0b\u521b\u5efa\u4e13\u7528\u7684\u7528\u6237<\/p>\n<blockquote><p>groupadd mysql<br \/>\nuseradd -r -g mysql mysql<\/p><\/blockquote>\n<h2>5.5\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5MySQL<\/h2>\n<p>\u5b98\u7f51\uff1ahttps:\/\/www.mysql.com<br \/>\n\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/root\/<br \/>\nwget https:\/\/dev.mysql.com\/get\/Downloads\/MySQL-5.7\/mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz<br \/>\ntar \u2013zxvf mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz<br \/>\nmv mysql-5.7.20-linux-glibc2.12-x86_64 \/alidata\/server\/mysql-5.7.20\/\u3001<\/p><\/blockquote>\n<p>\u8fd9\u91cc\u4f7f\u7528\u7684\u662fmysql\u5b98\u65b9\u63d0\u4f9b\u7684\u89e3\u538b\u7f29\u7248\u7684\u5b89\u88c5\u65b9\u5f0f\uff0c\u4e0d\u9700\u8981\u8fdb\u884cmake\u64cd\u4f5c\u3002\u5c06mysql\u6587\u4ef6\u5939\u79fb\u52a8\u5230\u5b89\u88c5\u8def\u5f84\u540e\uff0c\u9700\u8981\u4fee\u6539mysql\u5b89\u88c5\u6587\u4ef6\u5939\u7684\u6743\u9650\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>chown \u2013R mysql.mysql \/alidata\/server\/mysql-5.7.20\/<\/p><\/blockquote>\n<p>\u540e\u7eed\u5982\u679c\u5728\u8be5\u76ee\u5f55\u53ca\u5176\u5b50\u76ee\u5f55\u4e0b\u521b\u5efa\u4e86\u4efb\u4f55\u6587\u4ef6\u548c\u6587\u4ef6\u5939\uff0c\u5747\u9700\u8981\u518d\u6b21\u6267\u884c\u8be5\u547d\u4ee4\uff0c\u4ee5\u786e\u4fddmysqld\u8fdb\u7a0b\u5bf9\u8be5\u6587\u4ef6\u5939\u5177\u6709\u5b8c\u5168\u7684\u8bfb\u5199\u6743\u9650<\/p>\n<h2>5.6\u3001\u8bbe\u7f6emysql\u914d\u7f6e\u6587\u4ef6<\/h2>\n<p>mysql\u7684\u914d\u7f6e\u6587\u4ef6\u662f\u653e\u5728\/etc\/\u76ee\u5f55\u4e0b\u7684\uff0c\u540d\u5b57\u662fmy.cnf\uff0c\u5177\u4f53\u914d\u7f6e\u5982\u4e0b<\/p>\n<blockquote><p>[client]<br \/>\nport = 3306<br \/>\nsocket = \/alidata\/server\/mysql-5.7.20\/tmp\/mysql.sock<br \/>\n[mysqld]<br \/>\nbasedir=\/alidata\/server\/mysql-5.7.20<br \/>\ndatadir=\/alidata\/server\/mysql-5.7.20\/data<br \/>\nsocket=\/alidata\/server\/mysql-5.7.20\/tmp\/mysql.sock<br \/>\n#skip-external-locking<br \/>\n# Disabling symbolic-links is recommended to prevent assorted security risks<br \/>\nsymbolic-links=0<br \/>\n# Settings user and group are ignored when systemd is used.<br \/>\n# If you need to run mysqld under a different user or group,<br \/>\n# customize your systemd unit file for mariadb according to the<br \/>\n# instructions in http:\/\/fedoraproject.org\/wiki\/Systemd<br \/>\nlog-error=\/alidata\/logs\/mysql\/error.log<br \/>\npid-file=\/alidata\/logs\/mysql\/mysql.pid<\/p>\n<p>[mysqld_safe]<br \/>\nlog-error=\/alidata\/logs\/mariadb\/error.log<br \/>\npid-file=\/alidata\/logs\/mariadb\/mariadb.pid<\/p>\n<p>#<br \/>\n# include all files from the config directory<br \/>\n#<br \/>\n!includedir \/etc\/my.cnf.d<\/p><\/blockquote>\n<p>\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\uff0c\u914d\u7f6e\u6587\u4ef6\u6700\u540e\u4e00\u884c\u5f15\u5165\u4e86\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e0b\u9762\u5217\u51famy.cnf.d\u76ee\u5f55\u4e0b\u540d\u4e3amysql-clients.cnf\u7684\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9<\/p>\n<blockquote><p>#<br \/>\n# These groups are read by MariaDB command-line tools<br \/>\n# Use it for options that affect only one utility<br \/>\n#<\/p>\n<p>[mysql]<\/p>\n<p>[mysql_upgrade]<\/p>\n<p>[mysqladmin]<\/p>\n<p>[mysqlbinlog]<\/p>\n<p>[mysqlcheck]<\/p>\n<p>[mysqldump]<\/p>\n<p>[mysqlimport]<\/p>\n<p>[mysqlshow]<\/p>\n<p>[mysqlslap]<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p>\u5728my.cnf\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u9700\u8981\u6ce8\u610f\u51e0\u4e2a\u914d\u7f6e\uff0c\u5176\u4e2dbasedir\u6307\u7684\u662fmysql\u7684\u5b89\u88c5\u76ee\u5f55\uff0cdatadir\u6307\u7684\u662fmysql\u6570\u636e\u6587\u4ef6\u7684\u5b58\u50a8\u76ee\u5f55\uff0c\u5176\u4ed6\u51e0\u9879\u914d\u7f6e\u9879\uff0c\u5982\u679c\u5927\u5bb6\u611f\u5174\u8da3\u53ef\u4ee5\u81ea\u884c\u67e5\u770b\u5b98\u65b9\u89e3\u91ca\u3002\u8fd8\u9700\u8981\u7279\u522b\u8bf4\u660e\u7684\u4e00\u4e2a\u95ee\u9898\u662f\uff0c\u6240\u6709\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u51fa\u73b0\u7684\u8def\u5f84\u3001\u6587\u4ef6\u5747\u9700\u8981\u5177\u6709\u53ef\u8bfb\u5199\u7684\u6743\u9650\uff0c\u524d\u9762\u4e3aMySQL\u521b\u5efa\u4e86\u7528\u6237\u53ca\u7ec4\uff0c\u6240\u4ee5\u4e0a\u8ff0\u914d\u7f6e\u6587\u4ef6\u4e2d\u6d89\u53ca\u5230\u7684\u8def\u5f84\u548c\u6587\u4ef6\uff0c\u5747\u9700\u8981\u5c06\u5176\u6240\u6709\u8005\u53ca\u7ec4\u6307\u5b9a\u4e3amysql\u7528\u6237\uff0c\u8fd9\u6837MySQL\u670d\u52a1\u624d\u80fd\u6b63\u5e38\u542f\u52a8\u3002<br \/>\n\u5b8c\u6210\u4ee5\u4e0a\u914d\u7f6e\u540e\uff0c\u9700\u8981\u5c06mysqld\u7684\u542f\u52a8\u811a\u672c\u653e\u5165\/etc\/init.d\/\u8def\u5f84\u4e2d\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cp \u2013a \/alidata\/server\/mysql-5.7.20\/support-files\/mysql.server \/etc\/init.d\/mysqld<\/p><\/blockquote>\n<p>\u62f7\u8d1d\u5b8c\u6210\u540e\uff0c\u4f7f\u7528vim\u547d\u4ee4\uff0c\u4fee\u6539\/etc\/init.d\/mysqld\u4e2d\u7684basedir\u548cdatadir\uff0c\u786e\u4fdd\u5176\u503c\u4e0emy.cnf\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u76f8\u540c<\/p>\n<h2>5.7\u3001\u521d\u59cb\u5316MySQL<\/h2>\n<p>\u56e0\u672c\u6587\u91c7\u7528\u7684\u662fMySQL 5.7.20\u7248\u672c\uff0c\u6240\u4ee5\u4e0d\u80fd\u4f7f\u7528mysql_install_db\u547d\u4ee4\uff0c\u800c\u662f\u9700\u8981\u4f7f\u7528mysqld \u2013initialize\u547d\u4ee4\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u5177\u4f53\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>\/alidata\/server\/mysql-5.7.20\/bin\/mysqld \u2013initialize &#8211;user=mysql &#8211;basedir=\/alidata\/server\/mysql-5.7.20\/ &#8211;datadir=\/alidata\/server\/mysql-5.7.20\/data\/<\/p><\/blockquote>\n<p>\u82e5\u524d\u9762\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u5404\u914d\u7f6e\u9879\u5747\u6b63\u786e\uff0c\u5404\u8def\u5f84\u3001\u6587\u4ef6\u5747\u5b58\u5728\u5e76\u53ef\u8bfb\u5199\uff0c\u6539\u547d\u4ee4\u5c06\u63d0\u793a\u6267\u884c\u6210\u529f\uff0c\u5e76\u80fd\u591f\u5728\/root\/\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a.mysql_secret\u6587\u4ef6\uff0c\u4f7f\u7528cat\u547d\u4ee4\u53ef\u67e5\u770b\u5176\u5185\u5bb9\uff0c\u5176\u662fmysql\u4e2d\u672c\u5730root\u7528\u6237\u7684\u521d\u59cb\u5bc6\u7801\u3002\u8fd9\u91cc\u9700\u8981\u7279\u522b\u8bf4\u660e\u4e00\u4e0b\uff0c\u672c\u6587\u4f5c\u8005\u4f7f\u7528mysql\u81ea\u52a8\u751f\u6210\u521d\u59cb\u5bc6\u7801\u6ca1\u6709\u767b\u5f55\u6210\u529f\uff0c\u7136\u540e\u901a\u8fc7\u5b89\u5168\u542f\u52a8\u811a\u672c\u5bf9mysql\u7684root\u7528\u6237\u5bc6\u7801\u8fdb\u884c\u4fee\u6539\u540e\uff0c\u624d\u80fd\u591f\u6b63\u5e38\u767b\u5f55\u548c\u4f7f\u7528\uff0c\u6240\u4ee5\u8fd9\u4e00\u6b65\u76ee\u524d\u65e0\u6cd5\u5f97\u5230\u786e\u8ba4\uff0c\u5927\u5bb6\u53ef\u6839\u636e\u81ea\u5df1\u7684\u5b9e\u9645\u60c5\u51b5\u5904\u7406\u3002<\/p>\n<h2>5.8\u3001\u4f7f\u7528\u5b89\u5168\u6a21\u5f0f\u542f\u52a8MySQL<\/h2>\n<p>\u5728mysql\u5b89\u88c5\u76ee\u5f55\u7684bin\u76ee\u5f55\u4e0b\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8mysql<\/p>\n<blockquote><p>.\/mysqld_safe &#8211;user=mysql &amp;<\/p><\/blockquote>\n<p>\u542f\u52a8\u540e\uff0c\u4f7f\u7528\u521d\u59cb\u5316\u6240\u5f97\u7684root\u5bc6\u7801\u767b\u5f55mysql\uff0c\u67e5\u770b\u662f\u5426\u53ef\u4ee5\u6b63\u5e38\u64cd\u4f5c\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n<blockquote><p>.\/mysql \u2013uroot \u2013p<\/p><\/blockquote>\n<h2>5.9\u3001\u8bbe\u7f6eMySQL\u670d\u52a1\u5f00\u673a\u81ea\u542f<\/h2>\n<p>\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>cd \/alidata\/server\/mysql-5.7.20\/bin\/<br \/>\nchkconfig &#8211;level 35 mysqld on<\/p><\/blockquote>\n<h2>5.10\u3001\u542f\u52a8MySQL\u670d\u52a1<\/h2>\n<p>\u524d\u6587\u4f7f\u7528\u7684\u662f\u5b89\u5168\u6a21\u5f0f\u542f\u52a8\uff0c\u73b0\u5728\uff0c\u9700\u8981\u8ba9MySQL\u670d\u52a1\u6b63\u5e38\u542f\u52a8\uff0c\u9996\u5148\uff0c\u901a\u8fc7\u547d\u4ee4<\/p>\n<blockquote><p>ps aux | grep mysql<\/p><\/blockquote>\n<p>\u67e5\u627e\u5230\u901a\u8fc7mysqld_safe\u547d\u4ee4\u542f\u52a8\u7684\u8fdb\u7a0b\uff0c\u4f7f\u7528kill\u547d\u4ee4\u5c06\u5176\u5168\u90e8\u6740\u6389\uff0c\u7136\u540e\u4f7f\u7528<\/p>\n<blockquote><p>\/etc\/init.d\/mysqld start<\/p><\/blockquote>\n<p>\u547d\u4ee4\uff0c\u542f\u52a8MySQL\u670d\u52a1\uff0c\u63a5\u4e0b\u6765\uff0c\u5c31\u8bf7\u4f7f\u7528root\u7528\u6237\u767b\u5f55\uff0c\u7136\u540e\u8fdb\u884c\u521b\u5efa\u7528\u6237\uff0c\u521b\u5efa\u6570\u636e\u5e93\uff0c\u8d4b\u6743\u7b49\u64cd\u4f5c\uff0c\u8fd9\u90e8\u5206\u5c5e\u4e8eMySQL\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u672c\u6587\u4e0d\u518d\u8d58\u8ff0\u3002<\/p>\n<h1>6\u3001\u914d\u7f6eNginx+PHP+MySQL<\/h1>\n<p>\u4e0eApache\u670d\u52a1\u5668\u4e0d\u540c\u7684\u662f\uff0cNginx\u672c\u8eab\u5e76\u4e0d\u89e3\u91ca\u3001\u8fd0\u884cPHP\u4ee3\u7801\uff0cNginx\u53ea\u662f\u5c06\u7528\u6237\u7aef\u53d1\u6765\u7684HTTP\u8bf7\u6c42\u8fdb\u884c\u8f6c\u53d1\uff0c\u771f\u6b63\u89e3\u91ca\u8fd0\u884cPHP\u4ee3\u7801\u7684\u662fphp-fpm\u8fdb\u7a0b\uff0c\u6240\u4ee5\uff0c\u8fd9\u91cc\u53ea\u9700\u8981\u5c06Nginx\u6536\u5230\u7684http\u8bf7\u6c42\u8f6c\u53d1\u7ed9php-fpm\u5373\u53ef\u3002<br \/>\n\u6839\u636e\u672c\u6587\u524d\u5e8f\u6b65\u9aa4\uff0c\u5df2\u7ecf\u5b8c\u6210\u4e86Nginx\u548cPHP\u7684\u5b89\u88c5\u548c\u914d\u7f6e\uff0c\u63a5\u4e0b\u6765\uff0c\u53ea\u9700\u8981\u5728Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u52a0\u5165\u8f6c\u53d1\u81f3php-fpm\u7684\u914d\u7f6e\u5373\u53ef\u3002<\/p>\n<h2>6.1\u3001\u914d\u7f6eNginx+PHP<\/h2>\n<p>\u672c\u6587\u4e2d\u5bf9Nginx\u8fdb\u884c\u4e86\u591a\u57df\u540d\u914d\u7f6e\uff0c\u6bcf\u4e2a\u57df\u540d\u53ea\u9700\u8981\u5728\/alidata\/server\/nginx-1.12.2\/conf\/vhosts\u76ee\u5f55\u4e0b\u6709\u4e00\u4e2a\u81ea\u5df1\u7684\u914d\u7f6e\u6587\u4ef6\u5373\u53ef\uff0c\u6240\u4ee5\u91cd\u70b9\u5c31\u5728\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u91cc\uff0c\u73b0\u5728\u5047\u5b9a\u6211\u4eec\u9700\u8981\u67e5\u770b\u5f53\u524d\u670d\u52a1\u5668\u7684php\u4fe1\u606f\uff0c\u56e0\u4e3a\u672c\u6587\u6ca1\u6709\u6d89\u53ca\u5230\u57df\u540d\u89e3\u6790\u53ca\u914d\u7f6e\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u6240\u4ee5\u8fd9\u91cc\u5c31\u4ee5IP\u8bbf\u95ee\u4e3a\u4f8b\u8fdb\u884c\u914d\u7f6e\u8bb2\u89e3\uff0c\u9996\u5148\uff0c\u9700\u8981\u5728\u6211\u4eec\u7684web\u4ee3\u7801\u6839\u8def\u5f84\/alidata\/webapps\u4e0b\u521b\u5efa\u4e00\u4e2ainfo.php\u6587\u4ef6\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<blockquote><p>vim \/alidata\/webapps\/info.php<\/p><\/blockquote>\n<p>\u6587\u4ef6\u5185\u5bb9\u662f\u4e00\u6bb5\u975e\u5e38\u7b80\u5355\u7684php\u4ee3\u7801<\/p>\n<blockquote><p>&lt;?php<br \/>\necho phpinfo();<br \/>\n?&gt;<\/p><\/blockquote>\n<p>\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u5bf9Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u4fee\u6539\uff0c\u524d\u6587\u5df2\u7ecf\u5728\/alidata\/server\/nginx-1.12.2\/conf\/vhosts\u76ee\u5f55\u4e0b\u521b\u5efa\u4e86default.conf\u914d\u7f6e\u6587\u4ef6\uff0c\u73b0\u5728\u5bf9\u8fd9\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u8fdb\u884c\u4fee\u6539\uff0c\u4fee\u6539\u540e\u7684\u5185\u5bb9\u5982\u4e0b<\/p>\n<blockquote><p>server {<br \/>\nlisten 80;<br \/>\nserver_name localhost;<br \/>\nindex index.php index.htm index.html;<br \/>\nroot \/alidata\/webapps;<br \/>\nlocation ~ .*\\.(php|php5)?<span class=\"katex math inline\">{<br \/>\n#fastcgi_pass unix:\/tmp\/php-cgi.sock;<br \/>\nfastcgi_pass 127.0.0.1:9000;<br \/>\nfastcgi_index index.php;<br \/>\ninclude fastcgi.conf;<br \/>\n}<br \/>\nlocation ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)<\/span><br \/>\n{<br \/>\nexpires 30d;<br \/>\n}<br \/>\nlocation ~ .*\\.(js|css)?$<br \/>\n{<br \/>\nexpires 1h;<br \/>\n}<br \/>\n# \u914d\u7f6e\u9875\u9762\u9759\u6001\u5316<br \/>\ninclude \/alidata\/server\/nginx-1.12.2\/conf\/rewrite\/default.conf;<br \/>\naccess_log \/alidata\/logs\/nginx\/access\/default.log;<br \/>\nerror_log \/alidata\/logs\/nginx\/error\/default.log;<br \/>\n}<\/p><\/blockquote>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u4e0e\u4e4b\u524d\u7684\u914d\u7f6e\u6587\u4ef6\u76f8\u6bd4\uff0c\u4e3b\u8981\u662findex\u914d\u7f6e\u9879\u540e\uff0c\u591a\u4e86\u5173\u4e8ephp\u7684\u914d\u7f6e\u5185\u5bb9\uff0c\u4ee5\u53calocation\u76f8\u5173\u914d\u7f6e\u4e2d\uff0c\u591a\u4e86\u5bf9\u4e8ephp\u7684\u5185\u5bb9\uff0c\u4fdd\u5b58\u4ee5\u4e0a\u914d\u7f6e\u6587\u4ef6\uff0c\u4f7f\u7528<\/p>\n<blockquote><p>systemctl reload nginx<\/p><\/blockquote>\n<p>\u547d\u4ee4\uff0c\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eehttp:\/\/\u670d\u52a1\u5668\u7684IP\/info.php\u5373\u53ef\u770b\u5230\u4e0a\u6587\u4e2dphp\u4ee3\u7801\u7684\u8fd0\u884c\u6548\u679c\uff0c\u5177\u4f53\u5982\u4e0b\u56fe\u6240\u793a<\/p>\n<p><a href=\"https:\/\/www.softeng.cn\/wp-content\/uploads\/2017\/11\/111.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-158\" src=\"https:\/\/www.softeng.cn\/wp-content\/uploads\/2017\/11\/111.png\" alt=\"\" width=\"1920\" height=\"1039\" srcset=\"https:\/\/www.softeng.cn\/wp-content\/uploads\/2017\/11\/111.png 1920w, https:\/\/www.softeng.cn\/wp-content\/uploads\/2017\/11\/111-300x162.png 300w, https:\/\/www.softeng.cn\/wp-content\/uploads\/2017\/11\/111-768x416.png 768w, https:\/\/www.softeng.cn\/wp-content\/uploads\/2017\/11\/111-1024x554.png 1024w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>\u81f3\u6b64\uff0c\u5373\u5b8c\u6210\u4e86Nginx\u548cPHP\u7684\u914d\u7f6e\uff0c\u8fd9\u91cc\u9700\u8981\u8bf4\u660e\uff0c\u4e0a\u8ff0\u7684\u914d\u7f6e\u53ea\u662f\u6700\u7b80\u5355\u7684\u914d\u7f6e\uff0c\u82e5\u9879\u76ee\u4e0d\u662f\u8fd0\u884c\u5728web\u6839\u76ee\u5f55\u4e0b\u7684\uff0c\u90a3\u4e48\u914d\u7f6e\u6587\u4ef6\u4e5f\u9700\u8981\u5bf9\u5e94\u7684\u8fdb\u884c\u4fee\u6539\uff0c\u82e5\u9879\u76ee\u662f\u91c7\u7528CodeIgniter\u6216Laravel\u7b49\u5176\u4ed6\u6846\u67b6\u6280\u672f\u5f00\u53d1\u7684\uff0c\u90a3\u4e48\u4e5f\u9700\u8981\u5bf9\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u76f8\u5e94\u4fee\u6539\uff0c\u8fd9\u90e8\u5206\u5185\u5bb9\u5927\u5bb6\u53ef\u81ea\u884c\u767e\u5ea6\uff0c\u6709\u5f88\u591a\u76f8\u5173\u7684\u535a\u5ba2\u3002<\/p>\n<h2>6.2\u3001\u5173\u4e8eMySQL\u914d\u7f6e\u7684\u8bf4\u660e<\/h2>\n<p>\u6b63\u5982\u524d\u6587\u6240\u8bf4\uff0cNginx\u7684\u5de5\u4f5c\u4e3b\u8981\u662f\u8f6c\u53d1\u8bf7\u6c42\uff0c\u6240\u4ee5MySQL\u7684\u914d\u7f6e\u4e5f\u4ec5\u4ec5\u9700\u8981\u5728PHP\u4e2d\u5b89\u88c5\u76f8\u5173\u6269\u5c55\uff0c\u53ea\u8981\u901a\u8fc7PHP\u4ee3\u7801\u53ef\u4ee5\u8bbf\u95ee\u5230MySQL\u5373\u53ef\uff0c\u4e0d\u9700\u8981\u518d\u8fdb\u884c\u5176\u4ed6\u7279\u6b8a\u7684\u914d\u7f6e\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6240\u4ee5\uff0c\u5230\u8fd9\u91cc\u4e5f\u5c31\u5b8c\u6210\u4e86Nginx+PHP+MySQL\u7684\u73af\u5883\u5b89\u88c5\u548c\u914d\u7f6e\uff0c\u5982\u679c\u5404\u4f4d\u8fd8\u6709\u4ec0\u4e48\u95ee\u9898\u548c\u5efa\u8bae\uff0c\u6b22\u8fce\u7559\u8a00\u4ea4\u6d41\u3002<\/p>\n  \n  \n  ","protected":false},"excerpt":{"rendered":"<p>1\u3001\u524d\u8a00 \u672c\u6587\u9002\u5408\u4e8e\u5df2\u7ecf\u5bf9Linux\u64cd\u4f5c\u7cfb\u7edf\u5177\u6709\u57fa\u672c\u64cd\u4f5c\u7ecf\u9a8c\uff0c\u5e76\u4e14\u80fd\u591f\u5728Linux\u6216Windows\u4e0a\u901a\u8fc7\u4e00\u952e\u642d&hellip;<a href=\"https:\/\/www.softeng.cn\/?p=156\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u5728CentOS 7\u4e0b\u7f16\u8bd1\u5b89\u88c5Nginx+PHP+MySQL\u73af\u5883<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[21,20,23,22,6,24],"class_list":["post-156","post","type-post","status-publish","format-standard","hentry","category-19","tag-centos","tag-linux","tag-mysql","tag-nginx","tag-php","tag-24"],"_links":{"self":[{"href":"https:\/\/www.softeng.cn\/index.php?rest_route=\/wp\/v2\/posts\/156"}],"collection":[{"href":"https:\/\/www.softeng.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.softeng.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.softeng.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softeng.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=156"}],"version-history":[{"count":3,"href":"https:\/\/www.softeng.cn\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":160,"href":"https:\/\/www.softeng.cn\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions\/160"}],"wp:attachment":[{"href":"https:\/\/www.softeng.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softeng.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softeng.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}