{"id":270280,"date":"2023-04-21T20:19:55","date_gmt":"2023-04-21T12:19:55","guid":{"rendered":"https:\/\/lrxjmw.cn\/lywrmsmhjdjd.html"},"modified":"2023-04-21T20:19:55","modified_gmt":"2023-04-21T12:19:55","slug":"lywrmsmhjdjd","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lywrmsmhjdjd.html","title":{"rendered":"Linux\u8fd0\u7ef4\u5165\u95e8\u4e09\u300amysql+php\u73af\u5883\u642d\u5efa\u300b\u7684\u65e5\u5e38\u7ba1\u7406\u8fd0\u7ef4\u64cd\u4f5c\u6709\u54ea\u4e9b"},"content":{"rendered":"

\u6253\u7b97\u7528\u4e00\u4e24\u4e2a\u6708\uff0c\u505a\u4e00\u671flinux\u8fd0\u7ef4\u5165\u95e8\u7684\u77e5\u8bc6\u5206\u4eab\uff0c\u89c4\u5212\u4e86\u5341\u4e09\u4e2a\u7ae0\u8282\uff0c\u5047\u5b9a\u7684\u573a\u666f\u662f\u4f7f\u7528php\u505a\u5f00\u53d1\u7684\u670d\u52a1\u5668\u8fd0\u7ef4\u5de5\u4f5c\uff0c\u4f9d\u7167\u4e4b\u524d\u63a5\u89e6\u8fc7\u4e0d\u5c11\u5b9e\u4e60\u7684\u540c\u4e8b\u89c9\u5f97\u8fd9\u4e2a\u89c4\u5212\u80fd\u63d0\u4f9b\u4e00\u4e9b\u5e2e\u52a9\uff0cLinux<\/a>\u7cfb\u7edf<\/a>\u9009\u7528Centos7.x\u7cfb\u5217\uff0c\u7ae0\u8282\u5982\u4e0b\uff1a<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u4e00\u300a\u670d\u52a1\u5668\u5165\u624b\u540e\u57fa\u672c\u914d\u7f6e\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u4e8c\u300amysql\u7684\u5b89\u88c5\u5e03\u7f72\u89e3\u8bfb\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u4e09\u300amysql\u7684\u57fa\u672c\u53c2\u6570\u6027\u80fd\u4f18\u5316\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u56db\u300amysql\u7684\u65e5\u5e38\u7ba1\u7406\u8fd0\u7ef4\u64cd\u4f5c\u6709\u4ec0\u4e48\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u4e94\u300anginx+php\u73af\u5883\u642d\u5efa\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u516d\u300anginx\u4e0b\u521b\u5efa\u4e00\u4e2aphp\u7ad9\u70b9\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u4e03\u300anginxhttps\u8bc1\u4e66\u7684\u914d\u7f6e\u5e03\u7f72\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u516b\u300aphp\u7684\u57fa\u672c\u53c2\u6570\u4f18\u5316\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u4e5d\u300aphpredis\u3001tidy\u6269\u5145\u7684\u5b89\u88c5\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u5341\u300anginx\u7f13\u5b58\u6280\u672f\u7684\u65bd\u884c\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u5341\u4e00\u300aphp\u7684\u57fa\u672c\u53c2\u6570\u6027\u80fd\u4f18\u5316\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u5341\u4e8c\u300aredis\u7684\u5b89\u88c5\u5e03\u7f72\u89e3\u8bfb\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u5341\u4e09\u300alnmp\u670d\u52a1\u5668\u5e38\u89c1\u5b89\u5168\u914d\u7f6e\u300b<\/p>\n

Linux\u8fd0\u7ef4\u5165\u95e8\u4e00\u300a\u670d\u52a1\u5668\u5165\u624b\u540e\u57fa\u672c\u914d\u7f6e\u300b<\/p>\n

\u672c\u7ae0\u5c06\u4ecb\u7ecd\u4e03\u4e2a\u77e5\u8bc6\u70b9\uff0c\u5206\u522b\u662f<\/p>\n

1\u3001\u51c6\u5907ssh<\/a>\u8054\u63a5\u5de5\u5177<\/p>\n

2\u3001\u4fee\u6539\u670d\u52a1\u5668root\u5bc6\u7801<\/p>\n

3\u3001\u5bf9\u670d\u52a1\u5668ssh\u8fdc\u7a0b\u7aef\u53e3\u505aIP\u767d\u540d\u5355(\u53ef\u9009)<\/p>\n

4\u3001\u66f4\u65b0yum\u6e90(\u53ef\u9009)<\/p>\n

5\u3001\u4fee\u6539ssh\u9ed8\u8ba4\u7aef\u53e3(\u53ef\u9009)<\/p>\n

6\u3001\u914d\u7f6e\u7cfb\u7edf\u76d8\u4e4b\u5916\u7684\u5176\u5b83c\u76d8(\u53ef\u9009)<\/p>\n

7\u3001\u521b\u5efa\u666e\u901a\u7528\u6237\u7528\u4e8e\u65e5\u5e38\u767b\u9646(\u53ef\u9009)<\/p>\n

1\u3001\u51c6\u5907ssh\u8054\u63a5\u5de5\u5177<\/p>\n

\u7ba1\u7406linux\u670d\u52a1\u5668\u5fc5\u987b\u4f7f\u7528\u4e00\u4e2a\u5de5\u5177\u8054\u63a5ssh\uff0c\u8fd9\u4e2assh\u7c7b\u4f3c\u7ba1\u7406windows\u8981\u7528\u8fdc\u7a0b\u684c\u9762\u4e00\u6837\uff0c\u672c\u6587\u5c06\u4f7f\u7528xshell\u5de5\u5177\u505a\u670d\u52a1\u5668\u7684\u7ba1\u7406\u7ec8\u7aef\uff0cxshell\u5bf9\u4e2a\u4eba\u7528\u6237\u662f\u514d\u8d39\u4f7f\u7528\uff0c\u53ef\u4ee5\u5b98\u7f51\u6216\u6b63\u89c4\u5927\u7f51\u7ad9\u4e0b\u8f7d\u5230\u3002<\/p>\n

seo\u653b\u7565\u2014\u2014\u641c\u7d22\u5f15\u64ce\u4f18\u5316\u7b56\u7565\u4e0e\u5b9e\u6218\u6848\u4f8b\u8be6\u89e3_seo\u653b\u7565\uff1a\u641c\u7d22\u5f15\u64ce\u4f18\u5316\u7b56\u7565\u4e0e\u5b9e\u6218\u6848\u4f8b\u8be6\u89e3_linux\u670d\u52a1\u5668\u5b89\u5168\u7b56\u7565\u8be6\u89e3<\/p>\n

2\u3001\u4fee\u6539\u670d\u52a1\u5668root\u5bc6\u7801<\/p>\n

\u5047\u5982\u5165\u624b\u670d\u52a1\u5668\u7684\u5bc6\u7801\u662f\u4ed6\u4eba\u5e2e\u8bbe\u7f6e\u7684\uff0c\u8fd9\u4e48\u6211\u4eec\u63a5\u624b\u540e\u7b2c\u4e00\u65f6\u95f4\u662f\u66f4\u6539\u5bc6\u7801\u3002\u7528xshell\u767b\u9646\u5230\u670d\u52a1\u5668\u4ee5\u540e\uff0c\u5728\u5f53\u524d\u7ec8\u7aef\u8fd0\u884cpasswd\u547d\u4ee4\u8fdb\u884c\u5bc6\u7801\u7684\u66f4\u6539\u3002<\u547d\u4ee4<\/a>>3\u3001\u66f4\u65b0yun\u6e90(\u53ef\u9009)<\/p>\n

\u5047\u5982\u4f60\u670d\u52a1\u5668yum\u5b89\u88c5\u4e1c\u897f\u6162\uff0c\u53ef\u4ee5\u770b\u4e0byum\u6e90\u548c\u5f53\u524d\u670d\u52a1\u5668\u7f51\u8def\u662f\u5426\u4e0d\u591f\u901a\u8fbe\uff0c\u8fd9\u65b9\u9762\u5f70\u663e\u5728\u201c\u56fd\u5185\u7684\u670d\u52a1\u5668\u4f7f\u7528\u4e86\u7f8e\u56fd\u7684yum\u6e90\u201d\u6216\u201c\u6d77\u5916\u7684\u670d\u52a1\u5668\u4f7f\u7528\u4e86\u56fd\u5916\u7684\u6e90\u201d<\/p>\n

#\u66f4\u65b0\u4e3a\u7f51\u6613yum\u6e90<\/p>\n

linux\u670d\u52a1\u5668\u5b89\u5168\u7b56\u7565\u8be6\u89e3_seo\u653b\u7565\u2014\u2014\u641c\u7d22\u5f15\u64ce\u4f18\u5316\u7b56\u7565\u4e0e\u5b9e\u6218\u6848\u4f8b\u8be6\u89e3_seo\u653b\u7565\uff1a\u641c\u7d22\u5f15\u64ce\u4f18\u5316\u7b56\u7565\u4e0e\u5b9e\u6218\u6848\u4f8b\u8be6\u89e3<\/p>\n

curl-o\/etc\/yum.repos.d\/CentOS-Base.repo<\/p>\n

yumupdate<\/p>\n

4\u3001\u5bf9\u670d\u52a1\u5668ssh\u8fdc\u7a0b\u7aef\u53e3\u505aIP\u767d\u540d\u5355\uff08\u53ef\u9009\uff09<\/p>\n

\u670d\u52a1\u5668\u5728\u7f51\u6bb5\u4e0a\uff0c\u6240\u6709\u4eba\u90fd\u8fd8\u80fd\u901a\u8fc7\u670d\u52a1\u5668IP\u8054\u63a5\u5230\u8fd9\u53f0\u670d\u52a1\u5668\u7684ssh\u7aef\u53e3\uff0c\u56e0\u800c\u901a\u8fc7firewalld\u6dfb\u52a0\u4e00\u4e2a\u767d\u540d\u5355\uff0c\u6709\u5229\u4e8e\u63d0\u9ad8\u670d\u52a1\u5668\u7684\u5b89\u5168\u3002*\u6b64\u5904\u6ce8\u610f\u5148\u628a\u81ea\u5df1\u7684IP\u52a0\u8fdb\u767d\u540d\u5355\uff0c\u514d\u5f97\u81ea\u5df1\u8fde\u4e0d\u4e0alinux\u670d\u52a1\u5668\u5b89\u5168\u7b56\u7565\u8be6\u89e3<\/strong>\uff0c\u5047\u5982\u4f60\u7684IP\u4e0d\u56fa\u5b9a\uff0c\u8fd9\u4e2a\u8bbe\u7f6e\u5c31\u6ca1\u6cd5\u987a\u5229\u5b8c\u6210\uff0c\u987b\u8981\u53e6\u60f3\u529e\u6cd5\u5c31\u5148\u4e0d\u6982\u8ff0\u4e86\uff0c\u5728\u5b66\u4e60\u671f\u95f4\u53ef\u5148\u8df3\u8fc7\u8fd9\u4e00\u6b65\u3002#\u542f\u52a8\u9632\u706b\u5899<\/p>\n

systemctlstartfirewalld<\/p>\n

#\u8bbe\u7f6e\u4e4b\u540e\u5f00\u673a\u624b\u52a8\u542f\u52a8<\/p>\n

systemctlenablefirewalld<\/p>\n

#\u8981\u5220\u6389\u9ed8\u8ba4\u7684SSH\u7aef\u53e3\u8bbf\u95ee<\/p>\n

firewall-cmd--remove-service=ssh--permanent<\/p>\n

firewall-cmd--permanent--zone=public--remove-port=22\/tcp<\/p>\n

#\u628aip192.168.3.72\u6dfb\u52a0\u523022\u7aef\u53e3\u7684\u8bbf\u95ee\u767d\u540d\u5355\uff0c\u5b9e\u9645\u4e1a\u52a1\u573a\u666f\u4e2d\u8fd9\u513f\u5e94\u5f53\u662f\u4f60\u81ea\u5df1\u7684IP\uff0c\u4e0d\u8981\u76f4\u63a5\u590d\u5236<\/p>\n

firewall-cmd--permanent--zone=public--add-rich-rule=\"rulefamily=\"ipv4\"sourceaddress=\"192.168.3.72\/32\"portprotocol=\"tcp\"port=\"22\"accept\"<\/p>\n

#\u91cd\u65b0\u52a0\u8f7d\u9632\u706b\u5899\u89c4\u5219<\/p>\n

firewall-cmd--reload<\/p>\n

#\u518d\u770b\u4e0b\u5f53\u524d\u89c4\u5219<\/p>\n

firewall-cmd--list-all<\/p>\n

5\u3001\u4fee\u6539ssh\u9ed8\u8ba4\u7aef\u53e3\uff08\u53ef\u9009\uff09<\/p>\n

\u5728\u4e00\u4e9b\u5e94\u7528\u573a\u666f\u4e2d\uff0c\u4e5f\u662f\u788d\u4e8e\u6ca1\u6709\u56fa\u5b9a\u7684\u7f51\u6bb5IP\u4e0d\u597d\u505a\u767d\u540d\u5355\uff0c\u4e8e\u662f\u8981\u628a\u9ed8\u8ba4\u7684ssh\u7aef\u53e3\u6362\u6210\u522b\u7684\uff0c\u8fd9\u6837\u4ed6\u4eba\u901a\u8fc7\u9ed8\u8ba4\u7684ssh\u7aef\u53e3\u5c31\u8fde\u4e0d\u4e0a\u670d\u52a1\u5668\u3002<\/p>\n

\u5728ssh\u6362\u6210\u65b0\u7aef\u53e3\u4e4b\u524dlinux\u64cd\u4f5c\u7cfb\u7edf\u539f\u7406\uff0c\u52ff\u5fc5\u5148\u628a\u7aef\u53e3\u6dfb\u52a0\u5230\u9632\u706b\u5899\u4e2dlinux\u670d\u52a1\u5668\u5b89\u5168\u7b56\u7565\u8be6\u89e3<\/strong>\uff0c\u80fd\u591f\u4ece\u5916\u90e8\u8054\u63a5\uff0c\u907f\u514d\u6539\u4e86\u540e\u81ea\u5df1\u8fde\u4e0d\u4e0a\u3002\u672c\u6587\u5c06\u628assh\u7aef\u53e3\u4ece22\u6362\u621010022\u3002\u66f4\u6362ssh\u7aef\u53e3\u4f1a\u88ab\u90e8\u4efd\u9ed8\u8ba4\u5f00\u542fselinux\u7684\u7cfb\u7edf\u5236\u6b62\uff0c\u5bfc\u81f4\u542f\u52a8\u4e0d\u4e86sshd\u670d\u52a1\u3002<\/p>\n

#\u67e5\u770bselinux\u662f\u5426\u5f00\u542f<\/p>\n

sestatus-v|grepSELinux<\/p>\n

#enabled\u8868\u793a\u542f\u7528<\/p>\n

SELinuxstatus:enabled<\/p>\n

#\u987b\u8981\u7528semanage\u66f4\u65b0selinux\u7b56\u7565\u6216\u5173\u6389selinuxlinux \u4e0b\u8f7d\uff0c\u800csemanage\u987b\u8981\u5355\u72ec\u5b89\u88c5yuminstallpolicycoreutils-python<\/p>\n

semanageport-a-tssh_port_t-ptcp10022<\/p>\n

#\u7f51\u4e0a\u597d\u591a\u5efa\u8bae\u662f\u76f4\u63a5\u5173\u6389selinux\uff0c\u4e2a\u4eba\u4f1a\u6309\u7167\u60c5\u51b5\u800c\u5b9a\u3002<\/p>\n

#\u9632\u706b\u5899\u5f00\u653e10022\u7aef\u53e3\u7684\u5185\u7f51\u8bbf\u95ee<\/p>\n

firewall-cmd--permanent--zone=public--add-port=10022\/tcp<\/p>\n

#\u91cd\u65b0\u52a0\u8f7d\u89c4\u5219<\/p>\n

firewall-cmd--reload<\/p>\n

#\u66f4\u6539ssh\u914d\u7f6e\u6587\u4ef6<\/p>\n

vi\/etc\/ssh\/sshd_config<\/p>\n

#\u5728\"#Port22\"\u4e0b\u52a0\u4e00\u884c\"Port10022\"<\/p>\n

#:wq\u4fdd\u5b58\u9000\u51fa<\/p>\n

:wq<\/p>\n

#\u91cd\u542fsshd\u670d\u52a1<\/p>\n

systemctlrestartsshd<\/p>\n

6\u3001\u914d\u7f6e\u7cfb\u7edf\u76d8\u4e4b\u5916\u7684\u5176\u5b83c\u76d8\uff08\u53ef\u9009\uff09<\/p>\n

#\u67e5\u770b\u5316\u5b66c\u76d8<\/p>\n

lsblk<\/p>\n

#\u4f8b\u5982\u672c\u6587\u6848\u4f8b\u4e2d\u53d1\u89c9\u6709\u4e00\u5757sdb\u8fd8\u6ca1\u6709\u5206\u533a\uff0c\u8fd8\u6709\u4e00\u4e2asr0rom\u786c\u76d8\u4e0d\u7b97\u3002<\/p>\n

#sdb\u521b\u5efa\u5206\u533a<\/p>\n

fdisk\/dev\/sdb<\/p>\n

n<\/p>\n

p<\/p>\n

\u56de\u8f66<\/p>\n

\u56de\u8f66<\/p>\n

w<\/p>\n

#\u4f4e\u683c\u5206\u533a<\/p>\n

mkfs.ext4\/dev\/sdb1<\/p>\n

#\u6302\u8f7d\u5206\u533a<\/p>\n

mkdir\/data1<\/p>\n

mount\/dev\/sdb1\/data1<\/p>\n

7\u3001\u521b\u5efa\u666e\u901a\u7528\u6237\u7528\u4e8e\u65e5\u5e38\u767b\u9646\uff08\u53ef\u9009\uff09<\/p>\n

useraddzhangsan<\/p>\n

passwdzhangsan<\/p>\n

\u8fd9\u6837\u5c31\u6709\u4e00\u4e2azhangsan\u7684\u666e\u901a\u7528\u6237\u53ef\u4ee5\u505a\u65e5\u5e38\u7684\u7b80\u5355\u7ba1\u7406\u4e86\uff0c\u6ca1\u5fc5\u8981\u5565\u65f6\u90fd\u7528root\u3002\u5047\u5982\u591a\u4eba\u5171\u540c\u4f7f\u7528\u4e00\u53f0\u670d\u52a1\u5668\u7684\u65f6\u4faf\uff0c\u66f4\u987b\u8981\u7528\u4e0d\u540c\u7528\u6237\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u51c6\u5907\u7528\u4e00\u4e24\u4e2a\u6708\uff0c\u505a\u4e00\u671flinux\u8fd0\u7ef4\u5165\u95e8\u7684\u77e5\u8bc6\u5206\u4eab\uff0c\u89c4\u5212\u4e86\u5341\u4e09\u4e2a\u7ae0\u8282\uff0c\u5047\u8bbe\u7684\u573a\u666f\u662f\u4f7f\u7528php\u505a\u5f00\u53d1\u7684\u670d\u52a1\u5668\u8fd0\u7ef4\u5de5\u4f5c\uff0c\u6839\u636e\u4e4b\u524d\u63a5\u89e6\u8fc7\u4e0d\u5c11\u5b9e\u4e60\u7684\u540c\u5b66\u8ba4\u4e3a\u8fd9\u4e2a\u89c4\u5212\u80fd\u63d0\u4f9b\u4e00\u4e9b\u5e2e\u52a9\uff0cLinux\u7cfb\u7edf\u9009\u7528Centos7.Linux\u8fd0\u7ef4\u5165\u95e8\u4e00\u300a\u670d\u52a1\u5668\u5165\u624b\u540e\u57fa\u672c\u914d\u7f6e\u300bLinux\u8fd0\u7ef4\u5165\u95e8\u5341\u4e00\u300aphp\u7684\u57fa\u672c\u53c2\u6570\u6027\u80fd\u4f18\u5316\u300bLinux\u8fd0\u7ef4\u5165\u95e8\u5341\u4e09\u300alnmp\u670d\u52a1\u5668\u5e38\u89c1\u5b89\u5168\u914d\u7f6e\u300bLinux\u8fd0\u7ef4\u5165\u95e8\u4e00\u300a\u670d\u52a1\u5668\u5165\u624b\u540e\u57fa\u672c\u914d\u7f6e\u300b<\/p>\n","protected":false},"author":1,"featured_media":270281,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-270280","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/270280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=270280"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/270280\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/270281"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=270280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=270280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=270280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}