{"id":41846,"date":"2025-06-05T07:30:50","date_gmt":"2025-06-04T23:30:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/41846.html"},"modified":"2025-06-05T07:30:50","modified_gmt":"2025-06-04T23:30:50","slug":"%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%ae-nginx-%e5%92%8c-mysql-%e4%b8%80%e6%ad%a5%e4%b8%80%e6%ad%a5%e9%85%8d%e7%bd%ae-ubuntu-server-%e7%9a%84-nodejs-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/41846.html","title":{"rendered":"\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556"},"content":{"rendered":"<h3>\u524d\u8a00<\/h3>\n<p>\u6628\u5929\u66f4\u65b0\u4e86\u56db\u7bc7\u535a\u5ba2&#xff0c;\u6211\u4eec\u987a\u5229\u7684 \u5b89\u88c5\u4e86 ubuntu server \u670d\u52a1\u5668&#xff0c;\u5e76\u4e14\u914d\u7f6e\u597d\u4e86 ssh \u514d\u5bc6\u767b\u5f55\u670d\u52a1\u5668&#xff0c;\u5b89\u88c5\u597d\u4e86 \u670d\u52a1\u5668\u5e38\u7528\u8f6f\u4ef6\u5b89\u88c5, \u914d\u7f6e\u597d\u4e86 zsh \u548c vim \u4ee5\u53ca \u901a\u8fc7 NVM \u5b89\u88c5\u597dNodejs&#xff0c;\u8fd8\u6709PNPM\u5305\u7ba1\u7406\u5de5\u5177  \u3002<\/p>\n<p>\u4f5c\u4e3a\u670d\u52a1\u5668\u7684\u8fd0\u884c&#xff0c;\u4e00\u5b9a\u5c11\u4e0d\u4e86 Nginx \u8fd9\u6b3e\u63d0\u4f9b HTTP \u548c\u53cd\u5411\u4ee3\u7406\u7684\u7684 Web \u670d\u52a1\u5668\u8f6f\u4ef6\u3002\u5728\u6570\u636e\u5e93\u65b9\u9762&#xff0c;MySQL \u662f\u6211\u4eec\u6700\u5e38\u7528\u7684\u6570\u636e\u5e93\u8f6f\u4ef6&#xff0c;\u4eca\u5929&#xff0c;\u6211\u4eec\u5c31\u6765\u5b89\u88c5\u548c\u914d\u7f6e\u8fd9\u4e24\u6b3e\u6211\u4eec\u6240\u9700\u8981\u7684\u670d\u52a1\u3002<\/p>\n<h3>\u5b89\u88c5 Nginx<\/h3>\n<p>\u9996\u5148&#xff0c;\u6211\u4eec\u901a\u8fc7\u7ec8\u7aef\u767b\u5f55\u670d\u52a1\u5668&#xff0c;\u7136\u540e\u5f00\u59cb\u6267\u884c\u5982\u4e0b\u547d\u4ee4<\/p>\n<p><span class=\"token comment\"># \u66f4\u65b0\u8f6f\u4ef6\u6e90\u5217\u8868<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<br \/>\n<span class=\"token comment\"># \u5347\u7ea7\u5df2\u6709\u8f6f\u4ef6\u5305<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> upgrade <span class=\"token parameter variable\">-y<\/span><br \/>\n<span class=\"token comment\">## \u4e0a\u9762\u4e24\u6b65\u5efa\u8bae\u8fc7\u4e00\u6bb5\u65f6\u95f4\u6216\u8005\u5728\u5b89\u88c5\u65b0\u7684\u8f6f\u4ef6\u4e4b\u524d\u8981\u6267\u884c\u4e00\u4e0b\u3002<\/span><br \/>\n<span class=\"token comment\">## \u56e0\u4e3a\u6211\u4eec\u6628\u5929\u6267\u884c\u8fc7&#xff0c;\u5e76\u975e\u4e00\u5b9a\u8981\u6267\u884c\u3002<\/span><\/p>\n<p><span class=\"token comment\"># \u5b89\u88c5 Nginx<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> nginx <span class=\"token parameter variable\">-y<\/span><br \/>\n<span class=\"token comment\"># \u542f\u52a8 Nginx \u670d\u52a1<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl start nginx<br \/>\n<span class=\"token comment\"># \u5c06 Nginx \u670d\u52a1\u8bbe\u7f6e\u4e3a\u5f00\u673a\u542f\u52a8<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> nginx<br \/>\n<span class=\"token comment\"># \u9a8c\u8bc1 Nginx \u542f\u52a8\u72b6\u6001<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl status nginx<\/p>\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u547d\u4ee4&#xff0c;\u6211\u4eec\u5df2\u7ecf\u987a\u5229\u5b89\u88c5\u597d\u4e86 Nginx&#xff0c;\u4e0b\u56fe\u5c31\u662f Nginx \u7684\u8fd0\u884c\u72b6\u6001\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233045-6840d72559731.png\" alt=\"NGINX \u8fd0\u884c\u72b6\u6001\" \/><\/p>\n<p>\u7136\u540e&#xff0c;\u6211\u4eec\u901a\u8fc7\u8bbf\u95ee http:\/\/192.168.8.7 \u8fd9\u4e2a\u5185\u7f51 IP&#xff0c;\u5c31\u53ef\u4ee5\u770b\u5230\u5df2\u7ecf\u6b63\u5e38\u8fd0\u884c\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233045-6840d725cc300.png\" alt=\"\u9ed8\u8ba4\u7ad9\u70b9\u5df2\u7ecf\u8fd0\u884c\" \/><\/p>\n<h3>Nginx \u7684\u4e00\u4e9b\u5e38\u7528\u914d\u7f6e<\/h3>\n<p>Nginx \u7684\u914d\u7f6e\u662f\u4e00\u4e2a\u975e\u5e38\u590d\u6742\u7684\u4e8b\u60c5&#xff0c;\u60f3\u8981\u8be6\u7ec6\u7684\u4e86\u89e3&#xff0c;\u53ef\u4ee5\u53c2\u8003\u5b83\u7684\u5b98\u65b9\u7f51\u7ad9\u7684\u6587\u6863&#xff1a;https:\/\/nginx.org\/en\/docs\/<\/p>\n<p>\u6211\u8fd9\u8fb9\u53ea\u63d0\u51e0\u4e2a\u54b1\u4eec\u524d\u7aef\u7ecf\u5e38\u7528\u5230\u7684\u914d\u7f6e\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u914d\u7f6e\u6587\u4ef6\u4f4d\u4e8e \/etc\/nginx\/nginx.conf \u8fd9\u91cc\u3002\u6211\u4eec\u76f4\u63a5\u7f16\u8f91\u8fd9\u4e2a\u6587\u4ef6\u5373\u53ef\u3002<\/p>\n<p>Linux \u4e0b&#xff0c;\u5927\u591a\u6570\u7684\u8f6f\u4ef6\u7684\u914d\u7f6e\u6587\u4ef6\u90fd\u5728 \/etc \u76ee\u5f55\u4e0b\u3002<\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49 Nginx \u5de5\u4f5c\u8fdb\u7a0b\u7684\u8fd0\u884c\u7528\u6237\u4e3a www-data \u8d26\u6237<\/span><br \/>\nuser www-data<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\"># \u8bbe\u7f6e\u5de5\u4f5c\u8fdb\u7a0b\u6570\u91cf\u4e3a auto&#xff08;\u81ea\u52a8\u5339\u914d CPU \u6838\u5fc3\u6570&#xff0c;\u4f18\u5316\u6027\u80fd&#xff09;<\/span><br \/>\nworker_processes auto<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\"># \u6307\u5b9a\u9519\u8bef\u65e5\u5fd7\u5b58\u50a8\u8def\u5f84\u4e3a<\/span><br \/>\nerror_log \/var\/log\/nginx\/error.log<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\"># \u8bb0\u5f55\u4e3b\u8fdb\u7a0b ID \u7684\u5b58\u50a8\u4f4d\u7f6e&#xff08;\u7528\u4e8e\u670d\u52a1\u7ba1\u7406<\/span><br \/>\npid \/run\/nginx.pid<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\"># \u5f15\u5165\u4e00\u4e9b\u6a21\u5757\u7684\u914d\u7f6e\u6587\u4ef6.<\/span><br \/>\ninclude \/usr\/share\/nginx\/modules\/*.conf<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\"># \u8bbe\u7f6e\u5355\u4e2a\u5de5\u4f5c\u8fdb\u7a0b\u7684\u6700\u5927\u5e76\u53d1\u8fde\u63a5\u6570\u4e3a 1024<\/span><br \/>\nevents <span class=\"token punctuation\">{<\/span><br \/>\n    worker_connections <span class=\"token number\">1024<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\">## \u4ee5\u4e0a\u914d\u7f6e\u6211\u52a0\u4e86\u6ce8\u91ca&#xff0c;\u4f46\u4e00\u822c\u60c5\u51b5\u4e0b&#xff0c;\u4fdd\u6301\u9ed8\u8ba4\u5373\u53ef&#xff0c;\u4e0d\u9700\u8981\u8c03\u6574<\/span><\/p>\n<p>http <span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token comment\"># \u5b9a\u4e49\u65e5\u5fd7\u7684\u683c\u5f0f&#xff0c;\u53ef\u6839\u636e\u60c5\u51b5\u81ea\u884c\u8c03\u6574<\/span><br \/>\n    log_format  main  <span class=\"token string\">&#039;$remote_addr &#8211; $remote_user [$time_local] &#034;$request&#034; &#039;<\/span><br \/>\n                      <span class=\"token string\">&#039;$status $body_bytes_sent &#034;$http_referer&#034; &#039;<\/span><br \/>\n                      <span class=\"token string\">&#039;&#034;$http_user_agent&#034; &#034;$http_x_forwarded_for&#034;&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\"># \u65e5\u5fd7\u6587\u4ef6\u5b58\u50a8\u4f4d\u7f6e<\/span><br \/>\n    access_log  \/var\/log\/nginx\/access.log  main<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\"># \u542f\u7528\u96f6\u62f7\u8d1d\u6587\u4ef6\u4f20\u8f93&#xff08;\u51cf\u5c11\u5185\u6838\u6001\u4e0e\u7528\u6237\u6001\u6570\u636e\u62f7\u8d1d&#xff09;<\/span><br \/>\n    sendfile            on<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\"># \u4f18\u5316 TCP \u6570\u636e\u5305\u53d1\u9001\u7b56\u7565<\/span><br \/>\n    tcp_nopush          on<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\"># \u7981\u7528 Nagle \u7b97\u6cd5&#xff0c;\u964d\u4f4e\u5c0f\u6570\u636e\u5305\u4f20\u8f93\u5ef6\u8fdf<\/span><br \/>\n    tcp_nodelay         on<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\"># \u8bbe\u7f6e Keep-Alive \u8fde\u63a5\u8d85\u65f6\u4e3a 65 \u79d2<\/span><br \/>\n    keepalive_timeout   <span class=\"token number\">65<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\"># \u6269\u5c55 MIME \u7c7b\u578b\u54c8\u5e0c\u8868\u5927\u5c0f&#xff0c;\u63d0\u5347\u5904\u7406\u6027\u80fd<\/span><br \/>\n    types_hash_max_size <span class=\"token number\">2048<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\"># \u52a0\u8f7d\u9884\u5b9a\u4e49\u7684 MIME \u7c7b\u578b\u6620\u5c04\u6587\u4ef6<\/span><br \/>\n    include             \/etc\/nginx\/mime.types<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\"># \u9ed8\u8ba4\u54cd\u5e94\u7c7b\u578b\u4e3a\u4e8c\u8fdb\u5236\u6d41&#xff08;\u672a\u8bc6\u522b\u7c7b\u578b\u65f6\u4f7f\u7528&#xff09;<\/span><br \/>\n    default_type        application\/octet-stream<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\"># \u9650\u5236\u5ba2\u6237\u7aef\u8bf7\u6c42\u4f53\u6700\u5927\u4e3a 20MB &#xff08;\u4e0a\u4f20\u6587\u4ef6\u5927\u5c0f\u63a7\u5236&#xff09;<\/span><br \/>\n    client_max_body_size 20M<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\"># \u5f15\u5165\u4e00\u4e9b\u6a21\u5757\u7684\u914d\u7f6e\u6587\u4ef6<\/span><br \/>\n    include \/etc\/nginx\/conf.d\/*.conf<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\">## \u4ee5\u4e0a\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e&#xff0c;\u53ef\u4ee5\u6309\u9700\u8c03\u6574<\/span><\/p>\n<p><span class=\"token comment\"># server \u662f\u4e00\u4e2a\u7ad9\u70b9\u7684\u914d\u7f6e<\/span><br \/>\n<span class=\"token comment\"># \u6bcf\u4e00\u4e2a server \u53ef\u4ee5\u5904\u7406\u4e00\u4e2a\u7279\u5b9a\u7684\u670d\u52a1<\/span><br \/>\n<span class=\"token comment\">## \u4e0b\u9762\u7b2c\u4e00\u4e2a\u7ad9\u70b9\u7684\u914d\u7f6e<\/span><br \/>\n    server <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\"># \u76d1\u542c 80 \u7aef\u53e3<\/span><br \/>\n        listen       <span class=\"token number\">80<\/span> default_server<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\"># \u76d1\u542c ipv6 \u7684 80 \u7aef\u53e3<\/span><br \/>\n        listen       <span class=\"token punctuation\">[<\/span>::<span class=\"token punctuation\">]<\/span>:80 default_server<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\"># \u7b2c\u4e00\u4e2a\u7ad9\u70b9\u914d\u7f6e\u7684\u57df\u540d&#xff0c;\u591a\u4e2a\u57df\u540d\u7528\u7a7a\u683c\u5206\u9694&#xff0c;\u672b\u5c3e\u8981\u6709\u5206\u53f7<\/span><br \/>\n        server_name  fungleo.com www.fungleo.com<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\"># \u7f51\u7ad9\u6587\u4ef6\u76ee\u5f55&#xff08;\u6211\u8fd9\u4e2a\u914d\u7f6e\u6ca1\u7528\u5230&#xff0c;\u4fdd\u6301\u4e86\u9ed8\u8ba4&#xff09;<\/span><br \/>\n        root         \/usr\/share\/nginx\/html<span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\"># \u52a0\u8f7d\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6&#xff0c;\u6211\u6ca1\u7ba1.<\/span><br \/>\n        include \/etc\/nginx\/default.d\/*.conf<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\"># \u8bbf\u95ee\u57df\u540d\u6839\u7684\u65f6\u5019&#xff0c;\u53cd\u5411\u4ee3\u7406\u5230 3888 \u7aef\u53e3\u7684\u670d\u52a1<\/span><br \/>\n<span class=\"token comment\"># \u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u4e0a\u9762\u7684\u7f51\u7ad9\u6587\u4ef6\u76ee\u5f55\u6211\u8bf4\u6211\u6ca1\u7528\u5230\u7684\u539f\u56e0<\/span><br \/>\nlocation \/ <span class=\"token punctuation\">{<\/span><br \/>\n          proxy_pass   http:\/\/127.0.0.1:3888<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token comment\"># \u5c06 \/api \u53cd\u5411\u4ee3\u7406\u5230 3000 \u7aef\u53e3\u7684 \/api<\/span><br \/>\n        location ^~ \/api <span class=\"token punctuation\">{<\/span><br \/>\n          proxy_pass   http:\/\/127.0.0.1:3000\/api<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token comment\"># \u5c06 \/upfile \u53cd\u5411\u4ee3\u7406\u5230 3000 \u7aef\u53e3\u7684 \/upfile<\/span><br \/>\n        location ^~ \/upfile <span class=\"token punctuation\">{<\/span><br \/>\n          proxy_pass   http:\/\/127.0.0.1:3000\/upfile<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token comment\"># \u5c06 \/user \u6307\u5411\u5230\u4e86 \/srv\/web-site\/fungleo\/user-fe \u76ee\u5f55<\/span><br \/>\n        <span class=\"token comment\"># \u8fd9\u662f\u4e00\u4e2a\u7528 vue \u5f00\u53d1\u7684 spa \u7c7b\u578b\u7684\u9879\u76ee<\/span><br \/>\n        location \/user <span class=\"token punctuation\">{<\/span><br \/>\n          <span class=\"token builtin class-name\">alias<\/span> \/srv\/web-site\/fungleo\/user-fe<span class=\"token punctuation\">;<\/span><br \/>\n          <span class=\"token comment\"># \u7531\u4e8e\u8be5\u9879\u76ee\u5165\u53e3\u662f index.html \u6587\u4ef6&#xff0c;<\/span><br \/>\n          <span class=\"token comment\"># \u6240\u4ee5\u5982\u679c\u8bbf\u95ee \/user\/love \u8fd9\u6837\u7684\u8def\u5f84\u4f1a\u627e\u4e0d\u5230\u6587\u4ef6<\/span><br \/>\n          <span class=\"token comment\"># \u6240\u4ee5&#xff0c;\u8981\u5c06\u6240\u6709\u7684\u8bf7\u6c42\u6307\u5411\u5230 index.html \u6587\u4ef6<\/span><br \/>\n          <span class=\"token comment\"># \u53c2\u8003\u6587\u6863 https:\/\/router.vuejs.org\/zh\/guide\/essentials\/history-mode#nginx<\/span><br \/>\n          try_files <span class=\"token variable\">$uri<\/span> <span class=\"token variable\">$uri<\/span>\/ \/user\/index.html<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u5f02\u5e38\u9519\u8bef\u914d\u7f6e<\/span><br \/>\n        error_page <span class=\"token number\">404<\/span> \/404.html<span class=\"token punctuation\">;<\/span><br \/>\n            location <span class=\"token operator\">&#061;<\/span> \/40x.html <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        error_page <span class=\"token number\">500<\/span> <span class=\"token number\">502<\/span> <span class=\"token number\">503<\/span> <span class=\"token number\">504<\/span> \/50x.html<span class=\"token punctuation\">;<\/span><br \/>\n            location <span class=\"token operator\">&#061;<\/span> \/50x.html <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\"># \u7b2c\u4e8c\u4e2a\u7ad9\u70b9\u7684\u914d\u7f6e<\/span><br \/>\nserver <span class=\"token punctuation\">{<\/span><br \/>\n        server_name manage.fungleo.com<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\"># \u57df\u540d\u6839\u914d\u7f6e<\/span><br \/>\n        location \/ <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\"># \u6587\u4ef6\u76ee\u5f55<\/span><br \/>\n            root \/srv\/web-site\/fungleo\/manage-fe<span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token comment\"># \u9ed8\u8ba4\u9996\u9875\u6587\u4ef6<\/span><br \/>\n            index index.html Index.html<span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token comment\"># \u548c\u4e0a\u9762\u4e00\u6837<\/span><br \/>\n            try_files <span class=\"token variable\">$uri<\/span> <span class=\"token variable\">$uri<\/span>\/ \/index.html<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token comment\"># \u4e0b\u9762\u662f\u4e24\u4e2a\u53cd\u5411\u4ee3\u7406&#xff0c;\u4e0d\u91cd\u590d\u6ce8\u91ca\u4e86\u3002<\/span><br \/>\n        location ^~ \/api <span class=\"token punctuation\">{<\/span><br \/>\n          proxy_pass   http:\/\/127.0.0.1:3000\/api<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        location ^~ \/upfile <span class=\"token punctuation\">{<\/span><br \/>\n          proxy_pass   http:\/\/127.0.0.1:3000\/upfile<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n     <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u7531\u4e8e\u6211\u4eec\u641e\u670d\u52a1\u5668&#xff0c;\u53ea\u662f\u5185\u7f51\u6d4b\u8bd5\u4f7f\u7528&#xff0c;\u771f\u6b63\u90e8\u7f72\u751f\u4ea7&#xff0c;\u8fd8\u662f\u4ea4\u7ed9\u8fd0\u7ef4\u6bd4\u8f83\u7a33\u59a5&#xff0c;\u6240\u4ee5&#xff0c;\u6211\u8fd9\u91cc\u6ca1\u6709\u8bb2 ssl \u7684\u5185\u5bb9\u3002 \u5982\u679c\u8981\u6df1\u5165\u8fd9\u4e00\u90e8\u5206&#xff0c;\u53ef\u4ee5\u53bb https:\/\/github.com\/acmesh-official\/acme.sh\/ \u8fd9\u91cc&#xff0c;\u6709\u5168\u5957\u7684\u89e3\u51b3\u65b9\u6848\u548c\u6587\u6863\u3002<\/p>\n<h3>\u5b89\u88c5 Mysql<\/h3>\n<p>\u76ee\u524d\u5f88\u6d41\u884c Docker \u5b89\u88c5&#xff0c;\u4e5f\u6bd4\u8f83\u7b80\u5355\u3002\u53ea\u662f\u73b0\u5728\u56fd\u5185\u7531\u4e8e\u7f51\u7edc\u7684\u4e00\u4e9b\u7279\u6b8a\u539f\u56e0&#xff0c;\u901f\u5ea6\u6bd4\u8f83\u6162\u3002\u6240\u4ee5&#xff0c;\u6211\u8fd9\u8fb9\u8fd8\u662f\u4f7f\u7528\u6b63\u5e38\u7684\u5b89\u88c5\u65b9\u5f0f\u3002<\/p>\n<p><span class=\"token comment\"># \u5b89\u88c5 Mysql<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> mysql-server <span class=\"token parameter variable\">-y<\/span><br \/>\n<span class=\"token comment\"># \u542f\u52a8 Mysql<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl start mysql<br \/>\n<span class=\"token comment\"># \u8bbe\u7f6e Mysql \u670d\u52a1\u5f00\u673a\u81ea\u542f<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> mysql<br \/>\n<span class=\"token comment\"># \u9a8c\u8bc1 Nginx \u542f\u52a8\u72b6\u6001<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl status mysql<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233046-6840d72624aef.png\" alt=\"\u5b89\u88c5 Mysql\" \/><\/p>\n<h3>Mysql \u914d\u7f6e<\/h3>\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u547d\u4ee4&#xff0c;\u6211\u4eec\u5df2\u7ecf\u987a\u5229\u5b89\u88c5\u597d\u4e86 Mysql&#xff0c;\u4e0b\u9762\u8981\u5bf9 Mysql \u8fdb\u884c\u4e00\u4e9b\u521d\u59cb\u8bbe\u7f6e&#xff0c;\u6211\u4eec\u8fd0\u884c sudo mysql_secure_installation \u547d\u4ee4\u5f00\u59cb\u3002<\/p>\n<p><span class=\"token comment\"># Mysql \u521d\u59cb\u8bbe\u7f6e\u547d\u4ee4<\/span><br \/>\n<span class=\"token function\">sudo<\/span> mysql_secure_installation<br \/>\n<span class=\"token comment\"># \u8fd4\u56de\u5982\u4e0b\u5185\u5bb9&#xff0c;\u95ee\u4f60\u662f\u5426\u5f00\u542f\u9ad8\u5bc6\u7801\u9a8c\u8bc1&#xff0c;\u6211\u4eec\u8f93\u5165 Y<\/span><\/p>\n<p>Securing the MySQL server deployment.<\/p>\n<p>Connecting to MySQL using a blank password.<\/p>\n<p>VALIDATE PASSWORD COMPONENT can be used to <span class=\"token builtin class-name\">test<\/span> passwords<br \/>\nand improve security. It checks the strength of password<br \/>\nand allows the <span class=\"token function\">users<\/span> to <span class=\"token builtin class-name\">set<\/span> only those passwords <span class=\"token function\">which<\/span> are<br \/>\nsecure enough. Would you like to setup VALIDATE PASSWORD component?<\/p>\n<p>Press y<span class=\"token operator\">|<\/span>Y <span class=\"token keyword\">for<\/span> Yes, any other key <span class=\"token keyword\">for<\/span> No:<\/p>\n<p><span class=\"token comment\"># \u8f93\u5165 Y \u4ee5\u540e&#xff0c;\u53c8\u8fd4\u56de\u4e86\u5982\u4e0b\u5185\u5bb9&#xff0c;\u6211\u4eec\u8f93\u5165 2 \u9009\u62e9\u6700\u5f3a<\/span><br \/>\nThere are three levels of password validation policy:<\/p>\n<p>LOW    Length <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">8<\/span><br \/>\nMEDIUM Length <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">8<\/span>, numeric, mixed case, and special characters<br \/>\nSTRONG Length <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">8<\/span>, numeric, mixed case, special characters and dictionary                  <span class=\"token function\">file<\/span><\/p>\n<p>Please enter <span class=\"token number\">0<\/span> <span class=\"token operator\">&#061;<\/span> LOW, <span class=\"token number\">1<\/span> <span class=\"token operator\">&#061;<\/span> MEDIUM and <span class=\"token number\">2<\/span> <span class=\"token operator\">&#061;<\/span> STRONG:<\/p>\n<p><span class=\"token comment\"># \u544a\u8bc9\u6211\u4eec&#xff0c;\u6ca1\u6709\u4e3a Root \u7528\u6237\u8bbe\u7f6e\u5bc6\u7801&#xff0c;\u5982\u679c\u9700\u8981\u8bbe\u7f6e&#xff0c;\u53ef\u4ee5\u4f7f\u7528 &#034;ALTER_USER&#034; \u547d\u4ee4\u8bbe\u7f6e\u3002<\/span><br \/>\n<span class=\"token comment\"># \u9ed8\u8ba4 root \u7528\u6237\u4f7f\u7528 auth_socket \u65b9\u5f0f\u767b\u5f55<\/span><br \/>\nSkipping password <span class=\"token builtin class-name\">set<\/span> <span class=\"token keyword\">for<\/span> root as authentication with auth_socket is used by default.<br \/>\nIf you would like to use password authentication instead, this can be <span class=\"token keyword\">done<\/span> with the <span class=\"token string\">&#034;ALTER_USER&#034;<\/span> command.<br \/>\nSee https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/alter-user.html<span class=\"token comment\">#alter-user-password-management for more information.<\/span><\/p>\n<p>By default, a MySQL installation has an anonymous user,<br \/>\nallowing anyone to log into MySQL without having to have<br \/>\na user account created <span class=\"token keyword\">for<\/span> them. This is intended only <span class=\"token keyword\">for<\/span><br \/>\ntesting, and to <span class=\"token function\">make<\/span> the installation go a bit smoother.<br \/>\nYou should remove them before moving into a production<br \/>\nenvironment.<\/p>\n<p><span class=\"token comment\"># \u662f\u5426\u5220\u9664  anonymous \u7528\u6237&#xff0c;\u6211\u4eec\u8f93\u5165 Y<\/span><br \/>\nRemove anonymous users? <span class=\"token punctuation\">(<\/span>Press y<span class=\"token operator\">|<\/span>Y <span class=\"token keyword\">for<\/span> Yes, any other key <span class=\"token keyword\">for<\/span> No<span class=\"token punctuation\">)<\/span> <span class=\"token builtin class-name\">:<\/span><\/p>\n<p>Normally, root should only be allowed to connect from<br \/>\n<span class=\"token string\">&#039;localhost&#039;<\/span><span class=\"token builtin class-name\">.<\/span> This ensures that someone cannot guess at<br \/>\nthe root password from the network.<\/p>\n<p><span class=\"token comment\"># \u662f\u5426\u7981\u6b62 root \u7528\u6237\u8fdc\u7a0b\u767b\u5f55&#xff0c;\u6211\u4eec\u8f93\u5165 Y<\/span><br \/>\nDisallow root login remotely? <span class=\"token punctuation\">(<\/span>Press y<span class=\"token operator\">|<\/span>Y <span class=\"token keyword\">for<\/span> Yes, any other key <span class=\"token keyword\">for<\/span> No<span class=\"token punctuation\">)<\/span> <span class=\"token builtin class-name\">:<\/span><\/p>\n<p><span class=\"token comment\"># \u662f\u5426\u5220\u9664\u6d4b\u8bd5\u6570\u636e\u5e93&#xff0c;\u6211\u4eec\u8f93\u5165 Y<\/span><br \/>\nBy default, MySQL comes with a database named <span class=\"token string\">&#039;test&#039;<\/span> that<br \/>\nanyone can access. This is also intended only <span class=\"token keyword\">for<\/span> testing,<br \/>\nand should be removed before moving into a production<br \/>\nenvironment.<\/p>\n<p>Remove <span class=\"token builtin class-name\">test<\/span> database and access to it? <span class=\"token punctuation\">(<\/span>Press y<span class=\"token operator\">|<\/span>Y <span class=\"token keyword\">for<\/span> Yes, any other key <span class=\"token keyword\">for<\/span> No<span class=\"token punctuation\">)<\/span> <span class=\"token builtin class-name\">:<\/span><\/p>\n<p><span class=\"token comment\"># \u662f\u5426\u91cd\u8f7d\u6743\u9650\u8868 &#xff0c;\u6211\u4eec\u8f93\u5165 Y<\/span><br \/>\n &#8211; Dropping <span class=\"token builtin class-name\">test<\/span> database<span class=\"token punctuation\">..<\/span>.<br \/>\nSuccess.<\/p>\n<p> &#8211; Removing privileges on <span class=\"token builtin class-name\">test<\/span> database<span class=\"token punctuation\">..<\/span>.<br \/>\nSuccess.<\/p>\n<p>Reloading the privilege tables will ensure that all changes<br \/>\nmade so far will take effect immediately.<\/p>\n<p>Reload privilege tables now? <span class=\"token punctuation\">(<\/span>Press y<span class=\"token operator\">|<\/span>Y <span class=\"token keyword\">for<\/span> Yes, any other key <span class=\"token keyword\">for<\/span> No<span class=\"token punctuation\">)<\/span> <span class=\"token builtin class-name\">:<\/span><\/p>\n<p><span class=\"token comment\"># \u544a\u8bc9\u6211\u4eec\u6210\u529f\u4e86&#xff0c;\u5168\u90e8\u5e72\u5b8c\u3002<\/span><br \/>\nSuccess.<\/p>\n<p>All done<span class=\"token operator\">!<\/span><\/p>\n<h3>\u547d\u4ee4\u884c\u8fde\u63a5 Mysql \u670d\u52a1<\/h3>\n<p>\u597d&#xff0c;Mysql \u5df2\u7ecf\u914d\u7f6e\u6210\u529f\u4e86\u3002\u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u767b\u5f55\u770b\u4e00\u4e0b<\/p>\n<p><span class=\"token comment\"># \u56e0\u4e3a\u91c7\u7528 auth_socket \u65b9\u5f0f\u767b\u5f55&#xff0c;\u56e0\u6b64\u65e0\u9700\u5bc6\u7801<\/span><br \/>\n<span class=\"token function\">sudo<\/span> mysql <span class=\"token parameter variable\">-u<\/span> root<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233046-6840d72666624.png\" alt=\"\u767b\u5f55Mysql\" \/> \u6ca1\u6709\u5bc6\u7801&#xff0c;\u76f4\u63a5\u91c7\u7528\u7cfb\u7edf\u7528\u6237\u767b\u5f55&#xff0c;\u8fd8\u662f\u611f\u89c9\u5230\u4e0d\u592a\u65b9\u4fbf&#xff0c;\u6240\u4ee5&#xff0c;\u6211\u4eec\u8bbe\u7f6e\u4e00\u4e0b\u5bc6\u7801<\/p>\n<h4>\u8bbe\u7f6e Mysql root \u7528\u6237\u5bc6\u7801<\/h4>\n<p><span class=\"token comment\"># \u8bbe\u7f6e\u5bc6\u7801<\/span><br \/>\nALTER <span class=\"token environment constant\">USER<\/span> <span class=\"token string\">&#039;root&#039;<\/span>&#064;<span class=\"token string\">&#039;localhost&#039;<\/span> IDENTIFIED WITH mysql_native_password BY <span class=\"token string\">&#039;\u4f60\u7684\u5f3a\u5bc6\u7801&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\"># \u5237\u65b0\u6743\u9650<\/span><br \/>\nFLUSH PRIVILEGES<span class=\"token punctuation\">;<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233046-6840d7269e2f2.png\" alt=\"\u8bbe\u7f6e Mysql Root \u7528\u6237\u5bc6\u7801\" \/><\/p>\n<h3>\u7528 Navicat \u8fde\u63a5 Mysql \u670d\u52a1<\/h3>\n<p>Navicat \u662f\u4e00\u6b3e\u975e\u5e38\u597d\u7528\u7684\u6570\u636e\u5e93\u8f6f\u4ef6\u3002\u5728\u4ee5\u5f80&#xff0c;\u6211\u4eec\u7ecf\u5e38\u4f7f\u7528\u5b83\u7684\u7834\u89e3\u7248&#xff0c;\u4f46\u662f\u73b0\u5728&#xff0c;\u5b98\u65b9\u5df2\u7ecf\u653e\u51fa\u4e86 Navicat Premium Lite \u7248\u672c\u7684\u514d\u8d39\u7248&#xff0c;\u56e0\u6b64&#xff0c;\u5927\u5bb6\u5c31\u4e0d\u8981\u627e\u7834\u89e3\u7248\u4e86\u3002<\/p>\n<p>\u6839\u636e\u6211\u7684\u8bd5\u7528&#xff0c;\u5176\u514d\u8d39\u7248\u662f\u8db3\u591f\u6211\u4eec\u65e5\u5e38\u5f00\u53d1\u4f7f\u7528\u7684&#xff0c;\u5e76\u4e14&#xff0c;\u5b83\u662f\u5b8c\u5168\u652f\u6301 Mac\u3001Windows\u3001Linux \u5168\u5e73\u53f0\u7684&#xff0c;\u56e0\u6b64\u6211\u5f3a\u70c8\u63a8\u8350\u54e6&#xff01;<\/p>\n<p>\u5b98\u7f51\u4ecb\u7ecd\u4ee5\u53ca\u4e0b\u8f7d\u5730\u5740&#xff1a;https:\/\/www.navicat.com\/en\/products\/navicat-premium-lite<\/p>\n<p>\u6211\u4eec\u5728\u672c\u673a\u6253\u5f00 Navicat \u8f6f\u4ef6&#xff0c;\u65b0\u5efa Mysql \u8fde\u63a5&#xff0c;\u6253\u5f00\u5982\u4e0b\u56fe\u7684\u9762\u677f&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233046-6840d726e4a6f.png\" alt=\"\u586b\u5199 Mysql \u670d\u52a1\u57fa\u7840\u4fe1\u606f\" \/> \u5728\u9762\u677f\u4e2d&#xff0c;\u6211\u4eec\u586b\u5199\u57fa\u7840\u4fe1\u606f\u3002\u7136\u540e\u70b9\u51fb SSH \u6807\u7b7e&#xff0c;\u7136\u540e\u6309\u7167\u4e0b\u56fe\u8fdb\u884c\u8bbe\u7f6e&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233047-6840d727bcbba.png\" alt=\"\u8fde\u63a5 MYSQL \u7684 SSH \u8bbe\u7f6e\" \/><\/p>\n<p>\u901a\u8fc7\u914d\u7f6e SSH \u96a7\u9053&#xff0c;\u5c31\u53ef\u4ee5\u6b63\u5e38\u8fde\u63a5 MySQL \u6570\u636e\u5e93\u4e86\u3002\u5982\u4e0b\u56fe\u6240\u793a&#xff0c;\u5df2\u7ecf\u987a\u5229\u767b\u5f55\u4e86\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233048-6840d72894e00.png\" alt=\"\u6210\u529f\u8fde\u63a5 Mysql \u6570\u636e\u5e93\" \/><\/p>\n<h3>\u5c0f\u7ed3<\/h3>\n<p>\u901a\u8fc7\u8fd9\u7bc7\u6587\u7ae0&#xff0c;\u6211\u76f8\u4fe1\u5404\u4f4d\u770b\u5b98\u5df2\u7ecf\u57fa\u672c\u638c\u63e1\u4e86 Nginx \u548c Mysql \u7684\u5b89\u88c5\u548c\u57fa\u672c\u7684\u8bbe\u7f6e\u548c\u8fde\u63a5\u4e86\u3002<\/p>\n<p>\u6211\u7684\u4ee5\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u4e3a\u4e3b\u9898\u7684\u7cfb\u5217\u6587\u7ae0&#xff0c;\u76ee\u524d\u5df2\u7ecf\u5b8c\u6210\u516d\u7bc7&#xff0c;\u5927\u5bb6\u559c\u6b22\u7684\u8bdd&#xff0c;\u4e00\u5b9a\u8981\u591a\u591a\u70b9\u8d5e\u6536\u85cf&#xff0c;\u8bc4\u8bba\u7559\u8a00&#xff0c;\u5173\u6ce8\u6211\u54e6&#xff01;\u8c22\u8c22\u5927\u5bb6&#xff01;<\/p>\n<p>\u5927\u6982\u76ee\u5f55\u5982\u4e0b&#xff1a;<\/p>\n<p>\u300aPVE\u865a\u62df\u673a \u5b89\u88c5 Ubuntu Server \u7cfb\u7edf\u300b \u300aSSH \u914d\u7f6e&#xff0c;\u8ba9\u6211\u4eec\u8fdc\u7a0b\u8fde\u4e0a\u865a\u62df\u673a\u300b \u300a\u670d\u52a1\u5668\u8f6f\u4ef6\u66f4\u65b0&#xff0c;\u4ee5\u53ca\u5e38\u7528\u8f6f\u4ef6\u5b89\u88c5\u300b \u300a\u914d\u7f6e\u670d\u52a1\u5668\u7ec8\u7aef\u73af\u5883 zsh , oh my zsh, vim\u300b \u300aNVM \u5b89\u88c5 NodeJS\u73af\u5883&#xff0c;\u4ee5\u53ca PNPM \u7684\u5b89\u88c5\u300b \u300aNginx \u548c Mysql \u7684\u5b89\u88c5\u548c\u914d\u7f6e\u300b \u300apm2 \u670d\u52a1\u7aef\u8fdb\u7a0b\u7ba1\u7406\u7684\u4f7f\u7528\u548c\u914d\u7f6e\u300b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx\u4e0eMySQL\u670d\u52a1\u3002\u9996\u5148\u901a\u8fc7apt\u547d\u4ee4\u5b89\u88c5Nginx\u5e76\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\uff0c\u8be6\u7ec6\u8bb2\u89e3\u4e86Nginx\u7684\u5e38\u7528\u914d\u7f6e\uff0c\u5305\u62ec\u5de5\u4f5c\u8fdb\u7a0b\u3001\u65e5\u5fd7\u683c\u5f0f\u3001\u53cd\u5411\u4ee3\u7406\u7b49\u3002\u968f\u540e\u5b89\u88c5MySQL\u670d\u52a1\u5e76\u914d\u7f6e\u81ea\u542f\u52a8\u3002\u6587\u7ae0\u91cd\u70b9\u89e3\u6790\u4e86Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u7ed3\u6784\uff0c\u63d0\u4f9b\u4e86\u591a\u7ad9\u70b9\u914d\u7f6e\u793a\u4f8b\uff0c\u6db5\u76d6\u57df\u540d\u7ed1\u5b9a\u3001\u9759\u6001\u6587\u4ef6\u670d\u52a1\u3001\u53cd\u5411\u4ee3\u7406\u548cSPA\u5e94\u7528\u652f\u6301\u7b49\u5e38\u89c1\u573a\u666f\u3002\u9002\u7528\u4e8e\u5f00\u53d1\u73af\u5883\u642d\u5efa\uff0c\u4f46\u5efa\u8bae\u751f\u4ea7\u73af\u5883\u7531\u4e13\u4e1a\u8fd0\u7ef4\u4eba\u5458\u7ba1\u7406\u3002<\/p>\n","protected":false},"author":2,"featured_media":41838,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3848,114,117,3849,43],"topic":[],"class_list":["post-41846","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-fungleo","tag-mysql","tag-nginx","tag-ubuntu-server","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/41846.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx\u4e0eMySQL\u670d\u52a1\u3002\u9996\u5148\u901a\u8fc7apt\u547d\u4ee4\u5b89\u88c5Nginx\u5e76\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\uff0c\u8be6\u7ec6\u8bb2\u89e3\u4e86Nginx\u7684\u5e38\u7528\u914d\u7f6e\uff0c\u5305\u62ec\u5de5\u4f5c\u8fdb\u7a0b\u3001\u65e5\u5fd7\u683c\u5f0f\u3001\u53cd\u5411\u4ee3\u7406\u7b49\u3002\u968f\u540e\u5b89\u88c5MySQL\u670d\u52a1\u5e76\u914d\u7f6e\u81ea\u542f\u52a8\u3002\u6587\u7ae0\u91cd\u70b9\u89e3\u6790\u4e86Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u7ed3\u6784\uff0c\u63d0\u4f9b\u4e86\u591a\u7ad9\u70b9\u914d\u7f6e\u793a\u4f8b\uff0c\u6db5\u76d6\u57df\u540d\u7ed1\u5b9a\u3001\u9759\u6001\u6587\u4ef6\u670d\u52a1\u3001\u53cd\u5411\u4ee3\u7406\u548cSPA\u5e94\u7528\u652f\u6301\u7b49\u5e38\u89c1\u573a\u666f\u3002\u9002\u7528\u4e8e\u5f00\u53d1\u73af\u5883\u642d\u5efa\uff0c\u4f46\u5efa\u8bae\u751f\u4ea7\u73af\u5883\u7531\u4e13\u4e1a\u8fd0\u7ef4\u4eba\u5458\u7ba1\u7406\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/41846.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-04T23:30:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233045-6840d72559731.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41846.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/41846.html\",\"name\":\"\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-04T23:30:50+00:00\",\"dateModified\":\"2025-06-04T23:30:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/41846.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/41846.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41846.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/41846.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNginx\u4e0eMySQL\u670d\u52a1\u3002\u9996\u5148\u901a\u8fc7apt\u547d\u4ee4\u5b89\u88c5Nginx\u5e76\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\uff0c\u8be6\u7ec6\u8bb2\u89e3\u4e86Nginx\u7684\u5e38\u7528\u914d\u7f6e\uff0c\u5305\u62ec\u5de5\u4f5c\u8fdb\u7a0b\u3001\u65e5\u5fd7\u683c\u5f0f\u3001\u53cd\u5411\u4ee3\u7406\u7b49\u3002\u968f\u540e\u5b89\u88c5MySQL\u670d\u52a1\u5e76\u914d\u7f6e\u81ea\u542f\u52a8\u3002\u6587\u7ae0\u91cd\u70b9\u89e3\u6790\u4e86Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u7ed3\u6784\uff0c\u63d0\u4f9b\u4e86\u591a\u7ad9\u70b9\u914d\u7f6e\u793a\u4f8b\uff0c\u6db5\u76d6\u57df\u540d\u7ed1\u5b9a\u3001\u9759\u6001\u6587\u4ef6\u670d\u52a1\u3001\u53cd\u5411\u4ee3\u7406\u548cSPA\u5e94\u7528\u652f\u6301\u7b49\u5e38\u89c1\u573a\u666f\u3002\u9002\u7528\u4e8e\u5f00\u53d1\u73af\u5883\u642d\u5efa\uff0c\u4f46\u5efa\u8bae\u751f\u4ea7\u73af\u5883\u7531\u4e13\u4e1a\u8fd0\u7ef4\u4eba\u5458\u7ba1\u7406\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/41846.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-04T23:30:50+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250604233045-6840d72559731.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/41846.html","url":"https:\/\/www.wsisp.com\/helps\/41846.html","name":"\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-04T23:30:50+00:00","dateModified":"2025-06-04T23:30:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/41846.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/41846.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/41846.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5b89\u88c5\u548c\u914d\u7f6e Nginx \u548c Mysql \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f556"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=41846"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41846\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/41838"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=41846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=41846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=41846"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=41846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}