{"id":1515,"date":"2025-10-18T09:52:57","date_gmt":"2025-10-18T01:52:57","guid":{"rendered":"https:\/\/www.vcidc.net\/blog\/?p=1515"},"modified":"2025-10-18T09:52:57","modified_gmt":"2025-10-18T01:52:57","slug":"%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae%ef%bc%9f%e5%93%aa%e4%ba%9b%e6%ad%a5%e9%aa%a4%e6%98%af%e5%bf%85%e9%a1%bb%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.vcidc.net\/blog\/1515.html","title":{"rendered":"\u865a\u62df\u4e3b\u673a\u5982\u4f55\u914d\u7f6e\uff1f\u54ea\u4e9b\u6b65\u9aa4\u662f\u5fc5\u987b\u7684\uff1f"},"content":{"rendered":"<p><p>\u5728\u5f53\u4eca\u7684\u4e92\u8054\u7f51\u73af\u5883\u4e2d\uff0c\u865a\u62df\u4e3b\u673a\u662f\u4e2a\u4eba\u548c\u4f01\u4e1a\u5efa\u7acb\u5728\u7ebf\u4e1a\u52a1\u7684\u57fa\u7840\u3002\u672c\u6587\u5c06\u4e3a\u60a8\u63d0\u4f9b\u4e00\u4e2a\u5b9e\u64cd\u5bfc\u5411\u7684\u6307\u5357\uff0c\u5e2e\u52a9\u60a8\u5feb\u901f\u914d\u7f6e\u548c\u4f7f\u7528\u865a\u62df\u4e3b\u673a\u3002\u6211\u4eec\u5c06\u57fa\u4e8eLinux\u73af\u5883\uff0c\u4f7f\u7528Apache\u4f5c\u4e3aWeb\u670d\u52a1\u5668\uff0cMySQL\u4f5c\u4e3a\u6570\u636e\u5e93\u670d\u52a1\u5668\uff0c\u4ee5\u53caPHP\u4f5c\u4e3a\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00\u3002<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.vcidc.net\/blog\/wp-content\/uploads\/2025\/07\/WwG3Chw.jpg\" alt=\"\u865a\u62df\u4e3b\u673a\u5982\u4f55\u914d\u7f6e\uff1f\u54ea\u4e9b\u6b65\u9aa4\u662f\u5fc5\u987b\u7684\uff1f\" title=\"\u865a\u62df\u4e3b\u673a\u5982\u4f55\u914d\u7f6e\uff1f\u54ea\u4e9b\u6b65\u9aa4\u662f\u5fc5\u987b\u7684\uff1f\"><\/p>\n<\/p>\n<p><h2>\u64cd\u4f5c\u524d\u7684\u51c6\u5907<\/h2>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u6709\u4ee5\u4e0b\u51c6\u5907\u5de5\u4f5c\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4e00\u53f0\u5df2\u7ecf\u5b89\u88c5Linux\u64cd\u4f5c\u7cfb\u7edf\u7684\u670d\u52a1\u5668\u6216VPS\u3002<\/li>\n<li>\u5177\u6709root\u6743\u9650\u7684SSH\u8bbf\u95ee\u6743\u9650\u3002<\/li>\n<li>\u5df2\u8d2d\u4e70\u57df\u540d\u5e76\u89e3\u6790\u5230\u60a8\u7684\u670d\u52a1\u5668IP\u5730\u5740\u3002<\/li>\n<\/ul>\n<p><h2>\u5b89\u88c5Apache\u670d\u52a1\u5668<\/h2>\n<\/p>\n<p><p>Apache\u662f\u4e00\u4e2a\u5e7f\u6cdb\u4f7f\u7528\u7684\u5f00\u6e90HTTP\u670d\u52a1\u5668\u8f6f\u4ef6\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5Apache\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h3>1. \u66f4\u65b0\u7cfb\u7edf\u5305\u5217\u8868<\/h3>\n<\/p>\n<p><pre><code>sudo apt update<\/p>\r\n<p>sudo apt upgrade<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\uff08\u5bf9\u4e8e\u57fa\u4e8eDebian\u7684\u7cfb\u7edf\uff0c\u5982Ubuntu\uff09<\/p>\n<\/p>\n<p><h3>2. \u5b89\u88c5Apache<\/h3>\n<\/p>\n<p><pre><code>sudo apt install apache2<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3. \u542f\u52a8Apache\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><pre><code>sudo systemctl start apache2<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4. \u8bbe\u7f6eApache\u670d\u52a1\u5668\u5f00\u673a\u81ea\u542f<\/h3>\n<\/p>\n<p><pre><code>sudo systemctl enable apache2<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u5b89\u88c5MySQL\u6570\u636e\u5e93\u670d\u52a1\u5668<\/h2>\n<\/p>\n<p><p>MySQL\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002<\/p>\n<\/p>\n<p><h3>1. \u5b89\u88c5MySQL<\/h3>\n<\/p>\n<p><pre><code>sudo apt install mysql-server<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u914d\u7f6eMySQL<\/h3>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u60a8\u8bbe\u7f6eroot\u7528\u6237\u7684\u5bc6\u7801\u3002\u8bf7\u786e\u4fdd\u8bbe\u7f6e\u4e00\u4e2a\u5f3a\u5bc6\u7801\u3002<\/p>\n<\/p>\n<p><h3>3. \u542f\u52a8MySQL\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><pre><code>sudo systemctl start mysql<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4. \u8bbe\u7f6eMySQL\u670d\u52a1\u5668\u5f00\u673a\u81ea\u542f<\/h3>\n<\/p>\n<p><pre><code>sudo systemctl enable mysql<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u5b89\u88c5PHP\u548cPHP\u6a21\u5757<\/h2>\n<\/p>\n<p><p>PHP\u662f\u4e00\u79cd\u6d41\u884c\u7684\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00\uff0c\u7528\u4e8e\u5904\u7406\u52a8\u6001\u7f51\u9875\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><h3>1. \u5b89\u88c5PHP<\/h3>\n<\/p>\n<p><pre><code>sudo apt install php<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u5b89\u88c5PHP\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u5b89\u88c5\u4ee5\u4e0b\u6a21\u5757\u4ee5\u652f\u6301PHP\u548c\u6570\u636e\u5e93\u7684\u8fde\u63a5\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo apt install php-mysql php-gd php-xml php-mbstring php-zip<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u914d\u7f6e\u865a\u62df\u4e3b\u673a<\/h2>\n<\/p>\n<p><p>\u865a\u62df\u4e3b\u673a\u5141\u8bb8\u60a8\u5728\u5355\u4e2a\u670d\u52a1\u5668\u4e0a\u6258\u7ba1\u591a\u4e2a\u7f51\u7ad9\u3002<\/p>\n<\/p>\n<p><h3>1. \u521b\u5efa\u865a\u62df\u4e3b\u673a\u76ee\u5f55<\/h3>\n<\/p>\n<p><pre><code>sudo mkdir \/var\/www\/example.com<\/p>\r\n<p>sudo chown -R $USER:$USER \/var\/www\/example.com<\/p>\r\n<p>sudo chmod -R 755 \/var\/www\/example.com<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06\u201cexample.com\u201d\u66ff\u6362\u4e3a\u60a8\u7f51\u7ad9\u7684\u57df\u540d\u3002<\/p>\n<\/p>\n<p><h3>2. \u521b\u5efa\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6587\u4ef6<\/h3>\n<\/p>\n<p><pre><code>sudo nano \/etc\/apache2\/sites-available\/example.com.conf<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code>&lt;VirtualHost :80&gt;<\/p>\r\n<p>    ServerAdmin admin@example.com<\/p>\r\n<p>    ServerName example.com<\/p>\r\n<p>    ServerAlias www.example.com<\/p>\r\n<p>    DocumentRoot \/var\/www\/example.com<\/p>\r\n<p>    ErrorLog ${APACHE_LOG_DIR}\/error.log<\/p>\r\n<p>    CustomLog ${APACHE_LOG_DIR}\/access.log combined<\/p>\r\n<p>&lt;\/VirtualHost&gt;<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3. \u542f\u7528\u865a\u62df\u4e3b\u673a<\/h3>\n<\/p>\n<p><pre><code>sudo a2ensite example.com.conf<\/p>\r\n<p>sudo systemctl reload apache2<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u6d4b\u8bd5\u865a\u62df\u4e3b\u673a<\/h2>\n<\/p>\n<p><p>\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u60a8\u7684\u57df\u540d\uff0c\u5982\u679c\u770b\u5230Apache\u9ed8\u8ba4\u9875\u9762\uff0c\u5219\u8bf4\u660e\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6210\u529f\u3002<\/p>\n<\/p>\n<p><h2>\u6ce8\u610f\u4e8b\u9879<\/h2>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u60a8\u7684\u670d\u52a1\u5668\u9632\u706b\u5899\u5141\u8bb8HTTP\uff0880\uff09\u548cHTTPS\uff08443\uff09\u7aef\u53e3\u3002<\/li>\n<li>\u5b9a\u671f\u66f4\u65b0\u60a8\u7684\u8f6f\u4ef6\u4ee5\u4fdd\u6301\u5b89\u5168\u3002<\/li>\n<li>\u5907\u4efd\u60a8\u7684\u7f51\u7ad9\u548c\u6570\u636e\u5e93\uff0c\u4ee5\u9632\u6570\u636e\u4e22\u5931\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u5df2\u7ecf\u6210\u529f\u914d\u7f6e\u4e86\u4e00\u4e2a\u865a\u62df\u4e3b\u673a\u3002\u73b0\u5728\u60a8\u53ef\u4ee5\u5f00\u59cb\u90e8\u7f72\u60a8\u7684\u7f51\u7ad9\u548c\u5e94\u7528\u4e86\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f53\u4eca\u7684\u4e92\u8054\u7f51\u73af\u5883\u4e2d\uff0c\u865a\u62df\u4e3b\u673a\u662f\u4e2a\u4eba\u548c\u4f01\u4e1a\u5efa\u7acb\u5728\u7ebf\u4e1a\u52a1\u7684\u57fa\u7840\u3002\u672c\u6587\u5c06\u4e3a\u60a8\u63d0\u4f9b\u4e00\u4e2a\u5b9e\u64cd\u5bfc\u5411\u7684\u6307\u5357\uff0c\u5e2e\u52a9\u60a8\u5feb\u901f\u914d\u7f6e\u548c\u4f7f\u7528\u865a\u62df\u4e3b\u673a\u3002\u6211\u4eec\u5c06\u57fa\u4e8eLinux\u73af\u5883\uff0c\u4f7f\u7528Apache\u4f5c\u4e3aWeb\u670d\u52a1\u5668\uff0cMySQL\u4f5c\u4e3a\u6570\u636e\u5e93\u670d\u52a1\u5668\uff0c\u4ee5\u53caPHP\u4f5c\u4e3a\u670d\u52a1\u5668\u7aef\u811a\u672c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1516,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[217,19,93],"topic":[],"class_list":["post-1515","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-game-server","tag-apache","tag-19","tag-93"],"_links":{"self":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/comments?post=1515"}],"version-history":[{"count":1,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1515\/revisions"}],"predecessor-version":[{"id":1518,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1515\/revisions\/1518"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media\/1516"}],"wp:attachment":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media?parent=1515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/categories?post=1515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/tags?post=1515"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/topic?post=1515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}