{"id":462,"date":"2024-12-02T17:34:26","date_gmt":"2024-12-02T09:34:26","guid":{"rendered":"http:\/\/192.168.5.24\/?p=462"},"modified":"2024-12-03T17:56:32","modified_gmt":"2024-12-03T09:56:32","slug":"%e6%90%ad%e5%bb%balnmp%e5%b9%b3%e5%8f%b0%e5%b9%b6%e9%83%a8%e7%bd%b2wordpress","status":"publish","type":"post","link":"https:\/\/bigvip.dpdns.org\/?p=462","title":{"rendered":"\u642d\u5efaLNMP\u5e73\u53f0\u5e76\u90e8\u7f72wordpress"},"content":{"rendered":"\n<p>\u4e00\u3001\u7f16\u8bd1\u5b89\u88c5Nginx<\/p>\n\n\n\n<p>\u5148\u5b89\u88c5\u4f9d\u8d56<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> yum -y install gcc gcc-c++* openssl openssl-devel zlib zlib-devel pcre pcre-devel libxml2 libxml2-devel libxslt-devel  perl-devel perl-ExtUtils-Embed  gd-devel GeoIP GeoIP-devel GeoIP-data ncurses ncurses-devel libtool-ltdl-devel libjpeg-devel libpng-devel libtiff-devel fontconfig-devel freetype-devel libXpm-devel gettext-devel<\/code><\/pre>\n\n\n\n<p>\u89e3\u538b\u7f16\u8bd1\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -zxvf nginx-1.16.1.tar.gz \ncd nginx-1.16.1\nuseradd -M -s \/sbin\/nologin nginx\n\\\\\u914d\u7f6e\u65f6\u6307\u5b9aworker\u8fdb\u7a0b\u8fd0\u884c\u7528\u6237\u53ca\u7ec4\u4e3anginx\n.\/configure --prefix=\/usr\/local\/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module\nmake &amp;&amp; make install<\/code><\/pre>\n\n\n\n<p>\u914d\u7f6e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u4e3b\u914d\u7f6e\u6587\u4ef6\uff1a\/usr\/local\/nginx\/conf\/nginx.conf\n&#91;root@T2 qingmei]# grep -Ev \"^&#91;&#91;:space:]]*(#|$)\" \/usr\/local\/nginx\/conf\/nginx.conf\n\/\/\u521d\u59cbworkder\u6570\u91cf\nworker_processes  1;\n\/\/\u6307\u5b9apid\u6587\u4ef6\npid        logs\/nginx.pid;\nevents {\n\/\/\u6bcf\u4e2aworker\u6700\u591a\u63a5\u53d7\u7684\u8fde\u63a5\u6570\n    worker_connections  1024;\n}\nhttp {\n    include       mime.types;\n    default_type  application\/octet-stream;\n    sendfile        on;\n    keepalive_timeout  65;\n    server {\n        listen       80;\n\/\/\u57df\u540d\n        server_name  www.qingmei.com;\n\/\/\u7f51\u7ad9\u6587\u6863\u6839\n        root   html\/qingmei;\n        access_log  logs\/qingmei.access.log;\n        location \/ {\n\/\/\u8bbe\u7f6e\u9ed8\u8ba4\u6587\u6863\u9875\n            index  index.html index.htm index.php;\n        }\n        error_page   500 502 503 504  \/50x.html;\n        location = \/50x.html {\n            root   html;\n        }\n\/\/\u8bbe\u7f6ephp\u6587\u4ef6\u7684\u5904\u7406\u65b9\u5f0f\n        location ~ \\.php$ {\n            fastcgi_pass   127.0.0.1:9000;\n            fastcgi_index  index.php;\n            fastcgi_param  SCRIPT_FILENAME  \/<strong>$document_root<\/strong>$fastcgi_script_name;\n<strong>\/\/$document_root    \u8fd9\u662fnginx\u7cfb\u7edf\u7684\u4e00\u4e2a\u7cfb\u7edf\u53d8\u91cf\uff0c\u8868\u793a\u6587\u6863\u6839\u76ee\u5f55\uff0c\u4e5f\u5c31\u662f\u9ed8\u8ba4\u7684\/usr\/local\/nginx\/html\n\/\/$fastcgi_script_name    nginx\u7cfb\u7edf\u7684\u4e00\u4e2a\u7cfb\u7edf\u53d8\u91cf\uff0c\u8868\u793a\u6587\u4ef6\u540d<\/strong>\n            include        fastcgi_params;\n        }\n    }\n    server {\n        listen       80;\n\/\/\u7b2c\u4e8c\u4e2a\u865a\u62df\u4e3b\u673a\u7684\u57df\u540d\n        server_name  www.guimei.com;\n        access_log  logs\/guimei.access.log;\n        location \/ {\n            root   html\/guimei;\n            index  index.html index.htm;\n        }\n        error_page   500 502 503 504  \/50x.html;\n        location = \/50x.html {\n            root   html;\n        }\n        location = \/status{\n            stub_status on;\n            access_log off;\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u5e38\u7528\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tnginx -h #\u67e5\u770bnginx\u547d\u4ee4\u53c2\u6570\n\tnginx -v #\u67e5\u770bnginx\u7248\u672c\n\tnginx -V #\u67e5\u770b\u7248\u672c\u8be6\u7ec6\u4fe1\u606f\uff0c\u5e76\u52a0\u4e0a\u5b89\u88c5\u914d\u7f6e\u65f6\u53c2\u6570\n\tnginx -t #\u68c0\u6d4b\u914d\u7f6e\u6587\u4ef6\n\tnginx -T #\u68c0\u6d4b\u5e76\u6253\u5370\u51fa\u914d\u7f6e\u6587\u4ef6\n\tnginx -q #\u5728\u6d4b\u8bd5\u671f\u95f4\u4e0d\u8f93\u51fa\u975e\u9519\u8bef\u63d0\u793a\u3002\n\tnginx -s\uff08\u5e38\u7528\uff09 #\u53d1\u9001\u4fe1\u53f7\u7ed9\u4e3b\u8fdb\u7a0b\uff1astop\u5f3a\u5236\u9000\u51fa\uff0cquit\u4f18\u96c5\u7684\u9000\u51fa reopen\u91cd\u5f00\u65e5\u5fd7\uff0creload \u91cd\u65b0\u88c5\u8f7d\u914d\u7f6e\u3002\t\t-s stop ,-s quit -s reopen -s reload\n\tnginx -p  prefix #\u8bbe\u7f6enginx\u5b89\u88c5\u76ee\u5f55\n\tnginx -c filename #\u6307\u5b9a\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u3002\n\tnginx -g directives # \u5728\u914d\u7f6e\u6587\u4ef6\u4e4b\u5916\u8bbe\u7f6e\u5168\u5c40\u547d\u4ee4\u3002<\/code><\/pre>\n\n\n\n<p>\u4e8c\u3001\u5b89\u88c5PHP<\/p>\n\n\n\n<p>\u5b89\u88c5PHP\u4e4b\u524d\u5148\u5b89\u88c5mysql\uff0c\u53ef\u4ee5\u53c2\u7167\u4e4b\u524d\u7684\u6587\u7ae0\uff0c\u6b64\u5904\u7565\u8fc7\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u5148\u5b89\u88c5\u4f9d\u8d56\uff1a\nyum -y install libxml2-devel libjpeg-devel libpng-devel freetype-devel curl-devel openssl-devel sqlite-devel  oniguruma oniguruma-devel\n\u521b\u5efa\u7528\u6237\uff1a\nuseradd -M -s \/sbin\/nologin www\n\u89e3\u538b\u914d\u7f6e\uff1a\n.\/configure --prefix=\/usr\/local\/php --with-config-file-path=\/usr\/local\/php\/etc --enable-fpm --with-fpm-user=www  --with-fpm-group=www --enable-mysqlnd  --with-mysqli   --with-pdo-mysql --with-iconv-dir  --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp  --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts \n\n\u7f16\u8bd1\u3001\u5b89\u88c5\uff1a\n\u200b\tmake &amp;&amp; make install<\/code><\/pre>\n\n\n\n<p>\u51c6\u5907\u914d\u7f6e\u6587\u4ef6\u53ca\u914d\u7f6e\u670d\u52a1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u4f7f\u7528php-fpm\u8fdb\u884c\u7ba1\u7406php\u670d\u52a1\uff0c\u6709\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\uff1a\n\nphp.ini            #\u9ed8\u8ba4\u7684PHP\u914d\u7f6e\u6587\u4ef6\n\nphp-fpm.conf       #php-fpm\u76f8\u5173\u7684\u914d\u7f6e\n\n  1\uff09\u590d\u5236\u914d\u7f6e\u6587\u4ef6\uff1a\n\u200b\tcp \/usr\/local\/php\/etc\/php-fpm.conf.default  \/usr\/local\/php\/etc\/php-fpm.conf\n\u200b\tcp \/usr\/local\/php\/etc\/php-fpm.d\/www.conf.default   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\n\u200b&#91;root@T1 php-7.3.9]# cp php.ini-development \/usr\/local\/php\/etc\/php.ini\n\n  2\uff09\u6dfb\u52a0\u73af\u5883\u53d8\u91cf\uff1a\n\n\u200b\t\techo 'PATH=\/usr\/local\/php\/bin:$PATH'&gt;&gt;\/etc\/profile\n\u200b\t\tsource   \/etc\/profile<\/code><\/pre>\n\n\n\n<p>\u4e09\u3001\u5b89\u88c5wordpress<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u628awordpress\u89e3\u538b\u5230\/usr\/local\/nginx\/html\u76ee\u5f55\u4e0b\nunzip wordpress-5.6-zh_CN.zip -d \/usr\/local\/nginx\/html\/\nmv \/usr\/local\/nginx\/html\/wordpress \/usr\/local\/nginx\/html\/qingmei\n\n\u521b\u5efa\u6570\u636e\u5e93wp\uff1a\nmysql -uroot -p -e \"CREATE DATABASE IF NOT EXISTS wp;\"\n\n\u6d4f\u89c8\u5668\u6253\u5f00URL\uff1ahttp:\/\/www.qingmei.com\/wp-admin\/setup-config.php\n\u6839\u636e\u63d0\u793a\u64cd\u4f5c\u5373\u53ef\uff0c\u7136\u540e\u628a\u751f\u6210\u7684\u7f51\u7ad9\u914d\u7f6e\u4fe1\u606f\u590d\u5236\u4fdd\u5b58\u5230\u6587\u6863\u6839\u76ee\u5f55\u7684wp-config.php\u6587\u4ef6\u4e2d\n\u7136\u540e\u91cd\u65b0\u5237\u65b0\u6d4f\u89c8\u5668\uff0c\u6839\u636e\u63d0\u793a\u4e00\u6b65\u6b65\u5b8c\u6210\u5b89\u88c5\u3002\n\n<strong>\u6ce8\u610f<\/strong>\uff1a<strong>1\u3001\u6570\u636e\u5982\u679c\u4f7f\u7528localhost\u65e0\u6cd5\u8fde\u63a5\u53ef\u4ee5\u4fee\u6539\u4e3a127.0.0.1<\/strong>\n      <strong>2\u3001\u5b89\u88c5\u5b8cwordpress\u540e\u4e0d\u8981\u518d\u6b21\u79fb\u52a8nginx\u7684\u6587\u6863\u6839\u3002<\/strong><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"719\" height=\"563\" src=\"http:\/\/192.168.5.24\/wp-content\/uploads\/2024\/12\/image.png\" alt=\"\" class=\"wp-image-481\" srcset=\"https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2024\/12\/image.png 719w, https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2024\/12\/image-300x235.png 300w\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u7f16\u8bd1\u5b89\u88c5Nginx \u5148\u5b89\u88c5\u4f9d\u8d56 \u89e3\u538b\u7f16\u8bd1\u5b89\u88c5 \u914d\u7f6e \u5e38\u7528\u547d\u4ee4 \u4e8c\u3001\u5b89\u88c5PHP \u5b89\u88c5PHP\u4e4b\u524d\u5148\u5b89\u88c5mysq [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[20,31,36],"tags":[77,24],"class_list":["post-462","post","type-post","status-publish","format-aside","hentry","category-linux","category-web","category-36","tag-lnmp","tag-wordpress","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=462"}],"version-history":[{"count":17,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":499,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/462\/revisions\/499"}],"wp:attachment":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}