﻿{"id":879,"date":"2012-06-15T11:01:01","date_gmt":"2012-06-15T03:01:01","guid":{"rendered":"http:\/\/nick.workao.org\/?p=879"},"modified":"2012-06-15T11:01:01","modified_gmt":"2012-06-15T03:01:01","slug":"ubuntu-vps%e7%9a%84%e4%b8%ad%e6%96%87%e5%92%8c%e4%b8%ad%e6%96%87%e4%b9%b1%e7%a0%81%e9%97%ae%e9%a2%98%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/nick.txtcc.com\/index.php\/linux\/879","title":{"rendered":"Ubuntu VPS\u7684\u4e2d\u6587\u548c\u4e2d\u6587\u4e71\u7801\u95ee\u9898\u89e3\u51b3"},"content":{"rendered":"<p>\u6211\u4eec\u7684Ubuntu\u00a0<a title=\"vps\" href=\"http:\/\/kangxiaowei.com\/archives\/tag\/vps\" rel=\"nofollow\" target=\"_blank\">vps<\/a>\u7f3a\u7701\u662f\u82f1\u6587\u73af\u5883\uff0c\u5982\u679c\u8981\u60f3\u5728Ubuntu VPS\u4e0b\u9762\u80fd\u663e\u793a\uff0c\u8f93\u5165\u4e2d\u6587\uff0c\u5fc5\u987b\u8981\u505a\u4e00\u756a\u8bbe\u7f6e\u3002<\/p>\n<div><\/div>\n<p>\u65b9\u6cd5\u4e00\uff1a<\/p>\n<p>\u9996\u5148\uff0c\u5982\u679c\u7528putty\u8fdb\u884cSSH\u767b\u5f55\u5230Ubuntu VPS\u4e0a\uff0c\u8981\u5148\u4fdd\u8bc1putty\u652f\u6301\u4e2d\u6587\uff0c\u8bf7\u53c2\u8003\uff1a<a href=\"http:\/\/rashost.com\/blog\/my-putty-configure\">putty\u7684\u5e38\u89c1\u914d\u7f6e<\/a><\/p>\n<p>\u91cd\u8981\u7684\u8fd8\u662fUbuntu VPS\u7684\u4e2d\u6587\u914d\u7f6e\uff1a<\/p>\n<p>\u521b\u5efa\u6587\u4ef6\/var\/lib\/locales\/supported.d\/zh\uff0c\u5185\u5bb9\u4e3a\uff1a<\/p>\n<p><code>zh_CN.UTF-8 UTF-8\nzh_CN.GBK GBK<\/code><\/p>\n<p>\u8fd0\u884clocale-gen\u4ea7\u751f\u4e2d\u6587\u7684locale\uff0c\u7136\u540e\u4fee\u6539\u6587\u4ef6\/etc\/environment\u5176\u4e2d\u7684LANG\u90e8\u5206\u4e3a\uff1a<\/p>\n<p><code>LANG=&quot;zh_CN.UTF-8&quot;<\/code><\/p>\n<p>\u7136\u540e\u91cd\u542fVPS\uff0c\u91cd\u542f\u540e\u5c31\u53ef\u4ee5\u6b63\u5e38\u663e\u793a\u548c\u8f93\u5165\u4e2d\u6587\u4e86<\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a<\/p>\n<div>\n<div>\n\n<strong>1.\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u8bed\u8a00\u73af\u5883<\/strong>\n\n<code>locale<\/code>\n\n<strong>2.\u67e5\u770b\u7cfb\u7edf\u5185\u5b89\u88c5\u7684locale<\/strong>\n\n<code>root@ubuntu-vps:~#&nbsp;locale&nbsp;-a\nlocale:&nbsp;Cannot&nbsp;set&nbsp;LC_CTYPE&nbsp;to&nbsp;default&nbsp;locale:&nbsp;No&nbsp;such&nbsp;file&nbsp;or&nbsp;directory\nlocale:&nbsp;Cannot&nbsp;set&nbsp;LC_MESSAGES&nbsp;to&nbsp;default&nbsp;locale:&nbsp;No&nbsp;such&nbsp;file&nbsp;or&nbsp;directory\nlocale:&nbsp;Cannot&nbsp;set&nbsp;LC_COLLATE&nbsp;to&nbsp;default&nbsp;locale:&nbsp;No&nbsp;such&nbsp;file&nbsp;or&nbsp;directory\nC\nPOSIX<\/code>\n\n<strong>3.\u5b89\u88c5zh_CN.utf8<\/strong>\n\n<code>root@ubuntu-vps:~#&nbsp;cd&nbsp;\/usr\/share\/locales\nroot@ubuntu-vps:\/usr\/share\/locales#&nbsp;ls\ninstall-language-pack&nbsp;&nbsp;remove-language-pack\nroot@ubuntu-vps:\/usr\/share\/locales#&nbsp;.\/install-language-pack&nbsp;zh_CN\nGenerating&nbsp;locales...\nzh_CN.UTF-8...&nbsp;done\nGeneration&nbsp;complete.\ndpkg-trigger:&nbsp;dpkg-trigger&nbsp;\u5fc5\u987b\u4ece\u7ef4\u62a4\u8005\u811a\u672c\u4e2d\u8c03\u7528(\u6216\u8005\u901a\u8fc7&nbsp;--by-package&nbsp;\u9009\u9879)<\/code>\n\n<strong>4.\u9a8c\u8bc1locale\u5b89\u88c5\u662f\u5426\u6210\u529f<\/strong>\n\n<code>root@ubuntu-vps:\/usr\/share\/locales#&nbsp;locale\nLANG=zh_CN.utf8\nLC_CTYPE=&quot;zh_CN.utf8&quot;\nLC_NUMERIC=&quot;zh_CN.utf8&quot;\nLC_TIME=&quot;zh_CN.utf8&quot;\nLC_COLLATE=&quot;zh_CN.utf8&quot;\nLC_MONETARY=&quot;zh_CN.utf8&quot;\nLC_MESSAGES=&quot;zh_CN.utf8&quot;\nLC_PAPER=&quot;zh_CN.utf8&quot;\nLC_NAME=&quot;zh_CN.utf8&quot;\nLC_ADDRESS=&quot;zh_CN.utf8&quot;\nLC_TELEPHONE=&quot;zh_CN.utf8&quot;\nLC_MEASUREMENT=&quot;zh_CN.utf8&quot;\nLC_IDENTIFICATION=&quot;zh_CN.utf8&quot;\nLC_ALL=<\/code>\n\n\u00a0\n\n<\/div>\n\u89e3\u51b3\u4e2d\u6587\u4e71\u7801\uff1a\n\n1\u3001\u8f6c\u6362\u6587\u4ef6\u5185\u5bb9\u7f16\u7801\n\nWindows\u4e0b\u751f\u6210\u7684\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5176\u4e2d\u6587\u7f16\u7801\u4e3aGBK\uff0c\u5728Ubuntu\u4e0b\u663e\u793a\u4e3a\u4e71\u7801\uff0c\u53ef\u4ee5\u4f7f\u7528iconv\u547d\u4ee4\u8fdb\u884c\u8f6c\u6362\uff1a\n\niconv -f gbk -t utf8 source_file > target_file\n\n2\u3001\u8f6c\u6362\u6587\u4ef6\u540d\u7f16\u7801\n\nWindows\u4e0b\u538b\u7f29\u7684zip\u6587\u4ef6\uff0c\u5728 Ubuntu\u4e0b\u89e3\u5f00\u65f6\uff0c\u4e2d\u6587\u6587\u4ef6\u540d\u4f1a\u663e\u793a\u4e71\u7801\uff0c\u53ef\u4ee5\u7528convmv\u89e3\u51b3\u3002\n\n\u5b89\u88c5convmv\uff1a\n\nsudo apt-get install convmv\n\n\u8f6c\u6362\u6587\u4ef6\u6216\u76ee\u5f55\uff1a\n\nconvmv -f gbk -t utf8 -r \u2013notest *\n\n3\u3001\u89e3\u538bzip\u6587\u4ef6\u4e71\u7801\n\n\u5728Ubuntu\u4e0b\u4f7f\u7528unzip\u89e3\u538bWidnows\u73af\u5883\u4e0b\u751f\u6210\u7684zip\u6587\u4ef6\uff0c\u4f1a\u53d1\u751f\u6587\u4ef6\u540d\u6216\u8005\u76ee\u5f55\u540d\u4e71\u7801\u73b0\u8c61\uff0c\u89e3\u51b3\u529e\u6cd5\u662f\u4f7f\u7528 7-zip\u548cconvmv\u3002\n\n\u5b89\u88c57-zip\u548cconvmv\uff1a\n\nsudo apt-get install convmv p7zip-full\n\n\u89e3\u538bzip\u6587\u4ef6\uff1a\n\nLANG=C 7z e zip_file\n\nconvmv -f gbk -t utf8 -r \u2013notest *\n\n4\u3001\u89e3\u538brar\u6587\u4ef6\u4e71\u7801\n\n\u5728ubuntu\u4e0b\u89e3\u538bWindows\u73af\u5883\u4e0b\u751f\u6210\u7684rar\u6587\u4ef6\uff0c\u540c\u6837\u4f1a\u78b0\u5230\u4e2d\u6587\u4e71\u7801\u95ee\u9898\uff0c\u4f8b\u5982\u4f7f\u75287z\u6765\u89e3\u538b\u3002\n\n\u89e3\u51b3\u529e\u6cd5\u662f\u4f7f\u7528unrar\u6765\u89e3\u538b\u3002\n\n\u5b89\u88c5unrar\uff1a\n\nsudo apt-get install unrar\n\n5\u3001<a title=\"pdf\" href=\"http:\/\/kangxiaowei.com\/archives\/tag\/%E5%9B%BE%E4%B9%A6\" rel=\"nofollow\" target=\"_blank\">pdf<\/a>\u4e2d\u6587\u4e71\u7801\n\nPDF\u6587\u4ef6\u4e2d\u7684\u4e2d\u6587\u663e\u793a\u51fa\u4e71\u7801\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u5b89\u88c5poppler-data\u6765\u89e3\u51b3\uff1a\n\nsudo apt-get install poppler-data\n\n\u53c2\u7167\uff1a\n\nhttp:\/\/rashost.com\/blog\/ubuntu-chinese-locale\uff08Ubuntu VPS\u7684\u4e2d\u6587\u8bbe\u7f6e\uff09\n\nhttp:\/\/blog.rebill.info\/archives\/ubuntu-set-zh_CN-utf8-locale.html\uff08Ubuntu\u4e0b\u8bbe\u7f6e\u4e2d\u6587locale\uff09\n\nhttp:\/\/www.awz.cn\/i\/computer\/linux\/read-46.html\uff08\u4f7f\u7528ubuntu 10.04\u4e2d\u7684\u4e2d\u6587\u4e71\u7801\u95ee\u9898\u89e3\u51b3\uff09\n\n<\/div>","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u7684Ubuntu\u00a0vps\u7f3a\u7701\u662f\u82f1\u6587\u73af\u5883\uff0c\u5982\u679c\u8981\u60f3\u5728Ubuntu VPS\u4e0b\u9762\u80fd\u663e\u793a\uff0c\u8f93\u5165\u4e2d\u6587\uff0c\u5fc5\u987b\u8981\u505a\u4e00\u756a\u8bbe\u7f6e\u3002 \u65b9\u6cd5\u4e00\uff1a \u9996\u5148\uff0c\u5982\u679c\u7528putty\u8fdb\u884cSSH\u767b\u5f55\u5230Ubuntu VPS\u4e0a\uff0c\u8981\u5148\u4fdd\u8bc1put&#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-879","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=879"}],"version-history":[{"count":2,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/879\/revisions"}],"predecessor-version":[{"id":881,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/879\/revisions\/881"}],"wp:attachment":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}