{"id":46,"date":"2011-01-30T12:45:04","date_gmt":"2011-01-30T20:45:04","guid":{"rendered":"http:\/\/www.zhanxw.com\/blog\/?p=46"},"modified":"2011-02-28T20:15:27","modified_gmt":"2011-03-01T04:15:27","slug":"how-to-set-up-buyvm-with-lamp-wordpress-and-vpn","status":"publish","type":"post","link":"https:\/\/zhanxw.com\/blog\/2011\/01\/how-to-set-up-buyvm-with-lamp-wordpress-and-vpn\/","title":{"rendered":"How to set up BuyVM with LAMP, WordPress and VPN"},"content":{"rendered":"<p>\u57282011\u5e741\u6708\u4efd\u7684\u6700\u540e\u4e00\u5929\uff0c\u6211\u975e\u5e38\u5e78\u8fd0\u7684\u53d1\u73b0BuyVM.net\u7684\u6bcf\u5e7415\u7f8e\u5143\u7684VPS\u8ba1\u5212\u5c45\u7136\u8fd8\u6ca1\u5356\u5149\u3002\u6309\u8010\u4e0d\u4f4f\u7684\u6211\u7acb\u523b\u638f\u94b1\u3002\u4e4b\u540e\u5c31\u6709\u4e86\u672c\u6587\u3002\u6211\u5c06\u5206\u4e09\u90e8\u5206\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u548c\u8c03\u8bd5(Optimize) LAMP, \u5b89\u88c5\u53ca\u8fc1\u79fbWordPress \u548c\u8bbe\u7f6eVPN.<\/p>\n<p><strong>1. LAMP\u7684\u5b89\u88c5\u548c\u4f18\u5316<\/strong><\/p>\n<p>\u5982\u679c\u50cf\u6211\u4e00\u6837\u7528BuyVM.net \u6bcf\u5e74$15\u7f8e\u5143\u7684\u8ba1\u5212\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9Ubuntu 10.10 LAMP \u7cfb\u7edf\uff0c\u8fd9\u6837\u4f60\u81ea\u5df1\u5c31\u62e5\u6709\u4e86LAMP\u6574\u5957\u7cfb\u7edf\uff0c\u4f46\u662f\u8fd9\u6837\u7684\u7cfb\u7edf\u4e0d\u80fd\u9002\u5e94Wordpress\u7a0b\u5e8f\u2014\u2014\u5185\u5b58\u7ecf\u5e38\u4e0d\u591f\u7528\u3002\u56e0\u6b64\u6211\u4eec\u5fc5\u987b\u60f3\u529e\u6cd5\u51cf\u5c11Apache2\u548cMySQL\u7684\u5185\u5b58\u6d88\u8017\u3002<\/p>\n<p>\u5bf9\u4e8eApache\uff0c\u901a\u8fc7\u68c0\u67e5aptitude\u7a0b\u5e8f\u53ef\u4ee5\u53d1\u73b0\uff0cUbuntu\u5b89\u88c5\u7684\u662fApache-prefork-mpm\u7248\u672c(\u7248\u672c\u53f7\u4e2d\u7684prefork\u8868\u793a\u7684\u662f\u548cApache 1.3\u7c7b\u4f3c\u7684\u67b6\u6784\uff09\u3002\u8fd9\u4e2a\u67b6\u6784\u4e0b\u6bd4\u8f83\u5173\u952e\u7684\u53c2\u6570\u662f\u6700\u5c11\u548c\u6700\u591a\u7684apache\u8fdb\u7a0b\u7684\u4e2a\u6570\u3002\u5982\u679c\u4e0d\u9650\u5236\uff0c\u5219\u4f1a\u5f88\u5bb9\u6613\u51fa\u73b08-10\u4e2aapache\u8fdb\u7a0b\uff0c\u6709\u7684\u8fdb\u7a0b\u5360\u5185\u5b5830-40M\uff0c\u5f88\u5feb\u4f60\u7684VPS\u5c31\u4f1a\u53cd\u5e94\u53d8\u6162\uff0c\u751a\u81f3crash\u3002\u53c2\u8003<a rel=\"nofollow\" href=\"http:\/\/serverfault.com\/questions\/21106\/how-to-reduce-memory-usage-on-a-unix-webserver\">apache &#8211; How to reduce memory usage on a Unix webserver &#8211; Server Fault<\/a>\u4e4b\u540e\uff0c\u5728\/etc\/apache2.conf\u91cc\u9762\uff0c\u6211\u4eec\u9700\u8981\u8fd9\u6837\u7684\u8bbe\u5b9a\uff1a<\/p>\n<pre>StartServers          1\r\nMinSpareServers       1\r\nMaxSpareServers       5\r\nServerLimit          16\r\nMaxClients           16\r\nMaxRequestsPerChild   0\r\nListenBacklog        100<\/pre>\n<p>\u4e3a\u4e86\u51cf\u5c11MySQL\u7684\u5185\u5b58\u5360\u7528\uff0c\u6211\u4eec\u9700\u8981\u6539\u52a8\/etc\/my.cnf\uff0c\u6709\u6587\u7ae0\uff08Google &#8220;MySQL reduce memory&#8221;\uff09\u5efa\u8bae\u4e0d\u76f4\u63a5\u4f7f\u7528MySQL\u63d0\u4f9b\u7684\u4e3asmall memory\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\uff08\u4f8b\u5982\uff1a\u8003\u8651\u5230Wordpress\u7ecf\u5e38\u4f1a\u540c\u65f6\u4f7f\u7528\u591a\u8fbe10\u4e2a\u8868\u8fdb\u884c\u67e5\u8be2\uff09\uff0c\u56e0\u6b64\u7ed9\u51fa\u5173\u952e\u90e8\u5206\uff08[mysqld]\u90e8\u5206\uff09\u7684\u6211\u7684\u53c2\u8003\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<pre>[mysqld]\r\nuser            = mysql\r\nport            = 3306\r\nsocket          = \/var\/run\/mysqld\/mysqld.sock\r\nskip-locking\r\nkey_buffer_size = 1M\r\nmax_allowed_packet = 1M\r\ntable_open_cache = 10\r\nsort_buffer_size = 64K\r\nread_buffer_size = 256K\r\nread_rnd_buffer_size = 256K\r\nnet_buffer_length = 2K\r\nthread_stack = 64K\r\nskip-innodb\r\n# Don't listen on a TCP\/IP port at all. This can be a security enhancement,\r\n# if all processes that need to connect to mysqld run on the same host.\r\n# All interaction with mysqld must be made via Unix sockets or named pipes.\r\n# Note that using this option without enabling named pipes on Windows\r\n# (using the \"enable-named-pipe\" option) will render mysqld useless!\r\n#\r\n#skip-networking\r\nserver-id       = 1\r\n# Uncomment the following if you want to log updates\r\n#log-bin=mysql-bin\r\n# binary logging format - mixed recommended\r\n#binlog_format=mixed\r\n# Uncomment the following if you are using InnoDB tables\r\n#innodb_data_home_dir = \/var\/lib\/mysql\/\r\n#innodb_data_file_path = ibdata1:10M:autoextend\r\n#innodb_log_group_home_dir = \/var\/lib\/mysql\/\r\n# You can set .._buffer_pool_size up to 50 - 80 %\r\n# of RAM but beware of setting memory usage too high\r\n#innodb_buffer_pool_size = 16M\r\n#innodb_additional_mem_pool_size = 2M\r\n# Set .._log_file_size to 25 % of buffer pool size\r\n#innodb_log_file_size = 5M\r\n#innodb_log_buffer_size = 8M\r\n#innodb_flush_log_at_trx_commit = 1\r\n#innodb_lock_wait_timeout = 50<\/pre>\n<p><strong>2. WordPress\u7684\u5b89\u88c5<\/strong><\/p>\n<p>\u53ef\u4ee5\u4e0b\u8f7dWordpress\u7684\u6700\u65b0\u7248\uff0c\u7136\u540e\u7528\u4ed6\u63d0\u4f9b\u7684Famous 5 minutes \u5b89\u88c5\u5b8c\u6bd5\u3002\u6211\u9047\u5230\u7684\u95ee\u9898\u662f\u5982\u4f55\u628a\u65e7\u7cfb\u7edf\uff08<a href=\"http:\/\/zhanxw.dyndns.info\/blo\">http:\/\/zhanxw.dyndns.info\/blo<\/a>g\uff09\u8fc1\u79fb\u5230\u8fd9\u4e2a\u65b0\u5730\u5740\uff08<a href=\"http:\/\/zhanxw.com\/blog\">http:\/\/zhanxw.com\/blog<\/a>\uff09\uff0c\u90a3\u4e48\u5b98\u65b9(<a href=\"http:\/\/codex.wordpress.org\/Moving_WordPress\">http:\/\/codex.wordpress.org\/Moving_WordPress<\/a>) \u63d0\u4f9b\u4e86\u82f1\u6587\u6587\u6863\u5e94\u5bf9\u8fd9\u79cd\u60c5\u51b5\u3002\u7c97\u770b\u8d77\u6765\u6bd4\u8f83\u590d\u6742\uff0c\u4f46\u539f\u7406\u4e0a\u76f8\u5f53\u81ea\u7136\uff1a<\/p>\n<p>(1) \u5907\u4efd\u65e7\u7cfb\u7edf\u7684blog\u6587\u4ef6\u5939\u548c\u6570\u636e\u5e93\uff1b<\/p>\n<p>(2) \u62f7\u8d1d\u8fd9\u4e24\u6837\u5e76\u5b89\u88c5\u5230\u65b0\u57df\u540d\u4e0b\uff1b<\/p>\n<p>(3) \u5728\u65b0\u57df\u540d\u4e0b\u6fc0\u6d3b\u7cfb\u7edf\uff08\u5c31\u662f\u8bbf\u95ee\u4e00\u4e0b\uff0c\u7ed3\u679c\u767b\u5f55\u7684\u65f6\u5019\u88ab\u8f6c\u56de\u65e7\u7cfb\u7edf\uff09\uff1b<\/p>\n<p>(4) \u5230\u65e7\u7cfb\u7edf\u4e2d\u5728Setting\u91cc\u628a\u4e3b\u673a\uff08domain\uff09\u6539\u6210\u65b0\u7684\u57df\u540d\uff1b<\/p>\n<p>(5) \u628a\u65e7\u7cfb\u7edf\u7684blog\u6587\u4ef6\u5939\u548c\u6570\u636e\u5e93\u518d\u6b21\u62f7\u8d1d\u5230\u65b0\u7684\u57df\u540d\u4e0b\uff1b<\/p>\n<p>(6) \u5728\u65b0\u7684\u57df\u540d\u4e0b\u767b\u5f55\uff0c\u8fd9\u56de\u5c31\u5e94\u8be5\u6ca1\u95ee\u9898\u4e86\uff01<\/p>\n<p><strong>3. VPN\u7684\u5b89\u88c5<\/strong><\/p>\n<p>\u4e3b\u8981\u53c2\u8003\u4e24\u4e2a\u6587\u7ae0\uff1a<\/p>\n<p>\uff081\uff09.<strong><a rel=\"nofollow\" href=\"http:\/\/www.vpser.net\/manage\/linode-vps-pptp-vpn-howto.html\">Linode VPS PPTP VPN \u5b89\u88c5\u914d\u7f6e\u6559\u7a0b &#8211; VPS\u4fa6\u63a2<\/a><\/strong><\/p>\n<p>\uff082\uff09.<strong><a rel=\"nofollow\" href=\"http:\/\/jkey.lu\/install-pptp-on-ubuntu\/#content\">Ubuntu \u4e0a\u5b89\u88c5 pptp \u00bb jKey.lu<\/a><\/strong><\/p>\n<p>\u5176\u4e2d\u6309\u71671\u7684\u6b65\u9aa4\u53ef\u4ee5\u8fdb\u884c\u5230iptables\u547d\u4ee4\u524d\uff0c\u8fd9\u65f6\u5019\u770b\u6587\u7ae02\u7684iptables\u547d\u4ee4\u5373\u53ef\u3002\uff08\u6ce8\u610f\u9ed8\u8ba4\u7cfb\u7edf\u4e0d\u63d0\u4f9biptables\uff0c\u9700\u624b\u52a8\u5b89\u88c5\uff09\u3002\u6ce8\u610f\uff0c\u5982\u679c\u4e0d\u5b8c\u6210\u6587\u7ae02\u63d0\u5230\u7684\u6b65\u9aa4\uff0c\u5728Windows 7\u91cc\u9762\u4f60\u4ecd\u7136\u53ef\u4ee5\u8fde\u63a5\u5230VPN\uff0c\u4f46\u65e0\u6cd5\u8bbf\u95ee\u4efb\u4f55\u7f51\u9875\u3002<\/p>\n<p><strong>4. \u4f7f\u7528BuyVM\u7684\u5176\u4ed6\u7ecf\u9a8c<\/strong><\/p>\n<p>Web\u65b9\u5f0f\u7684\u7ba1\u7406\u754c\u9762\u53ef\u4ee5\u901a\u8fc7<a href=\"manage.buyvm.net\">http:\/\/manage.buyvm.net <\/a>\u6765\u8fdb\u884c\u3002\u767b\u5f55\u4e4b\u540e\u53ef\u4ee5\u8fdb\u884c\u5f00\u5173\u673a\uff0c\u91cd\u542f\uff0c\u67e5\u770bCPU\u3001\u5185\u5b58\u3001\u5e26\u5bbd\u4f7f\u7528\u60c5\u51b5\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2aJava Application\u4ee5Console\u65b9\u5f0f\u767b\u5f55\u5230VPS\u3002<\/p>\n<p>\u4e3a\u4e86\u63a8\u5e7f\u7ad9\u70b9\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Google Analytics\u53bb\u4e86\u89e3\u8bbf\u5ba2\u7684\u6765\u6e90\uff0c\u4e5f\u53ef\u4ee5\u5230Goolge Site Admin\u7f51\u9875\u63d0\u4ea4\u81ea\u5df1\u7684\u7ad9\u70b9\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5bf9\u4e8e\u6211\u4f7f\u7528\u7684Wordpress\uff0c\u63a8\u8350\u4f7f\u7528\u7684Plugin\u5305\u62ec\uff1a<\/p>\n<p>\uff081\uff09SI Captcha \uff1a \u5728\u8bbf\u5ba2\u8f93\u5165comment\u65f6\u63d0\u793aCAPTHA<\/p>\n<p>\uff082\uff09Akismet \uff1a\u9632\u6b62\u65e0\u804a\u7684Spammer<\/p>\n<p>\uff083\uff09NextGEN Gallery\uff1a\u63d0\u4f9b\u4e00\u4e2a\u5c55\u793a\u81ea\u5df1\u56fe\u7247\u7684\u65b9\u5f0f<\/p>\n<p>\uff084\uff09Shareaholic\uff1a\u5728\u6bcf\u4e00\u4e2aPost\u4e0b\u9762\u589e\u52a0\u4e00\u884c\uff0c\u65b9\u4fbf\u8bbf\u5ba2\u5c06\u5185\u5bb9\u8f6c\u53d1\u5230delicious\uff0ctwitter\u2026\u2026<\/p>\n<p>\uff085\uff09MathJAX\uff1a\u4e3aWordpress\u63d0\u4f9bLaTeX\u8bed\u6cd5\u652f\u6301\uff0c\u65b9\u4fbf\u4eca\u540e\u8f93\u5165\u548c\u663e\u793a\u6570\u5b66\u516c\u5f0f<\/p>\n<p>\uff086\uff09Limit Login Attempt\uff1a\u5f53\u7528\u6237\u9519\u8bef\u8f93\u5165\u5bc6\u7801\u8d85\u8fc7\u4e00\u5b9a\u6b21\u6570\u65f6\uff0c\u62d2\u7edd\u8be5\u7528\u6237\u7684\u2018\u6076\u610f\u2019\u731c\u6d4b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57282011\u5e741\u6708\u4efd\u7684\u6700\u540e\u4e00\u5929\uff0c\u6211\u975e\u5e38\u5e78\u8fd0\u7684\u53d1\u73b0BuyVM.net\u7684\u6bcf\u5e7415\u7f8e\u5143\u7684VPS\u8ba1\u5212\u5c45\u7136\u8fd8\u6ca1\u5356\u5149\u3002\u6309\u8010\u4e0d\u4f4f\u7684\u6211\u7acb\u523b\u638f\u94b1\u3002\u4e4b\u540e\u5c31\u6709\u4e86\u672c\u6587\u3002\u6211\u5c06\u5206\u4e09\u90e8\u5206\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u548c\u8c03\u8bd5(Optimize) LAMP, \u5b89\u88c5\u53ca\u8fc1\u79fbWordPress \u548c\u8bbe\u7f6eVPN. 1. LAMP\u7684\u5b89\u88c5\u548c\u4f18\u5316 \u5982\u679c\u50cf\u6211\u4e00\u6837\u7528BuyVM.net \u6bcf\u5e74$15\u7f8e\u5143\u7684\u8ba1\u5212\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9Ubuntu 10.10 LAMP \u7cfb\u7edf\uff0c\u8fd9\u6837\u4f60\u81ea\u5df1\u5c31\u62e5\u6709\u4e86LAMP\u6574\u5957\u7cfb\u7edf\uff0c\u4f46\u662f\u8fd9\u6837\u7684\u7cfb\u7edf\u4e0d\u80fd\u9002\u5e94Wordpress\u7a0b\u5e8f\u2014\u2014\u5185\u5b58\u7ecf\u5e38\u4e0d\u591f\u7528\u3002\u56e0\u6b64\u6211\u4eec\u5fc5\u987b\u60f3\u529e\u6cd5\u51cf\u5c11Apache2\u548cMySQL\u7684\u5185\u5b58\u6d88\u8017\u3002 \u5bf9\u4e8eApache\uff0c\u901a\u8fc7\u68c0\u67e5aptitude\u7a0b\u5e8f\u53ef\u4ee5\u53d1\u73b0\uff0cUbuntu\u5b89\u88c5\u7684\u662fApache-prefork-mpm\u7248\u672c(\u7248\u672c\u53f7\u4e2d\u7684prefork\u8868\u793a\u7684\u662f\u548cApache 1.3\u7c7b\u4f3c\u7684\u67b6\u6784\uff09\u3002\u8fd9\u4e2a\u67b6\u6784\u4e0b\u6bd4\u8f83\u5173\u952e\u7684\u53c2\u6570\u662f\u6700\u5c11\u548c\u6700\u591a\u7684apache\u8fdb\u7a0b\u7684\u4e2a\u6570\u3002\u5982\u679c\u4e0d\u9650\u5236\uff0c\u5219\u4f1a\u5f88\u5bb9\u6613\u51fa\u73b08-10\u4e2aapache\u8fdb\u7a0b\uff0c\u6709\u7684\u8fdb\u7a0b\u5360\u5185\u5b5830-40M\uff0c\u5f88\u5feb\u4f60\u7684VPS\u5c31\u4f1a\u53cd\u5e94\u53d8\u6162\uff0c\u751a\u81f3crash\u3002\u53c2\u8003apache &#8211; How to reduce memory usage on a Unix webserver &#8211; Server Fault\u4e4b\u540e\uff0c\u5728\/etc\/apache2.conf\u91cc\u9762\uff0c\u6211\u4eec\u9700\u8981\u8fd9\u6837\u7684\u8bbe\u5b9a\uff1a StartServers 1 MinSpareServers 1 MaxSpareServers 5 ServerLimit 16 MaxClients 16 MaxRequestsPerChild 0 ListenBacklog 100 \u4e3a\u4e86\u51cf\u5c11MySQL\u7684\u5185\u5b58\u5360\u7528\uff0c\u6211\u4eec\u9700\u8981\u6539\u52a8\/etc\/my.cnf\uff0c\u6709\u6587\u7ae0\uff08Google &#8220;MySQL reduce memory&#8221;\uff09\u5efa\u8bae\u4e0d\u76f4\u63a5\u4f7f\u7528MySQL\u63d0\u4f9b\u7684\u4e3asmall memory\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\uff08\u4f8b\u5982\uff1a\u8003\u8651\u5230Wordpress\u7ecf\u5e38\u4f1a\u540c\u65f6\u4f7f\u7528\u591a\u8fbe10\u4e2a\u8868\u8fdb\u884c\u67e5\u8be2\uff09\uff0c\u56e0\u6b64\u7ed9\u51fa\u5173\u952e\u90e8\u5206\uff08[mysqld]\u90e8\u5206\uff09\u7684\u6211\u7684\u53c2\u8003\u914d\u7f6e\u5982\u4e0b\uff1a [mysqld] user = mysql port = 3306 socket = \/var\/run\/mysqld\/mysqld.sock [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,3],"tags":[8,9,10,5],"class_list":["post-46","post","type-post","status-publish","format-standard","hentry","category-sysadmin","category-wordpress","tag-apache","tag-lamp","tag-vpn","tag-wordpress-2"],"_links":{"self":[{"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":0,"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhanxw.com\/blog\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}