<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mr. 21 &#187; 網際網路</title>
	<atom:link href="http://mr21.in/network-technology/feed" rel="self" type="application/rss+xml" />
	<link>http://mr21.in</link>
	<description>KunMing &#124; SysAdmin &#124; Blogger &#124; G Fans</description>
	<lastBuildDate>Thu, 06 Oct 2011 09:23:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://mr21.in/?pushpress=hub'/>
		<item>
		<title>启用Web服务器的IPv6支持</title>
		<link>http://mr21.in/network-technology/enable-ipv6-support-for-your-webserver.html</link>
		<comments>http://mr21.in/network-technology/enable-ipv6-support-for-your-webserver.html#comments</comments>
		<pubDate>Wed, 06 Apr 2011 12:17:27 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=370</guid>
		<description><![CDATA[前几天Burst西海岸的VPS开售了，于是21一个鸡冻就入了一个最低配的，看样子貌似我是第14个客户…… 由于Burst在主机配置里面提到了提供IPv6地址，于是昨天发了ticket请求设置，今早来看已经给... ]]></description>
			<content:encoded><![CDATA[<p>前几天Burst西海岸的VPS开售了，于是21一个鸡冻就入了一个最低配的，看样子貌似我是第14个客户……<br />
由于Burst在主机配置里面提到了提供IPv6地址，于是昨天发了ticket请求设置，今早来看已经给我设了4个v6的地址，但是默认安装默认配置的Apache2并不支持IPv6的访问，于是萌生了整理一下各主流Web Server启用IPv6方式访问的设置，其实都不复杂。</p>
<p>21个人喜欢nano编辑器，如果你喜欢vi，稍微换一下命令就行。<br />
如果提示</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span>: <span style="color: #c20cb9; font-weight: bold;">nano</span>: <span style="color: #7a0874; font-weight: bold;">command</span> not found</pre></td></tr></table></div>

<p>请如下操作</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Debian<span style="color: #000000; font-weight: bold;">/</span>Ubuntu: <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">nano</span>
CentOS<span style="color: #000000; font-weight: bold;">/</span>Fedora: yum <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">nano</span></pre></td></tr></table></div>

<p>高快直达：1. <a href="http://mr21.in/enable-ipv6-support-for-your-webserver.html#ap2">Apache 2</a> / 2. <a href="http://mr21.in/enable-ipv6-support-for-your-webserver.html#ng">Nginx</a> / 3. <a href="http://mr21.in/enable-ipv6-support-for-your-webserver.html#lhd">Lighttpd</a> / 4. <a href="http://mr21.in/enable-ipv6-support-for-your-webserver.html#iis">IIS 6/7</a><br />
<span id="more-370"></span></p>
<h3><a name="ap2"></a>Apache 2</h3>
<p>一般使用系统<strong>超级牛力apt-get</strong>或者<strong>yum</strong>安装的Apache2都支持了IPv6，只是默认的配置里面不支持，设置办法如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>port.conf
或
<span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf
或
<span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf</pre></td></tr></table></div>

<p>打开nano编辑器后，按Ctrl+W搜索Listen，之后将其修改为如下格式</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">Listen 0.0.0.0:80
Listen [::]:80</pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出。之后重启apache2的服务便可：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Debian<span style="color: #000000; font-weight: bold;">/</span>Ubuntu: invoke-rc.d apache2 restart 或 invoke-rc.d httpd restart
CentOS<span style="color: #000000; font-weight: bold;">/</span>Fedora: service apache2 restart 或 service httpd restart</pre></td></tr></table></div>

<h3><a name="ng"></a>Nginx</h3>
<p>Nginx的话，需要查看一下是否启用了IPv6的支持，在shell输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">localhost:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #666666; font-style: italic;"># ./nginx -V</span>
nginx version: nginx<span style="color: #000000; font-weight: bold;">/</span>0.7.67
built by <span style="color: #c20cb9; font-weight: bold;">gcc</span> 4.3.2 <span style="color: #7a0874; font-weight: bold;">&#40;</span>Debian 4.3.2-<span style="color: #000000;">1.1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
TLS SNI support enabled
configure arguments: <span style="color: #660033;">--with-ipv6</span> <span style="color: #660033;">--user</span>=www <span style="color: #660033;">--group</span>=www <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module</pre></td></tr></table></div>

<p>然后查看输出的信息是否包含了<strong>&#8211;with-ipv6</strong>字眼，如果没有，那很遗憾，需要重新编译（请参阅<a href="http://www.vpser.net/build/nginx-lnmp-ipv6.html">这里</a>和<a href="http://www.vpser.net/manage/nginx-upgrade.html">这里</a>）或者卸载掉当前的Nginx使用<a href="http://lnmp.org/">LNMP最新版本</a>，如果有，那么继续：<br />
找到你的nginx配置文件，可以使用如下命令</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">localhost:~<span style="color: #666666; font-style: italic;"># whereis nginx.conf</span>
nginx: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx</pre></td></tr></table></div>

<p>然后编辑该文件</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>nginx.conf</pre></td></tr></table></div>

<p>在Server配置段里面寻找<strong>Listen</strong>增加对IPv6的监听，增加一句<strong>listen  [::]:80;</strong>修改为如下大概效果：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">server
        {
                listen       80;
                listen  [::]:80;
                server_name mr21.in www.mr21.in;</pre></td></tr></table></div>

<p>如果想要仅仅监听IPv6而忽略IPv4请求，可以增加<strong>ipv6only=on</strong>的参数：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">listen [::]:443 default ipv6only=on;</pre></td></tr></table></div>

<p>如果监听某个特定的IPv6地址，这样</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">listen [2607:f0d0:1004:2::2]:80;</pre></td></tr></table></div>

<p>诸如此类，以此类推，之后重启你的Lihttpd即可。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">Debian/Ubuntu: invoke-rc.d nginx restart
CentOS/Fedora: service nginx restart</pre></td></tr></table></div>

<h3><a name="lhd"></a>Lighttpd</h3>
<p>首先，要先确认你的Lighttpd是否支持IPv6，在终端输入<strong>lighttpd -V</strong>，查看是否有<strong>IPv6 support</strong>字样。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;"># lighttpd -V
Build-Date: Sep 30 2008 06:18:08
&nbsp;
Event Handlers:
	+ select (generic)
	+ poll (Unix)
	+ rt-signals (Linux 2.4+)
	+ epoll (Linux 2.6)
	- /dev/poll (Solaris)
	- kqueue (FreeBSD)
&nbsp;
Network handler:
	+ sendfile
&nbsp;
Features:
	+ IPv6 support
	+ zlib support
	+ bzip2 support
	+ crypt support
	+ SSL Support
	+ PCRE support
	- mySQL support
	- LDAP support
	- memcached support
	- FAM support
	- LUA support
	- xml support
	- SQLite support
	- GDBM support</pre></td></tr></table></div>

<p>如果没有<strong>IPv6 support</strong>字样，可能需要升级版本或者重新编译，如果有，编辑Lighttpd的配置文件：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;"># vi lighttpd.conf</pre></td></tr></table></div>

<p>在主配置区添加<strong>server.use-ipv6 = &#8220;enable&#8221;</strong>，以下为同时启用IPv4和IPv6的情况：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">server.use-ipv6 = &quot;enable&quot;
server.port = 80
$SERVER[&quot;socket&quot;] == &quot;0.0.0.0:80&quot; {
# 这里为你的站点配置
}</pre></td></tr></table></div>

<p>之后重启你的Lihttpd即可。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">Debian/Ubuntu: invoke-rc.d lighttpd restart
CentOS/Fedora: service lighttpd restart</pre></td></tr></table></div>

<h3><a name="iis"></a>IIS 6/7</h3>
<p>IIS 6/7 步骤比较繁琐，21就不当搬运工了，大家可以移步去 <a href="http://loosky.net/?p=1198">http://loosky.net/?p=1198</a> 瞅瞅；</p>
<p>-EOF-</p>
<p>——————–<br />
引用参考：<br />
1. Enabling IPv6 Support in nginx: <a href="http://kovyrin.net/2010/01/16/enabling-ipv6-support-in-nginx/">http://kovyrin.net/2010/01/16/enabling-ipv6-support-in-nginx/</a>；<br />
2. Lighttpd: Enable IPv6 Support: <a href="http://www.cyberciti.biz/tips/linux-unix-lighttpd-ipv6-support.html">http://www.cyberciti.biz/tips/linux-unix-lighttpd-ipv6-support.html</a>；<br />
3. IPv6的安装与配置： <a href="http://loosky.net/?p=1198">http://loosky.net/?p=1198</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/enable-ipv6-support-for-your-webserver.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>全球开放注册的域名后缀(TLD)</title>
		<link>http://mr21.in/network-technology/avaliable-tld-for-global-register.html</link>
		<comments>http://mr21.in/network-technology/avaliable-tld-for-global-register.html#comments</comments>
		<pubDate>Tue, 18 Jan 2011 01:41:53 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[.CN]]></category>
		<category><![CDATA[.IN]]></category>
		<category><![CDATA[BS]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[CCTV]]></category>
		<category><![CDATA[IM]]></category>
		<category><![CDATA[QQPCC]]></category>
		<category><![CDATA[TLD]]></category>
		<category><![CDATA[域名]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=389</guid>
		<description><![CDATA[[转] 本文转载自博客好玉米（好域名）； 基于作者【原创文章，转载请注明】的要求进行分享，原文在此，感谢QQPCC。 ————————————————————————————————... ]]></description>
			<content:encoded><![CDATA[<div id="copyfrom" style="width:100%;">
<div style="font-size:20pt;float:left;line-height:1.25em;width:50px;">[转]</div>
<div style="float:left; width:630px;">本文转载自博客<a href="http://haoyu.me">好玉米（好域名）</a>；<br />
基于作者【原创文章，转载请注明】的要求进行分享，原文<a href="http://haoyu.me/1008.html">在此</a>，感谢QQPCC。</div>
</div>
<p>——————————————————————————————————————<br />
<strong>21插播：</strong>如果不想看罗嗦话的，请直接按 Ctrl+F 搜索你想要注册的后缀是否在文中。</p>
<h3>零、原作者引言</h3>
<p>　　爱玩小米的朋友其实有一点是非常纠结的，那就是许多后缀其实是不允许咱们国人注册的，也就是说，这些后缀对持有人的身份有严格的限制，就算有好域名也与你无缘。当然，有些朋友通过伪造资料或所谓的“挂靠”来注册这样的域名，但QQPCC要告诉这些朋友，其实这是不安全的，就算你想尽办法、侥幸地避开了注册局的审查，但你永远不是这个域名的主人，域名转移、域名交易都会遇到麻烦……<br />
　　那么，到底那些后缀是你可以堂堂正正地用你的中国身份注册的呢？可能很多朋友并不清楚，QQPCC今天就来给各位爱好小米的朋友说一说，如果还有QQPCC没有发现的，请大家补充。</p>
<h3>一、国际顶级域名</h3>
<ol>普通用户可以注册的有：.com、.net、.org、.info、.biz、.coop、.mobi、.name、.tel。</ol>
<h3>二、区域后缀</h3>
<ol>其实都有限制，只限各大洲自己的组织或公民注册。<br />
不过亚洲的.asia没有关系，因为咱们都是亚洲人，呵呵！<br />
非洲和大洋洲好像现在并没有神码后缀，呵呵，美洲有，但现在只有二级域名开放。<br />
有个特殊的东东，前苏联的.su，ICANN很多次想删除，但前苏联人民对其太有感情了，多年来一直没有删除成功，这个可公开注册。</ol>
<p><span id="more-389"></span></p>
<h3>三、国家（地区）后缀</h3>
<ol>
<li><strong>亚洲各国（地区）后缀开放注册的有：</strong><br />
.kg（吉尔吉斯坦）、.kz（哈萨克斯坦）、.tj（塔吉克斯坦）、.uz（乌兹别克斯坦）、.mn（蒙古）、.tw（台湾）、.af（阿富汗）、.in（印度）、.ir（伊朗）、.pk（巴基斯坦）、.lk（斯里兰卡）、.la（老挝）、.ph（菲律宾）、.tl（东帝汶）、.vn（越南）、.am（亚美尼亚）、.ps（巴勒斯坦）、.ae（阿联酋）。<br />
亚洲还有两个特殊的后缀，一个是.io，好像原来是专门准备给英国的印度洋领地设的，开放注册。<br />
还有一个是.cn，是不开放的，但国人注册没有问题啦，注不注是你的事了。</li>
<li><strong>欧洲各国（地区）后缀开放注册的有：</strong><br />
.by（白俄罗斯）、.cz（捷克）、.md（摩尔多瓦）、.pl（波兰）、.ro（罗马尼亚）、.ru（俄罗斯）、.dk（丹麦）、.gg（根西岛）、.im（马恩岛）、.is（冰岛）、.je（泽西岛）、.lt（立陶宛）、.lv（拉脱维亚）、.se（瑞典）、.es（西班牙）、.gr（希腊）、.me（黑山）、.si（斯洛文尼亚）、.at（奥地利）、.be（比利时）、.ch（瑞士）、.li（列支敦士登）、.lu（卢森堡）。<br />
欧洲也有个特殊的后缀，就是.cat，是专门为推广加泰罗尼亚语设立的，开放注册。</li>
<li><strong>美洲各国（地区）后缀开放注册的有：</strong><br />
.ag（安提瓜和巴布达）、.ai（安圭拉）、.bs（巴哈马）、.cu（古巴）、.dm（多米尼克）、.do（多米尼加共和国）、.gd（格林纳达）、.gp（瓜德罗普岛）、.ht（海地）、.kn（圣基茨和尼维斯）、.lc（圣卢西亚）、.ms（蒙特塞拉特）、.pr（波多黎各）、.tc（特克斯和凯科斯群岛）、.tt（特里尼达和多巴哥）、.vc（圣文森特）、.vg（英属维尔京群岛）、.bz（伯利兹）、.cr（哥斯达黎加）、.mx（墨西哥）、.gl（格陵兰）、.co（哥伦比亚）、.ec（厄瓜多尔）、.gf（法属圭亚那）、.gy（圭亚那合作共和国）、.pe（秘鲁）、.sr（苏里南）。</li>
<li><strong>非洲各国（地区）后缀开放注册的有：</strong><br />
.bi（布隆迪）、.dj（吉布提）、.mu（毛里求斯）、.mw（马拉维）、.sc（塞舌尔）、.ug（乌干达）、.yt（法属马约特岛）、.cd（刚果民主共和国）、.cg（刚果共和国）、.cm（喀麦隆）、.ga（加蓬）、.gq（赤道几内亚）、.st（圣多美）、.td（乍得）、.ly（利比亚）、.ma（摩洛哥）、.ac（阿森松岛）、.na（纳米比亚）、.sh（圣海伦娜）、.ci（科特迪瓦）、.gw（几内亚比绍）、.ne（尼日尔）、.sl（塞拉利昂）、.sn（塞内加尔）、.tg（多哥）。</li>
<li><strong>大洋洲各国（地区）后缀开放注册的有：</strong><br />
.cc（科科斯群岛）、.cx（圣诞岛）、.nf（诺福克岛）、.as（美属萨摩亚）、.fm（密克罗尼西亚）、.ki（基里巴斯）、.mh（马绍尔群岛）、.mp（北马里亚纳群岛）、.nu（纽埃岛）、.pn（皮特凯恩群岛）、.tk（托克劳）、.to（汤加）、.tv（图瓦卢）、.vu（瓦努阿图）、.wf（瓦利斯和富图纳群岛）、.ws（萨摩亚群岛）。</li>
<li><strong>其它</strong><br />
另外，ICANN还专门为南极洲设了几个后缀，有些当然不开放，呵呵，但还是有下面这样几个是开放的：<br />
.gs（南乔治亚）、.hm（赫德和麦当劳群岛）、.tf（法属南极领地）。</li>
</ol>
<p>——————————————————————————————————————<br />
21对原文进行了部分删减和适当的重排，主要是为了方便自己查询，同时也给访问Mr. 21博客的各位提供一点丰富业余生活的资料，目前21本人持有的TLD有.com/.cn/.net/.org/.info/.in/.me/.im/.name/.lu，其中CN是帮朋友注册的，属于余孽，因为白名单及认证和备案的问题，且国内的空间及各种虚拟服务良莠不齐，导致需要用<strong>CN+外国空间</strong>的组合很难实现，会在到期时候直接丢弃，该朋友已经改用.im了。</p>
<p>想当年21个人持有的20多个CN玉米长达三年之久，结果因为2009年12月9日的CCTV的一段“强烈批判”（请参考《<a href="http://mr21.in/recommendations-about-domain-name-registration-in-china.html">关于域名注册的建议</a>》），让我看到了CN玉米在个人把玩领域的覆灭，于是，在徒劳地认证了我的易名账户之后，里面的CN米也就不了了之了。</p>
<p>希望转载<a href="http://haoyu.me/author/qqpcc">QQPCC</a>的这篇文章可以给大家注册域名的时候提供一点参考，毕竟一些后缀以中文拼音的方式来理解还是比价有意思的，比如.lu(路) .gd(广东) .pl(破烂) .lv(驴) .ai(爱) .bs(鄙视) .mn(蒙牛)等…… 当然，这些玩意儿是见仁见智的，大家自己了然就好，哈哈~</p>
<p>同时，21想大家推荐<a href="http://haoyu.me/">好玉米（好域名）博客</a>，至于为什么，花两分钟看一下就知道了~ 作者QQPCC这段时间就出了一系列域名注册方面的文章，大家可以前往参考，我在此列个小清单：</p>
<ol>
<li>为什么那么多国人前赴后继地送死  <a href="http://haoyu.me/985.html">http://haoyu.me/985.html</a></li>
<li>.ORG后缀到底怎么样？  <a href="http://haoyu.me/959.html">http://haoyu.me/959.html</a></li>
<li>请理性看待域名优惠码   <a href="http://haoyu.me/931.html">http://haoyu.me/931.html</a></li>
<li>数字好域名之我见  <a href="http://haoyu.me/882.html">http://haoyu.me/882.html</a></li>
<li>别被域名后缀忽悠了你（一）  <a href="http://haoyu.me/814.html">http://haoyu.me/814.html</a></li>
<li>别被域名后缀忽悠了你（二）  <a href="http://haoyu.me/868.html">http://haoyu.me/868.html</a></li>
<li>域名放在国内好还是放在国外好？  <a href="http://haoyu.me/866.html">http://haoyu.me/866.html</a></li>
<li>国际顶级域名后缀详解  <a href="http://haoyu.me/840.html">http://haoyu.me/840.html</a></li>
</ol>
<p>最后，关于注册商，我个人推荐两家：<br />
国外：Godaddy(<a href="http://www.godaddy.com">http://www.godaddy.com</a>)  传说中的“狗爹”，已经很出名了，支持支付宝；<br />
国内：名优网(<a href="http://999.cc">http://999.cc</a>)  广航的注册代理，涵盖各种稀奇古怪的后缀且价格合理，人民币结算。</p>
<p>-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/avaliable-tld-for-global-register.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SSH和谐主机的iptables设置参考</title>
		<link>http://mr21.in/network-technology/a-iptables-configure-example-for-ssh-host.html</link>
		<comments>http://mr21.in/network-technology/a-iptables-configure-example-for-ssh-host.html#comments</comments>
		<pubDate>Thu, 13 Jan 2011 16:49:55 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[denyhosts]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[Ping]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=383</guid>
		<description><![CDATA[这是一个关于SSH番羽土啬的话题，标题及文中的“和谐”=“番羽土啬”，感叹一下我们的文字。 因为21现在手上的VPS数量比较乐观（不是壮观……），因此其中有专司VPN和谐的、SSH和谐的、第... ]]></description>
			<content:encoded><![CDATA[<p>这是一个关于SSH番羽土啬的话题，标题及文中的“和谐”=“番羽土啬”，感叹一下我们的文字。</p>
<p>因为21现在手上的VPS数量比较乐观（不是壮观……），因此其中有专司VPN和谐的、SSH和谐的、第三方推和谐的等用途，当然，Mr. 21博客也在其中一个VPS上，用的LNMP包。</p>
<p>写这个话题的起因是这样的，在<a href="http://www.beishan.info">北山老卫</a>大神的Q群里面，有人提到了想以SSH和谐帐号来换取一些东西，因此引发了21对此的讨论。我的主要观点是不支持这么做，因为不安全（可以参考《<a href="http://mr21.in/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities.html">利用Linux内核的多个安全漏洞提权</a>》，不过本文内容与此关系不大），加上之前帮番茄童鞋配置iptables，因此引发了21对SSH和谐主机安全方面的思考，其中的一方面就是用iptables来过滤不和谐的东西。</p>
<p>是这样的，因为做实验的这个VPS我只用于SSH和谐，并且一般和谐仅限于Web浏览及各种基于Web的应用，所以，以下策略仅开放SSH的22端口并对其它的东西做了相应的限制。</p>
<h3>初始化防火墙</h3>
<p>第一步，我们总是要把一些知道的和不知道的先通通打倒了再说，于是，请如此：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">#清除现有的规则
~#: iptables -F
~#: iptables -X
~#: iptables -Z
&nbsp;
#设定默认策略为丢弃包
~#: iptables -P FORWARD DROP
~#: iptables -P OUTPUT DROP
~#: iptables -P INPUT DROP</pre></td></tr></table></div>

<p>以上是一些初始化的动作，以下是具有具体功能的策略。</p>
<h3>防火墙规则参考一</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">#允许本地回环
~#: iptables -A INPUT -i lo -p all -j ACCEPT
&nbsp;
#允许22端口接受连接
~#: iptables -A INPUT -p tcp --dport 22 -j ACCEPT
&nbsp;
#允许传入的数据包状态
~#: iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
&nbsp;
#允许传出的数据包状态
~#: iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
&nbsp;
#允许传入PING的ICMP包
~#: iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT</pre></td></tr></table></div>

<p>这几条规则实现的效果是：</p>
<ol>
<li>22端口允许用户主动发起TCP连接，一般用于提供SSH服务，如果你的SSH端口不是22，请修改；</li>
<li>其它端口需要ESTABLISHED、RELATED两种状态的数据包才能通过，而通常这两种状态的数据包在TCP协议上的定义是已经建立了连接的后续数据包，也就说，别人无法对你的任何端口主动发起连接，但是由你主动发起连接的数据包可以通过，比如说看网页的数据；</li>
<li>包状态NEW允许SSH用户对外的主动发起连接；</li>
<li>允许外部用户PING本机，这个嘛，方便自己测试，要不挂了都不知道。</li>
<li>关于数据包状态，我是参考这里 <a href="http://liubin.blog.51cto.com/282313/110394">http://liubin.blog.51cto.com/282313/110394</a> 。</li>
</ol>
<p>这样，虽然防住了外面进来的问题，但一定程度上来说，用户通过SSH登录以后就可以干他想干的事情了，对于应用的范围不能达到一个控制的目的，比如说，我前面提到的“一般和谐仅限于Web浏览及各种基于Web的应用”，是的，和谐嘛，也就是用这些了，顶天了再来个FTP或者跳板另外的SSH，于是，21便想到了稍微BT一点的限制，请看参考二。<br />
<span id="more-383"></span></p>
<h3>防火墙规则参考二</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">#允许本地回环
~#: iptables -A INPUT -i lo -p all -j ACCEPT
&nbsp;
#允许22端口的数据进出
~#: iptables -A INPUT -p tcp --dport 22 -j ACCEPT
~#: iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
&nbsp;
#允许状态正常的数据包进入
~#: iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
&nbsp;
#允许访问外部的80、81、8080、443等端口
~#: iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
~#: iptables -A OUTPUT -p tcp --dport 81 -j ACCEPT
~#: iptables -A OUTPUT -p tcp --dport 8080 -j ACCEPT
~#: iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
&nbsp;
#允许UDP数据包外发，由于浏览器发起的是1024~65536之间的随机端口，无法限制为具体端口
~#: iptables -A OUTPUT -p udp -j ACCEPT
&nbsp;
#允许PING测试的数据包进出
~#: iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT
~#: iptables -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT</pre></td></tr></table></div>

<p>好吧，规则二实际上能实现跟规则一差不多的效果，就是让SSH和谐用户能正常浏览Web内容及使用Web应用，那区别在哪里呢？之前提到了规则一的SSH用户只要登录进系统，就可以对外发起任何连接了，而规则二只允许用户发起目标端口为80、81、8080、443(https)的TCP连接和任意UDP连接，这样就能有效的限制用户对于SSH的应用范围。</p>
<h3>小结</h3>
<p>基本上，两个规则都实现了主机仅提供SSH服务（参考一）用于浏览网页（参考二）的目的，并且使用iptables对服务器的其它端口都进行了一些屏蔽，同时提供两种规则方式来实现不同的需求，实际上仅仅这样还是不够的，因为让用户登录到shell里面毕竟还是有一定风险的，特别是一些弱密码的用户也有被暴力猜解的风险，我个人是使用fail2ban的方案来解决暴力猜解的问题，请参考《<a href="http://mr21.in/fail2ban-and-lnmp-configration-for-little-memory-vps.html">小内存优化VPS的LNMP及fail2ban配置</a>》，同时还有denyhosts也是用于防止暴力猜解的，可以参考：《<a href="http://www.vpser.net/security/denyhosts.html">Linux VPS上DenyHosts阻止SSH暴力攻击</a>》。</p>
<p>以上内容是21这两天闲来无事的个人研究成果，才疏学浅难免存在一些不合理或不够精简的地方，如果你有任何意见，请留言指教，谢谢。</p>
<p>-EOF-</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
参考引用：<br />
1. Google: <a href="http://www.google.com/ncr">http://www.google.com/ncr</a><br />
2. iptables 状态机制的描述：<a href="http://liubin.blog.51cto.com/282313/110394">http://liubin.blog.51cto.com/282313/110394</a><br />
3. 定制iptables防火墙策略：<a href="http://ailixing.blog.51cto.com/188828/37309">http://ailixing.blog.51cto.com/188828/37309</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/a-iptables-configure-example-for-ssh-host.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何重置Mac OS X的网络配置</title>
		<link>http://mr21.in/network-technology/reset-mac-os-x-network-configuration-factory-default.html</link>
		<comments>http://mr21.in/network-technology/reset-mac-os-x-network-configuration-factory-default.html#comments</comments>
		<pubDate>Tue, 03 Aug 2010 02:23:42 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[MBP]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Reset]]></category>
		<category><![CDATA[重置]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=363</guid>
		<description><![CDATA[由于Mac OS X的智能化，大多数情况我们是不需要对系统配置进行过多的干涉的，但是当我们的网络设备及各种网络接口配置不断增加的时候（例如我除了自带的Airport、以太网之外，还有3个VPN，... ]]></description>
			<content:encoded><![CDATA[<p>由于Mac OS X的智能化，大多数情况我们是不需要对系统配置进行过多的干涉的，但是当我们的网络设备及各种网络接口配置不断增加的时候（例如我除了自带的Airport、以太网之外，还有3个VPN，两个PPPoE，一个Modem over Serial Port及一个Kindle USBNetwork的接口），而不同的配置多了有可能会导致一些奇怪的网络问题，这个时候我们可以选择将Mac OS X的网络配置重置到出厂设置的状态（其实就是系统自动检测设备并重新生成配置），这样你的网络配置部分就跟全新的Mac OS X电脑一样了。</p>
<p>很简单，只需要重命名以下这个文件，然后重启即可。<br />
将</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">   <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>SystemConfiguration<span style="color: #000000; font-weight: bold;">/</span>preferences.plist</pre></div></div>

<p>改成</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">   <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>SystemConfiguration<span style="color: #000000; font-weight: bold;">/</span>preferences.plist.bk</pre></div></div>

<p>然后重启。</p>
<p>具体操作流程如下：<br />
选择Dock上的“应用程序”->“实用工具”->“终端”，然后输入以下命令</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">MBP:~ <span style="color: #000000;">21</span>$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>SystemConfiguration<span style="color: #000000; font-weight: bold;">/</span>preferences.plist <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>SystemConfiguration<span style="color: #000000; font-weight: bold;">/</span>preferences.plist.bk
Password: （此处输入你当前的密码，无显示，输完回车即可。）</pre></td></tr></table></div>

<p>回车后输入你当前用户的密码，回车，然后重启你的Mac OS X即可。</p>
<p><strong>请注意，你的网络配置会因此丢失，如果有什么特殊的配置，请自行记录。<br />
提示：这个办法无法解决部分OS X通过Airport连接VPN但是无法访问内网的情况。</strong></p>
<p>引用来源：<br />
Steve Jamesson | <a href="http://stevejamesson.com/2008/10/01/reset-mac-os-x-network-configuration-factory-default-airport-interface-disappeared/">Reset Mac OS X network configuration to factory default</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/reset-mac-os-x-network-configuration-factory-default.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>答疑：域名不能添加A记录（国内）</title>
		<link>http://mr21.in/network-technology/qa-domain-control-panel-can-not-add-new-record-in-china.html</link>
		<comments>http://mr21.in/network-technology/qa-domain-control-panel-can-not-add-new-record-in-china.html#comments</comments>
		<pubDate>Wed, 21 Jul 2010 07:48:39 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[BlogBus]]></category>
		<category><![CDATA[CNNIC]]></category>
		<category><![CDATA[域名]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=362</guid>
		<description><![CDATA[以后我会根据偶尔搜索引擎过来的关键词进行特别的回答，这是第一篇，请多指教！ Q: 我在国内的注册的域名，为什么最近莫名其妙的不能在域名的控制面板里面添加新的记录了？ A: 好吧，还... ]]></description>
			<content:encoded><![CDATA[<p>以后我会根据偶尔搜索引擎过来的关键词进行特别的回答，这是第一篇，请多指教！</p>
<blockquote><p><strong>Q:</strong> 我在国内的注册的域名，为什么最近莫名其妙的不能在域名的控制面板里面添加新的记录了？<br />
<strong style="float:left; height:33pt; margin-right:4pt;">A:</strong> 好吧，还是那个经典的话“建设具有中国特色的社会主义网络”，于是我们有一个东西叫“<strong>备案</strong>”，简单的说，只要是在国内工商注册过的域名/互联网服务商就必须遵守国内的游戏规则，所以，如果出现以上情况，请联系你的注册商客服/代理，询问需要提供什么资料才能恢复使用。
</p></blockquote>
<p>就我个人在易名网的体验来说，目前CN域名想要正常使用需要满足以下条件：</p>
<ol>
<li>域名的主办人不允许为“个人”；</li>
<li>向域名注册商提交资料备案，包括营业执照副本复印件、联络人身份证复印件、备案申请单；</li>
<li>进行域名的ICP备案，也就说你需要买一个国内的空间。</li>
</ol>
<p>我的一个CN域名由于缺少第三个条件，目前的情况为“<strong>该域名已被注册管理机构暂停解析</strong>”。</p>
<p>一般来说，第一步是禁用你的域名控制面板的使用，也就说不能添加记录了，第二步是CNNIC停用你的域名，例如《<a href="http://mr21.in/2010-01/blogbus-banned-emergency-solution.html">BlogBus被封应急方案</a>》里面遇到的那种情况 …… 也许情况不都是这样，但是我的确实如此。</p>
<p>所以，Mr. 21一直建议，不要注册CN域名，不要在国内注册域名。域名注册有风险，入行须谨慎。</p>
<p>延伸阅读：<br />
《<a href="http://mr21.in/2009-12/recommendations-about-domain-name-registration-in-china.html">关于域名注册的建议</a>》<br />
《<a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html">虚拟主机答疑之「域名转移」</a>》</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/qa-domain-control-panel-can-not-add-new-record-in-china.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>可信的公用DNS</title>
		<link>http://mr21.in/network-technology/reliable-public-dns.html</link>
		<comments>http://mr21.in/network-technology/reliable-public-dns.html#comments</comments>
		<pubDate>Sun, 20 Jun 2010 05:10:47 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GoogleDNS]]></category>
		<category><![CDATA[Hosts]]></category>
		<category><![CDATA[NortonDNS]]></category>
		<category><![CDATA[OpenDNS]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=356</guid>
		<description><![CDATA[从Mr. 21博客里面为数不多的几篇关于Hosts文件应用的文章（《DropBox》、《BlogBus被封应急方案》等）来看，我们的网络是充满刺激和不明真相的，随时都不知道自己访问的网站到底存不存在，也... ]]></description>
			<content:encoded><![CDATA[<p>从Mr. 21博客里面为数不多的几篇关于Hosts文件应用的文章（《<a href="http://mr21.in/2010-05/dropbox.html">DropBox</a>》、《<a href="http://mr21.in/2010-01/blogbus-banned-emergency-solution.html">BlogBus被封应急方案</a>》等）来看，我们的网络是充满刺激和不明真相的，随时都不知道自己访问的网站到底存不存在，也不太敢确定自己看到的是不是真的，于是我们需要一些手段来解决，其中之一就是使用<strong>可信的公用DNS（Public DNS）</strong>。</p>
<p>下面列举目前网上流行的比较可靠的三个DNS，使用哪个，看个人爱好了：</p>
<ul style="height:60px;">
<div style="float:left;">
<li>Google Public DNS </li>
<li>Open DNS </li>
<li>Norton DNS </li>
</div>
<div style="float:left; margin-left:9pt;">
|  <strong>8.8.8.8 / 8.8.4.4</strong><br />
|  <strong>208.67.222.222 / 208.67.220.220</strong><br />
|  <strong>198.153.192.1 / 198.153.194.1</strong>
</div>
</ul>
<p>但是，我们知道另外有种方式叫“DNS污染”，就是在你获得电脑获取正确的域名解析结果前，墙先把一个假的结果反馈给你，于是电脑便会忽略了那个来得比较慢的正确结果，也就说，我们单纯使用一些可信的公用DNS还是不够的，于是还需要一些修改过的小程序来解决这样的问题。</p>
<ul>
程序名称：Anti Dns Pollution<br />
程序作者：Ying David ( <a href="http://www.google.com/profiles/lehui99">http://www.google.com/profiles/lehui99</a> )<br />
开发语言：JAVA<br />
授权方式：开源<br />
下载地址：<a href="http://www.williamlong.info/archives/2184.html">http://www.williamlong.info/archives/2184.html</a></p>
<p>下面说一下这个小程序的具体工作流程：首先程序启动后，会从文本文件dnsfilter.properties中读取配制，然后去一个不存在的DNS服务器——但这个IP地址却是国外的——中进行DNS查询被劫持的域名，然后返回的IP地址就是被劫持的IP，被记录下来，之后正常的DNS查询中，就自动把这些IP地址过滤了。这个程序以后会不定期更新，或许也会出.NET版本，请在我的Google Reader上关注更新。</p>
<blockquote><p>
对于高级用户，可以手动用文本编辑器修改配置文件dnsfilter.properties：</p>
<ul>
BindToIP：小程序启动后作为DNS服务期绑定53端口，这里指定绑定的IP地址<br />
DnsServer：国外的DNS服务器，可以设置为OpenDNS或Google DNS服务器的IP地址<br />
ResponseTimeout：DNS查询返回超时的时间（毫秒）<br />
TestDnsServer：测试DNS服务器，请指定一个不存在的DNS服务期，但要求IP是国外的<br />
TestRespTimeout：测试DNS服务器的查询返回超时时间（毫秒），也就是DNS劫持的旁路回复超时时间<br />
TestCount：测试DNS服务器的次数，为了得到所有被劫持的IP地址，需要一定的测试次数<br />
小程序的执行文件和源代码在同一个压缩包内，请点上面的链接下载（含源代码）。</ul>
</blockquote>
</ul>
<p>好吧，看到这里，基本上应该是可以保持一个稍微正常的网络使用环境了。</p>
<p>部分内容引用自：</p>
<div style="height:90px;">
<div style="float:left; width:140px;">
月光博客<br />
Google Public DNS<br />
Open DNS<br />
Norton DNS
</div>
<div>
<a href="http://www.williamlong.info/archives/2184.html">http://www.williamlong.info/archives/2184.html</a><br />
<a href="http://code.google.com/speed/public-dns/">http://code.google.com/speed/public-dns/</a><br />
<a href="http://www.opendns.com/">http://www.opendns.com/</a><br />
<a href="http://www.nortondns.com/">http://www.nortondns.com/</a>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/reliable-public-dns.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>DropBox</title>
		<link>http://mr21.in/network-technology/dropbox.html</link>
		<comments>http://mr21.in/network-technology/dropbox.html#comments</comments>
		<pubDate>Sat, 15 May 2010 15:35:41 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[DropBox]]></category>
		<category><![CDATA[Hosts]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=352</guid>
		<description><![CDATA[多的不用说，你明白的。 Windows，使用记事本（WinXP以上，请找到“记事本”然后右键，用管理员方式运行），然后选择“文件->打开”，输入 1 %windir%\system32\drivers\etc\hosts Unix/Linux，请打开Termina... ]]></description>
			<content:encoded><![CDATA[<p>多的不用说，你明白的。</p>
<p>Windows，使用记事本（WinXP以上，请找到“记事本”然后右键，用管理员方式运行），然后选择“文件->打开”，输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">%windir%\system32\drivers\etc\hosts</pre></td></tr></table></div>

<p>Unix/Linux，请打开Terminal（终端），输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">sudo nano /etc/hosts</pre></td></tr></table></div>

<p>苹果Mac OS X，打开“实用工具”，点击“终端”，输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts</pre></td></tr></table></div>

<p>然后，在你打开的文件的最末尾，输入下面一行，可以暂时解决这个问题</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">174.36.30.71    www.dropbox.com dropbox.com</pre></td></tr></table></div>

<p>目前暂时发现的替代品，按我的条件筛选 － 需要满足Mac OS X和Windows之间跨平台，有以下服务：</p>
<blockquote><p>
SpiderOAK &#8211; <a href="http://spideroak.com">http://spideroak.com</a> &#8211; 行规免费2G，我喜欢这样风格的Page，且支持众多Linux发行版。<br />
MozyHome &#8211; <a href="https://mozy.com/home/free">https://mozy.com/home/free</a> &#8211; 行规免费2G，据说跟大佬EMC有一腿，上传速度不错。<br />
SugarSync &#8211; <a href="https://www.sugarsync.com">https://www.sugarsync.com</a> &#8211; 行规免费2G，跨平台跨到手机上去了……
</p></blockquote>
<p>以上链接均<strong>不包含</strong>推介，原汁原味，放心点击。Btw, idrive.com的服务慎用，跨平台的同时，连帐号都是分立的。</p>
<p>这是一个跟互联网作对的国度。</p>
<p>延伸阅读：<br />
《<a href="http://www.williamlong.info/archives/2173.html">Dropbox无法访问</a>》 － 月光博客<br />
《<a href="http://www.williamlong.info/archives/2174.html">纪念Dropbox君</a>》 － 月光博客</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/dropbox.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dreamhost到Hawkhost搬家手记</title>
		<link>http://mr21.in/network-technology/dreamhost-to-hawkhost-hosting-move-note.html</link>
		<comments>http://mr21.in/network-technology/dreamhost-to-hawkhost-hosting-move-note.html#comments</comments>
		<pubDate>Mon, 08 Mar 2010 06:17:22 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[Hawkhost]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=333</guid>
		<description><![CDATA[前言 2009年4月，因为朋友GordianZ帮助的关系，购入一个777优惠码的Dreamhost（简称DH）主机，之后的几个博客便都搭建在上面，总的来说，还是稳定可靠的，不过，今年4月到期的续费价格高达$119.4... ]]></description>
			<content:encoded><![CDATA[<h4>前言<a name="#00"></a></h4>
<div class="imgdivimg2"><img src="http://images.dreamhost.com/logo.png" /></div>
<p>2009年4月，因为朋友<a href="http://GordianZ.com">GordianZ</a>帮助的关系，购入一个777优惠码的Dreamhost（简称DH）主机，之后的几个博客便都搭建在上面，总的来说，还是稳定可靠的，不过，今年4月到期的续费价格高达$119.40，这对不从博客上获得收入的21来说还是一笔很大的开支，于是我便策划着搬家。</p>
<div class="imgdivimg2"><img src="http://www.hawkhost.com/images/logo.gif" width="156px" /></div>
<p>2009年12月，因为朋友<a href="http://www.beishan.info">老卫</a>的非盈利性主机评论博客提到一家主机商叫Hawkhost（简称HH），俗称老鹰主机，在12月份推出了一个高达50%的优惠码，<a href="http://www.hawkhost.com/Shared/compare">基础方案$3.29/mo</a>的费用打折后堪称亲民，于是毫不犹豫就购入一个帐户（老卫把这种行为叫“不理智消费”），但是为什么没有一购入就搬家呢？</p>
<p>搬家前其实是基于两点考量：</p>
<ol>
<li>稳定性未知。虽然官方声称能达到99.9% Uptime，但是我们都知道这个99.9%可以有很多种算法。</li>
<li>可靠性未知。我们知道有些小主机商实际上是骗人的，一两个月后就消失，需要观察。</li>
</ol>
<p>所以，在设置了一个Uptime以后，就暂时闲置了，直到一月初在我的建议之下朋友Tomato也成为WP党的一员，于是应用方面的监测也开始了。就到目前为止的情况来看，长达两个月时间的监测，Uptime非常不错，值得信赖 ── 除了前两个月电信的线路抽风外，所以我决定将DH上的几个博客都迁移过来。</p>
<p>首先说明，因为这是DH到HH的手记，具备一些部分主机可能不具备的特性，所以请酌情参考，有疑问请留言。<br />
Dreamhost和Hawkhost同时具备一个条件：SSH，也就说，很多复杂或者麻烦的操作，我可以通过SSH直接在主机上操作，避免了FTP上传下载需要花费的额外时间开销。这也是这篇手记与一般教程不同的地方。<br />
<span id="more-333"></span></p>
<h3>Dreamhost 的备份<a name="#01"></a></h3>
<p>在DH上执行备份，有两种办法，我分别写出，因为过程混杂，实际上两种我都用到了。</p>
<ul>
<h4>备份方法 一<a name="#011"></a></h4>
<p>Dreamhost提供了一个备份的服务，在DH面板<sup>[<a href="http://mr21.in/network-technology/dreamhost-to-hawkhost-hosting-move-note.html#footnote_0_333" id="identifier_0_333" class="footnote-link footnote-identifier-link" title="http://panel.dreamhost.com 登录，这个简称为DH面板">1</a>]</sup>左侧Sidebar的位置，<strong>+DreamHost -> Backup Your Account</strong>，然后点一下唯一的按钮，DH会提交你的备份请求到队列里面 ── 对，是要排队的，如果前面的人不多，应该马上就好，备份完成后你的DH帐户的注册邮箱会收到一封邮件，大概内容如下：</p>
<blockquote><p><strong>[username 3158xxxx] Success! Your account (#526xxx) has been backed up!</strong></p>
<p>Ta da!  Your ENTIRE DreamHost account has been backed up now here:</p>
<p>http://backups.dreamhost.com/2010-01-05-GQ2SRxxxxxxxxx <strong>//备份服务登录的链接。</strong></p>
<p>username: {backup login user}  <strong>//登录的用户名，http验证的。</strong><br />
password: {backup login passwd}  <strong>//登录的密码。</strong></p>
<p>Your backup will only be available at this location for FIVE days.. so<br />
please hurry and download what you need right away!<br />
<strong>//意思是说，备份会保存5天，请尽快处理。</strong></p>
<p>Here are all the users/mailboxes we&#8217;ve backed up (as zipped homedirs):<br />
NOTE: Any users with more than 4GB of data have been skipped!<br />
       <strong>{your dh account list here}<br />
//你的DH主帐户和子帐户都会备份（即使home目录不同），并且在这里列出一个清单。</strong></p>
<p>And here are all your mysql databases we&#8217;ve backed up (as gzipped dumps):<br />
NOTE: Any databases with more than 4GB of data have been skipped!<br />
       <strong>{your dh mysql database list here}<br />
//你名下的所有数据库都会备份，并且在这里列出一个清单。</strong></p>
<p>Enjoy!<br />
The Happy DreamHost Account Backup Robot!</p></blockquote>
<p>这个办法会自动备份你所有的东西，非常方便，但是如果你想要更有挑战性呢？方法二。
</ul>
<ul>
<h4>备份方法 二<a name="#012"></a></h4>
<p>先说明，如果你使用备份方法一没有问题，请直接跳入下一章节。</p>
<p>在这里我们需要登入DH的SSH，使用SSH对自己指定的文件进行打包存放，然后再转移，但是这个办法对独立home目录的子帐户无效。<br />
我个人推荐win用户使用putty客户端（Linux和Mac用户直接打开终端输入<strong>ssh username@host</strong>就行），简单明了，登入以后，先输入pwd确认自己的位置，一般都是在用户自己的目录下的，比如我的用户名是delive，效果如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">pwd</span>
<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>delive  <span style="color: #ff0000;">'如果不是 /home?/username 格式的，继续'</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">pwd</span>
<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>delive</pre></td></tr></table></div>

<p> OK，确认自己已经在自己帐户的目录下了，然后执行以下命令备份文件（不包括数据库）：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">打包压缩需要备份的目录
格式：<span style="color: #c20cb9; font-weight: bold;">tar</span> zcf 目的文件名.tar.gz 需要打包压缩的目录（用空格隔开，可以多个）
范例：
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
目录<span style="color: #000000;">1</span> 目录<span style="color: #000000;">2</span> 目录<span style="color: #000000;">3</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tar</span> zcf bak.tar.gz ~<span style="color: #000000; font-weight: bold;">/</span>目录<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span> ~<span style="color: #000000; font-weight: bold;">/</span>目录<span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">/</span> ~<span style="color: #000000; font-weight: bold;">/</span>目录<span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span>: Removing leading <span style="color: #000000; font-weight: bold;">`/`</span> from member names
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
bak.tar.gz 目录<span style="color: #000000;">1</span> 目录<span style="color: #000000;">2</span> 目录<span style="color: #000000;">3</span></pre></td></tr></table></div>

<p>到这一步，我们已经把目录1/2/3打包为bak.tar.gz文件了，接下来是数据库</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">备份数据库
格式：mysqldump -h数据库主机 -u数据库用户名 <span style="color: #660033;">-p</span> 数据库名 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">1</span>.sql
范例：
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ mysqldump -hmysql.21.com <span style="color: #660033;">-ublog21</span> <span style="color: #660033;">-p</span> 21db <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">21</span>.sql
Enter password: <span style="color: #ff0000;">'提示这个的时候请输入数据库访问密码，没有回显的，输完回车就行'</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ mysqldump -hmysql.21.com <span style="color: #660033;">-ublog21</span> <span style="color: #660033;">-p</span> 22db <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">22</span>.sql
Enter password:
依此类推</pre></td></tr></table></div>

<p>然后是打包数据库</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tar</span> zcf mysql.tar.gz <span style="color: #000000;">21</span>.sql <span style="color: #000000;">22</span>.sql
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
.<span style="color: #000000; font-weight: bold;">/</span> ..<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">21</span>.sql <span style="color: #000000;">22</span>.sql bak.tar.gz mysql.tar.gz 目录<span style="color: #000000;">1</span> 目录<span style="color: #000000;">2</span> 目录<span style="color: #000000;">3</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tar</span> zcf dh.tar.gz bak.tar.gz mysql.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
.<span style="color: #000000; font-weight: bold;">/</span> ..<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">21</span>.sql <span style="color: #000000;">22</span>.sql bak.tar.gz dh.tar.gz mysql.tar.gz 目录<span style="color: #000000;">1</span> 目录<span style="color: #000000;">2</span> 目录<span style="color: #000000;">3</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>avalanche<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">pwd</span>
<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>delive</pre></td></tr></table></div>

<p>至此，这个繁琐又复杂的SSH备份总算搞定了。
</ul>
<p>实际上，方法二算是比较啰唆复杂的，并且在一些特殊情况下备份不完整（如果是一个人使用的DH倒是不存在这样的问题），但是为了学习嘛，不过大多数情况下用方法一就行。<br />
下一步就是把备份出来的数据弄到新主机上，这次就需要SSH了，虽然通过一些PHP脚本能搞定，但是我建议有SSH干嘛不用呢？本机也可以想办法下载一份留存，这个留到最后的章节讲解。</p>
<h3>数据的迁移<a name="#02"></a></h3>
<p>因为前一节提到了两种备份办法，所以这一节会对应之前两种方法的迁移方法，基本上来说，不算复杂，但是问题是，备份一的迁移方法要比备份二的迁移方法麻烦一些，为什么呢？请看。</p>
<ul>
<h4>迁移方法 一（对应备份一）<a name="#021"></a></h4>
<p>先简述，因为之前备份一实际上备份文件是存放在DH的备份服务器上的，并且以网页的形式体现的，而除了http下载之外，我们似乎也没有其它办法获取那些备份文件，如果子帐户多一点或者数据库多一点，那会变得比较麻烦。<br />
正常情况下，我们可以在网页右键选择“使用迅雷下载全部链接”来搞定这个问题，但是，本手记的目的是不通过本机的迁移，所以，我们将用SSH解决。</p>
<p>登录HH的SSH，然后我们准备好之前DH备份完成的邮件，开始：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">21MBP:~ 21$ ssh user@example.com
The authenticity of host 'example.com (174.37.xxx.xx)' can't be established.
RSA key fingerprint is cc:bd:03:fc:f7:59:fe:96:90:82:44:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'example.com,174.37.xxx.xx' (RSA) to the list of known hosts.
example@example.com's password: 
example@example.com [~]#</pre></td></tr></table></div>

<p>这是在我苹果本子上登录的提示，一般初次登录，会提示你接受一个密钥用于双方的加密数据传输，这个时候输入<strong>yes</strong>就行，输入<strong>y</strong>的话会提示错误，之后输入密码，如果正确无误的话，我们就登录进去了。接下来准备下载那些备份文件：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># pwd  //确定当前位置</span>
<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>example
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># mkdir temp  //创建一个temp目录备用</span>
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd temp  //切换到temp目录</span>
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ls  //列出目录</span>
.<span style="color: #000000; font-weight: bold;">/</span> ..<span style="color: #000000; font-weight: bold;">/</span>
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># wget http://backups.dreamhost.com/2010-01-05-GQ2SRxxxxxxxxx -r --http-user={backup login user} --http-password={backup login password} </span>
<span style="color: #ff0000;">'{此处省略暴多的乱七八糟的提示}'</span>
Downloaded: <span style="color: #000000;">42</span> files, 397M <span style="color: #000000; font-weight: bold;">in</span> 1m 5s <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">6.11</span> MB<span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;">#</span></pre></td></tr></table></div>

<p>这里用到的<strong>http://backups.dreamhost.com/2010-01-05-GQ2SRxxxxxxxxx、{backup login user}、{backup login password} </strong>均出自DH发给你提示备份成功的邮件。<br />
恩，我是通过wget抓取网页并且在本地重建的方式把备份服务器上的所有备份文件一次性下载下来的办法。通常在两个美国主机之间传输数据，基本上单位都是以“M（兆）”来计算的，我300多M的数据一分钟多点就全部搞定了。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ls</span>
.<span style="color: #000000; font-weight: bold;">/</span> ..<span style="color: #000000; font-weight: bold;">/</span> backups.dreamhost.com index.html
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd backups.dreamhost.com</span>
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #000000; font-weight: bold;">/</span>backups.dreamhost.com<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ls</span>
.<span style="color: #000000; font-weight: bold;">/</span> ..<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">2010</span>-01-05-GQ2SRxxxxxxxxx  
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #000000; font-weight: bold;">/</span>backups.dreamhost.com<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd 2010-01-05-GQ2SRxxxxxxxxx</span>
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #000000; font-weight: bold;">/</span>backups.dreamhost.com<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>-01-05-GQ2SRxxxxxxxxx<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ls</span>
.<span style="color: #000000; font-weight: bold;">/</span> ..<span style="color: #000000; font-weight: bold;">/</span> mysql  <span style="color: #c20cb9; font-weight: bold;">users</span></pre></td></tr></table></div>

<p>经过确认，我们下载下来的主要有两个目录，一个是「mysql」，里面存放你DH帐户的所有mysql数据库，一个是「users」，里面以ftp用户名为目录的方式存放了你的web文件，都是打包好的。到此为止，方法一的文件就全部迁移到新的HH主机上了，如果没有任何问题，请直接进入下一节，我们将讨论如何恢复这些迁移过来的数据。
</ul>
<ul>
<h4>迁移方法 二（对应备份二）<a name="#022"></a></h4>
<p>通过备份二那个繁琐的办法，我们搞定了自己的数据库和文件，并且打包为一个文件叫dh.tar.gz放在/home/delive目录下，那么，对应的，这个步骤就要相对简单了。</p>
<p>登录HH的SSH：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">21MBP:~ 21$ ssh user@example.com
The authenticity of host 'example.com (174.37.xxx.xx)' can't be established.
RSA key fingerprint is cc:bd:03:fc:f7:59:fe:96:90:82:44:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'example.com,174.37.xxx.xx' (RSA) to the list of known hosts.
example@example.com's password: 
example@example.com [~]#</pre></td></tr></table></div>

<p>登录进去以后，我们要新建一个目录用来存放我们的备份文件，这个同 迁移一 是一样的，</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># pwd  //确定当前位置</span>
<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>example
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># mkdir temp  //创建一个temp目录备用</span>
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd temp  //切换到temp目录</span>
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ls  //列出目录</span>
.<span style="color: #000000; font-weight: bold;">/</span> ..<span style="color: #000000; font-weight: bold;">/</span></pre></td></tr></table></div>

<p>接下来我们就要把之前的备份文件弄过来了，这次简单了，直接在SSH里面通过ftp就搞定了，这里用到的用户名密码是你DH的用户名密码，不再是之前的备份邮件里面提到的那个，请谨记</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ftp your_dh_domain.com</span>
Connected to your_dh_domain.com.
<span style="color: #000000;">220</span> DreamHost FTP Server
<span style="color: #000000;">500</span> AUTH not understood
<span style="color: #000000;">500</span> AUTH not understood
KERBEROS_V4 rejected <span style="color: #c20cb9; font-weight: bold;">as</span> an authentication <span style="color: #7a0874; font-weight: bold;">type</span>
Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>your_dh_domain.com:hh_user<span style="color: #7a0874; font-weight: bold;">&#41;</span>: your_dh_user <span style="color: #ff0000;">'输入你的DH用户名'</span>
<span style="color: #000000;">331</span> Password required <span style="color: #000000; font-weight: bold;">for</span> delive.
Password: <span style="color: #ff0000;">'输入你的DH密码'</span>
<span style="color: #000000;">230</span> User delive logged in.
Remote system <span style="color: #7a0874; font-weight: bold;">type</span> is UNIX.
Using binary mode to transfer files.
<span style="color: #c20cb9; font-weight: bold;">ftp</span><span style="color: #000000; font-weight: bold;">&gt;</span> get dh.tar.gz
<span style="color: #7a0874; font-weight: bold;">local</span>: dh.tar.gz remote: dh.tar.gz
<span style="color: #000000;">227</span> Entering Passive Mode <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">67</span>,<span style="color: #000000;">205</span>,<span style="color: #000000;">61</span>,<span style="color: #000000;">244</span>,<span style="color: #000000;">208</span>,<span style="color: #000000;">60</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.
<span style="color: #000000;">150</span> Opening BINARY mode data connection <span style="color: #000000; font-weight: bold;">for</span> dh.tar.gz <span style="color: #7a0874; font-weight: bold;">&#40;</span>xxxxxx bytes<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">226</span> Transfer complete.
xxxxxxx bytes received <span style="color: #000000; font-weight: bold;">in</span> xx.xx seconds <span style="color: #7a0874; font-weight: bold;">&#40;</span>xxxx Kbytes<span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">ftp</span><span style="color: #000000; font-weight: bold;">&gt;</span> by
<span style="color: #000000;">221</span> Goodbye.
example<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ls</span>
.<span style="color: #000000; font-weight: bold;">/</span> ..<span style="color: #000000; font-weight: bold;">/</span> dh.tar.gz</pre></td></tr></table></div>

<p>恩，文件在SSH里面通过FTP的方式从DH拉到HH了，接下来就是解压什么的，因为之前我们压缩过了，给个范例参考，根据自己的需要修改就成：<br />
example@example.com [~/temp]# <strong>tar zxf 文件名.tar.gz</strong>
</ul>
<p>总的来说，实际上在迁移这步，两种办法都差不多，只不过一个是通过wget下载，一个是用过ftp，而实际上后者这个ftp同样可以通过wget来替代，稍微麻烦的是方法一的文件多了点，而方法二比较干脆，就一个压缩包搞定。下面，我们要搞定的部署我们的新主机HH。</p>
<p><font color="red">[未完待续，余下部分便是数据恢复，还有目录整理。]</font></p>
---------------------------------------<ol class="footnotes"><li id="footnote_0_333" class="footnote">http://panel.dreamhost.com 登录，这个简称为DH面板</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/dreamhost-to-hawkhost-hosting-move-note.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>百度应急访问解析</title>
		<link>http://mr21.in/network-technology/biadu-emergency-solution.html</link>
		<comments>http://mr21.in/network-technology/biadu-emergency-solution.html#comments</comments>
		<pubDate>Tue, 12 Jan 2010 03:15:53 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[Baidu]]></category>
		<category><![CDATA[Hosts]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=316</guid>
		<description><![CDATA[新闻早报，据说百度被攻陷了，NS被攻陷了。好吧，又是Hosts了。 请打开记事本或者新建一个文本文档，然后复制以下内容进去 echo+ &#62;&#62; %windir%\system32\drivers\etc\hosts echo 202.108.22.5 www.baidu.com b... ]]></description>
			<content:encoded><![CDATA[<p>新闻早报，据说百度被攻陷了，NS被攻陷了。好吧，又是Hosts了。</p>
<p>请打开记事本或者新建一个文本文档，然后复制以下内容进去</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span>+ <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">%</span>windir<span style="color: #000000; font-weight: bold;">%</span>\system32\drivers\etc\hosts
<span style="color: #7a0874; font-weight: bold;">echo</span> 202.108.22.5   www.baidu.com baidu.com <span style="color: #000000; font-weight: bold;">&gt;&gt;%</span>windir<span style="color: #000000; font-weight: bold;">%</span>\system32\drivers\etc\hosts
start http:<span style="color: #000000; font-weight: bold;">//</span>baidu.com</pre></div></div>

<p>然后，<strong>文件->另存为</strong>，<strong>保存类型</strong>为“<u>所有文件</u>”，起名<strong>baidu.cmd</strong>，<br />
然后，Win2000/XP可以双击baidu.cmd使用，WinVista/7请文件上<strong>右键</strong>选择“以管理员身份运行”，<br />
运行完即可。</p>
<p>然后是，<a href="http://www.beishan.info">老卫</a>说我最近改Hosts改上瘾了……<br />
以下部分是笑话，请参考~</p>
<blockquote><p>RT @lengxiaohua: 百度被黑的真正原因是：伊朗圣战军的新任领袖阿卜杜.阿卜杜拉（abaidu.abaidula)看百度不爽，犯了名讳：）</p></blockquote>
<blockquote><p><img src="http://mr21.in/wp-content/uploads/2010/01/bd.jpg" alt="" /></p></blockquote>
<blockquote><p>RT @Showfom: Baidu公司注册于英属开曼群岛，Baidu的创始人李彦宏持有美国绿卡，Baidu启动的资金是美国的风险投资，现在美资在Baidu中占有51%以上的份额，所以百度是一家地地道道的美资公司。所以伊朗人才不惜代价干掉了百度。</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/biadu-emergency-solution.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>虚拟主机答疑之「域名转移」</title>
		<link>http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html</link>
		<comments>http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#comments</comments>
		<pubDate>Fri, 08 Jan 2010 04:52:52 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[Domain Name]]></category>
		<category><![CDATA[Godaddy]]></category>
		<category><![CDATA[Name.com]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[域名]]></category>
		<category><![CDATA[虚拟主机]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=304</guid>
		<description><![CDATA[前言 实际上「域名转移」跟虚拟主机之间的关系不是必然的，不过既然有这个系列，就凑合到一块儿一起写吧，基本上这也属于这次大家自发的「网络移民行动」的一部分，所以，就概括来讲... ]]></description>
			<content:encoded><![CDATA[<h4>前言<a name="no0"></a></h4>
<p>实际上「域名转移」跟虚拟主机之间的关系不是必然的，不过既然有这个系列，就凑合到一块儿一起写吧，基本上这也属于这次大家自发的「网络移民行动」的一部分，所以，就概括来讲了，基本上还是一些基于原理的东西，可能絮絮叨叨的大家也烦，不过所谓一通百通嘛，中国教育在这方面确实可以，比较重视基础科学。不罗嗦了，开始。</p>
<p>现在国内形势紧张，加上前几天<a href="http://51.com">51.com</a>、<a href="http://it168.com">it168.com</a>、<a href="http://blogbus.com">blogbus.com</a>的域名相继被服务商<a href="http://www.dns.com.cn">新网互联</a>以“存在低俗内容”的理由进行了ClientHold<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_0_304" id="identifier_0_304" class="footnote-link footnote-identifier-link" title="意思是：注册商留置，该状态由注册商设置，域名可以续费，但不能正常使用。">1</a>]</sup>，导致一段时间不能访问，甚至Blogbus.com时至今日还不能使用，可见我们这些野蛮的域名服务商手段之低俗！将域名转移外迁刻不容缓<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_1_304" id="identifier_1_304" class="footnote-link footnote-identifier-link" title="我曾在《关于域名注册的建议》里面提出了相关的建议和解决办法">2</a>]</sup>！</p>
<blockquote>
<h2><a name="menu">文章目录：</a></h2>
<li>负、 <a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no0">前言</a></li>
<li>一、 <a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no1">答疑</a></li>
<li>二、 <a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no2">域名转移流程</a></li>
<li>三、 <a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no3">额外说明</a>
<ol style="margin-top:2px;">
<li style="margin: 0 auto; margin-left:20px; line-height:1.5em;"><a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no30">你的权利</a></li>
<li style="margin: 0 auto; margin-left:20px; line-height:1.5em;"><a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no35">关于风险</a></li>
<li style="margin: 0 auto; margin-left:20px; line-height:1.5em;"><a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no31">关于费用</a></li>
<li style="margin: 0 auto; margin-left:20px; line-height:1.5em;"><a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no32">关于时间</a></li>
<li style="margin: 0 auto; margin-left:20px; line-height:1.5em;"><a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no33">关于转移时效性</a></li>
<li style="margin: 0 auto; margin-left:20px; line-height:1.5em;"><a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html#no34">延伸阅读</a><a name="no1"></a></li>
</ol>
</li>
</blockquote>
<p><span id="more-304"></span></p>
<h3>答疑</h3>
<p>Q: <strong>什么是域名转移？</strong><br />
A: 从原理上来说，域名转移实际上属于一个<a>服务商变更</a>的行为，形象的说就是“迁户口”，人还是你这个人，只是你的户籍地变了。而域名还是你的域名，只是服务商变了，而且基本上来说，流程也跟迁户口差不多。</p>
<p>Q: <strong>服务商都起什么作用？</strong><br />
A: 呃，这个可以大体分为两个阶段，早期和现下，分开阐述。</p>
<ul>
<li><strong>早期：</strong><br />
	在互联网的青铜器时代，域名注册服务商(简称DSP)<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_2_304" id="identifier_2_304" class="footnote-link footnote-identifier-link" title="简称DSP, Domain Registration Service Provider">3</a>]</sup>仅仅提供了注册代理的服务，简单的说就是，DSP代理了ICANN的域名注册服务，你向DSP提交注册请求，DSP向ICANN提交你的注册请求，而DSP就收点服务费，那DSP起什么作用呢？DSP负责你跟ICANN之间的沟通，还有用户数据的维护，提供域名注册信息修改的交互界面，但是有一项重要的服务是不提供的：解析服务DNS<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_3_304" id="identifier_3_304" class="footnote-link footnote-identifier-link" title="Domain Name Server">4</a>]</sup>，也就说，在早期，你注册一个域名，是需要自己搭建DNS，或者租用别人的DNS，而这个跟域名注册是分开的。</li>
<p> 　</p>
<li><strong>现下：</strong><br />
	基本上就是现在大多数人接触到的服务模式了，你注册了一个域名，DSP同时提供<a>注册服务和解析服务</a>，这样对于域名使用的门槛就降低了，基本上任意操作，而DSP收取的年费里面通常也就包含了<a>注册费+解析费+利润</a>。当然，国内那种动辄上百上千年费的，基本上属于暴利，现在COM/NET/ORG的大概价格基本上是50~60左右<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_4_304" id="identifier_4_304" class="footnote-link footnote-identifier-link" title="更便宜也有，请自行斟酌">5</a>]</sup>。
</li>
</ul>
<p>Q: <strong>为什么要转移服务商？</strong><br />
A: 这个，原因可以有很多，比如说发现更便宜的DSP了、服务更好的DSP、更能保障用户权益的DSP了，总而言之言而总之就是，原来那家呆不下去了。</p>
<blockquote><p>举个例子，坏的，比如说新网互联，目前的状态是要求域名必须备案才能使用、备案需要提交身份证资料、备案需要以公司名义、价格每年上百、服务人员态度傲慢、无视用户权益擅自更改用户域名状态等等<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_5_304" id="identifier_5_304" class="footnote-link footnote-identifier-link" title="例如blogbus.com被ClientHold，造成目前长达2天时间无法访问">6</a>]</sup>；<br />
再举个好的，比如说Godaddy，不需要备案、不需要任何真实资料（邮箱需要是真实的）、价格约合人民币50多、面板功能齐全无需客服人工干涉、在未授权状态下不会擅自更改用户域名状态。
</p></blockquote>
<p>这个好的坏的不太好判断，不过终极建议就是：别把你的数据和域名留在国内，请参阅《<a href="http://mr21.in/2009-12/recommendations-about-domain-name-registration-in-china.html">关于域名注册的建议</a>》。<a name="no2"></a></p>
<h3>域名转移流程</h3>
<p>Q: <strong>怎么转出呢？</strong><br />
A: 首先，如果你的域名状态是Locked，那么需要unlock，然后需要区分国内的DSP和国外的DSP，而国内的DSP同时还需要区分是国内代理还是国外代理。</p>
<ol>
<li><strong>国内之DSP</strong><br />
就目前的形式来说，向你的DSP提出你要转移域名，请他们提供<strong>转移码</strong><sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_6_304" id="identifier_6_304" class="footnote-link footnote-identifier-link" title="通常也可以称为授权码，主要是用来验证你是否有权限转移该域名，也就说，不能随便告诉陌生人">7</a>]</sup>，然后准备你的身份证电子件<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_7_304" id="identifier_7_304" class="footnote-link footnote-identifier-link" title="最好同时准备有电子件、也就是图片，然后再准备个复印件用来发传真，各家DSP的要求不尽相同">8</a>]</sup>，然后你的DSP会告诉你需要提供什么资料，然后一项一项提供，并且慢慢等吧，直到你获取你的<strong>转移码</strong>，一般大概需要3~7天。</li>
<li><strong>国内之国内代理</strong><br />
基本上国内代理目前的操作流程同<strong>国内之DSP</strong>，一样需要提供身份证，不过有代理帮你操作可能会方便点。</li>
<li><strong>国内之国外代理</strong><br />
一般直接跟代理索要<strong>转移码</strong>就行，并且不需要提供任何文件证明，一般情况下只要你的邮箱是能用都OK，大概需要几分钟就能收到转移码的邮件，最长不会超过一个小时，除非你的代理刻意卡你。</li>
<li><strong>国外DSP</strong><br />
基本上，只要你在后台就能找到域名的转移码，例如Name.com叫Auth Code、 Godaddy点击Authorization Code发送到邮箱，并且没有任何门槛，转入转出自由。</li>
</ol>
<p>Q: <strong>怎么转入呢？</strong><br />
A: 这个简单，一般在DSP的网站找到Domain Transfer<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_8_304" id="identifier_8_304" class="footnote-link footnote-identifier-link" title="Godaddy">9</a>]</sup>或类似的字眼<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_9_304" id="identifier_9_304" class="footnote-link footnote-identifier-link" title="Name.com, Transfer Domain Names">10</a>]</sup>就行了，然后按照向导一步一步操作就行了。</p>
<p>Q: <strong>转入失败怎么办？</strong><br />
A: 这个不用担心，如果转入失败，国外DSP通常会把域名款沿付款方式返回，或者存在该网站属于你的账户中。国内DSP，不建议转入，这篇文就是为了让你远离它们。</p>
<p>Q: <strong>那转移过程会发生什么？</strong><br />
A: 首先，在你获得了域名的转移码之后，我们就可以开始了，以下是大概的步骤，具体请参阅你的DSP说明：</p>
<ol>
<li>寻找一家合适的新DSP并注册一个账户</li>
<li>找到Domain Transfer<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_8_304" id="identifier_10_304" class="footnote-link footnote-identifier-link" title="Godaddy">9</a>]</sup>或类似的字眼<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_9_304" id="identifier_11_304" class="footnote-link footnote-identifier-link" title="Name.com, Transfer Domain Names">10</a>]</sup>，然后提交你的域名</li>
<li>新DSP会发邮件通知你确认转移</li>
<li>老DSP会发邮件确认转移（国内DSP貌似没有，他们应该都是人工放行的）</li>
<li>确认老DSP邮件里面提供的链接</li>
<li>新DSP发邮件告诉你转入成功</li>
<li>流程结束<a name="no3"></a><a name="no30"></a></li>
</ol>
<h3>额外说明</h3>
<p><strong>你的权利</strong><br />
你的域名跟DSP实际上只是一个托管的关系，你托管由你创意出来的域名给DSP而已，在人人生而平等的社会，自由转出转入是你的权利，不过ICANN规定了，新注册或者转入必须满60天后才能再次转出，当然，DSP是否接受你也是他们的权利，但是对于域名，你应该拥有完全的自主权，包括WHOIS资料、解析设置、域名状态<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_10_304" id="identifier_12_304" class="footnote-link footnote-identifier-link" title="那个ClientHold就是域名状态的一种">11</a>]</sup>等。<a name="no35"></a></p>
<p><strong>关于风险</strong><br />
我们可以随意注册或者迁入迁出域名，不过前提是你的域名符合各国NIC的法律条款，否则各国的NIC随时能通过DSP注销你的域名，例如加拿大的.ca，德国的.de，美国的.us都在TOS明确要求需要一个真实的该国地址或是在该国生活的人的联系方式，否则他们随时有权利注销你的域名，这点请广大喜欢奇异后缀的玉米人注意了。同时，一些第三世界的国家基本上在有恃无恐的状态也能随意处理你的域名，所以，选择一个好归宿也是非常重要的。同时请注意，<strong style="color:red;">在你域名转移的过程中，不要随便透露你的转移码给无关的人，这很可能导致你的域名不再属于你<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_6_304" id="identifier_13_304" class="footnote-link footnote-identifier-link" title="通常也可以称为授权码，主要是用来验证你是否有权限转移该域名，也就说，不能随便告诉陌生人">7</a>]</sup></strong>。<a name="no31"></a></p>
<p><strong>关于费用</strong><br />
基本上大家都说转移是免费的，不过国内某些野蛮DSP在你要求转出的时候可能会要求你交纳“手续费”，那就交吧，这是没办法的，否则他们卡着你是转不出来的。而对于大部分DSP来说，获取你自己域名的转移码，也就是转出是不需要任何费用的。但是，你依然会产生一些花费，因为转入时你的新DSP需要你交纳域名一年的年费，实际上就相当于在转移后再给域名续费一年，并且这个是必须的，因为之前Mr. 21说过了，DSP收取的年费里面通常也就包含了<a>注册费+解析费+利润</a>，不过这同时也是每年都需要交纳的费用，所以你并没有什么额外的损失，并且域名的有效期是叠加的，并不会因为你今天缴费，有效期就变成明年的明天，是在你原来的有效期上叠加的。<a name="no32"></a></p>
<p><strong>关于时间</strong><br />
如果你是在国外DSP转出，那么基本上转移需要的时候不会超过24小时<sup>[<a href="http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html#footnote_11_304" id="identifier_14_304" class="footnote-link footnote-identifier-link" title="不熟悉流程的话大概1~2天">12</a>]</sup>，Mr. 21曾经帮朋友把一个域名从Godaddy转移到Name.com，大概花了一个小时不到的时候，因为都有robot在自动处理，只要你配合看看邮件点点链接就可以了。但是如果你的老DSP是国内DSP，那么一般是等待3~7天时间，我推断应该是人工审核转出的。所以在转移域名的时候需要把这个时间考虑进去，不要在到期前两三天再来转。反正有效期是叠加的。<a name="no33"></a></p>
<p><strong>关于转移时效性</strong><br />
请注意，这是重点，<strong style="color:red;">大部分DSP的转移码是有时效性的！</strong>也就说，在你获取转移码的时候，通常时效性是5~7天，也就说你必须在5~7天内把转入请求提交到你的新DSP那里，否则过期作废，那么你就需要重新申请一次转移码，之于国内DSP来说，我们会很痛苦的。不过也有例外，例如NAME.com的转移码就是常态的，只要你unlock了，随时转出，这也算是一个安全隐患吧，不过转出时同样需要邮件确认的。<a name="no34"></a></p>
<p><strong>延伸阅读</strong></p>
<ol>
<li><a href="http://mr21.in/2009-12/the-virtual-host-guide-no-1-parking-your-domain-name.html">虚拟主机答疑之「绑定」</a> Mr. 21</li>
<li><a href="http://mr21.in/2009-12/the-virtual-host-guide-no-2-addon-and-parking.html">虚拟主机答疑之「Addon」&#038;「Parking」</a> Mr. 21</li>
<li><a href="http://mr21.in/2009-12/recommendations-about-domain-name-registration-in-china.html">关于域名注册的建议</a> Mr. 21</li>
<li><a href="http://www.name.com/domains/de">.DE Domain Names</a></li>
<li><a href="http://www.name.com/domains/us">.US Domain Names</a></li>
</ol>
---------------------------------------<ol class="footnotes"><li id="footnote_0_304" class="footnote">意思是：注册商留置，该状态由注册商设置，域名可以续费，但不能正常使用。</li><li id="footnote_1_304" class="footnote">我曾在《关于域名注册的建议》里面提出了相关的建议和解决办法</li><li id="footnote_2_304" class="footnote">简称DSP, Domain Registration Service Provider</li><li id="footnote_3_304" class="footnote">Domain Name Server</li><li id="footnote_4_304" class="footnote">更便宜也有，请自行斟酌</li><li id="footnote_5_304" class="footnote">例如blogbus.com被ClientHold，造成目前长达2天时间无法访问</li><li id="footnote_6_304" class="footnote">通常也可以称为授权码，主要是用来验证你是否有权限转移该域名，也就说，不能随便告诉陌生人</li><li id="footnote_7_304" class="footnote">最好同时准备有电子件、也就是图片，然后再准备个复印件用来发传真，各家DSP的要求不尽相同</li><li id="footnote_8_304" class="footnote">Godaddy</li><li id="footnote_9_304" class="footnote">Name.com, Transfer Domain Names</li><li id="footnote_10_304" class="footnote">那个ClientHold就是域名状态的一种</li><li id="footnote_11_304" class="footnote">不熟悉流程的话大概1~2天</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/the-virtual-host-guide-no-3-domain-transfer.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>虚拟主机答疑之「Addon」&amp;「Parking」</title>
		<link>http://mr21.in/network-technology/the-virtual-host-guide-no-2-addon-and-parking.html</link>
		<comments>http://mr21.in/network-technology/the-virtual-host-guide-no-2-addon-and-parking.html#comments</comments>
		<pubDate>Tue, 08 Dec 2009 06:33:13 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[Addon]]></category>
		<category><![CDATA[CPanel]]></category>
		<category><![CDATA[Parking]]></category>
		<category><![CDATA[域名]]></category>
		<category><![CDATA[绑定]]></category>
		<category><![CDATA[虚拟主机]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=297</guid>
		<description><![CDATA[这篇专门解释cPanel中关于「Addon」绑定和「Parking」绑定的区别与共同点。 注：习惯性翻译 Addon Domain : 附加域、附加域名 Parking Domain : 暂停的域、停放域 这里提到的「Addon」&#038;「Parking」是两... ]]></description>
			<content:encoded><![CDATA[<p>这篇专门解释cPanel中关于「Addon」绑定和「Parking」绑定的区别与共同点。</p>
<blockquote><p>
注：习惯性翻译<br />
<strong>Addon Domain</strong> : 附加域、附加域名<br />
<strong>Parking Domain</strong> : 暂停的域、停放域</p></blockquote>
<p>这里提到的「Addon」&#038;「Parking」是两种不同的绑定方式，从原理上来说是相同的，只是表现效果不同。</p>
<p>首先，先上一个例子，我在国内找到的关于国外主机配置的信息：</p>
<blockquote><p><strong>500MB空间</strong> ￥XX元/年<br />
流量：5G<br />
网站数量 :2个<br />
支持CGI/PHP/MySQL(为Linux系统)<br />
子域名 :5个<br />
绑定域名 :2个<br />
FTP帐号 :2个+CP控制面板1个<br />
MySQL数据库:1个(大小与WEB空间共享)<br />
IIS限制 :无限制<br />
CPU限制 :无限制<br />
每加1G流量+10元</p></blockquote>
<p>我们仔细想想，可以发现其实很多cPanel空间商不同方案之间有几个区别</p>
<blockquote><p><strong>容量XXXM、流量：XG、网站数量：X个、FTP账号：X个</strong></p></blockquote>
<p>容量跟流量我们知道怎么回事儿了，<br />
但是为什么买一个空间，居然还有个指标是“网站数量：X个”呢？而不是单单标示“绑定域名：X个”呢？<br />
其实这个“网站数量：X个”就是我们要提的「Addon」，而“绑定域名：X个”就是「Parking」了。</p>
<p>通常我们在国内购买Windows系列的虚拟主机，一般都是指「Parking绑定」：<strong>共享同级目录的不同域名</strong><br />
也就是说，不论你绑定多少个域名，都是共享一个目录，也就是说，都是指向同一个网站，内容完全一样的，区别只是你的入口（访问的域名）不同，而且无法做到给每个域名分配一个不同的目录。</p>
<p>那如何实现<strong>给每个域名分配一个不同的目录</strong>呢？<br />
这个功能就是「Addon」了，使用「Addon绑定」可以给每个绑定的域名指定不同目录，在访客看来，每个域名所表现的都是一个个独立的网站，彼此之间基本上没有联系（一定程度上也是合租的一种方式）。<br />
从侧面来理解，也就说，如果允许的「Addon绑定」数量越多，你就能建立越多的不同的网站。<br />
<span id="more-297"></span><br />
基本上，大概的原理就说完了，小结一下不同点与相同点。</p>
<blockquote><h5><strong>不同点</strong></h5>
<p><strong>「Addon」绑定</strong><br />
实现方式：每一个域名赋予不同的子目录(subdirectory)以存放不同域名之间的文件内容。<br />
外在表现：每一个不同域名都是一个不同的网站。<br />
资源占用：共享容量和流量，会稍微增加主账户的CPU和内存占用。<br />
费用支出：支付一份费用就可以建立多个不同的网站。<br />
一般表示：「网站数量」、「网站个数」、「可建网站」、「Website」。</p>
<p><strong>「Parking」绑定</strong><br />
实现方式：所有的域名都是设置为同一个目录，共享相同的文件内容。<br />
外线表现：只是不同域名入口的同一个网站。<br />
资源占用：基本上，对主账户没有什么影响，用多少就是多少。<br />
费用支出：需要为每一个网站支付一份费用。<br />
一般表示：「域名绑定」、「绑定数量」、「可绑定域名」。
</p></blockquote>
<blockquote>
<h5><strong>相同点</strong></h5>
<p>都需要《<a href="http://mr21.in/2009-12/the-virtual-host-guide-no-1-parking-your-domain-name.html">虚拟主机答疑之「绑定」</a>》提到的操作进行绑定，并且在网络原理上也是相同的。
</p></blockquote>
<p>在cPanel里面，「Addon」只是用户账户的一个属性。<br />
一般来说，「Addon」和「Parking」是两个相互独立的属性，也有空间商会设置为相同的，具体情况具体分析。<br />
不过现在比较流行Unlimited，所以，这个交流一下就好了。<br />
Btw, 一般来说，「Parking」在域名停放售卖这一块用的比较多一点。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/the-virtual-host-guide-no-2-addon-and-parking.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>虚拟主机答疑之「绑定」</title>
		<link>http://mr21.in/network-technology/the-virtual-host-guide-no-1-parking-your-domain-name.html</link>
		<comments>http://mr21.in/network-technology/the-virtual-host-guide-no-1-parking-your-domain-name.html#comments</comments>
		<pubDate>Tue, 08 Dec 2009 03:29:45 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[CPanel]]></category>
		<category><![CDATA[Domain Name]]></category>
		<category><![CDATA[NameServer]]></category>
		<category><![CDATA[域名]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[绑定]]></category>
		<category><![CDATA[虚拟主机]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=295</guid>
		<description><![CDATA[通常，我们在使用虚拟主机(Virtual Hosting)的时候，都会遇到一个问题：绑定。 那么，使用过虚拟主机的你，看到绑定二字想到的是什么？ 只要是把域名的A记录解析到空间的IP上，这是绑定，对... ]]></description>
			<content:encoded><![CDATA[<p>通常，我们在使用<a href="http://zh.wikipedia.org/zh-cn/虚拟主机" title="什么是虚拟主机？">虚拟主机(Virtual Hosting)</a>的时候，都会遇到一个问题：<strong>绑定</strong>。</p>
<p>那么，使用过虚拟主机的你，看到<strong>绑定</strong>二字想到的是什么？</p>
<ul>
<li>只要是把域名的A记录解析到空间的IP上，这是绑定，对吧？</li>
<li><strong>或者</strong></li>
<li>只要在空间的面板上把域名加进去就好了，这是绑定，对吧？</li>
</ul>
<p>两项操作，你觉得哪项对呢？<br />
其实，<strong>绑定</strong>是一个双向的行为，也就说需要以上提到的两种配置相配合。<br />
这就要稍微提到互联网的运作原理了。</p>
<blockquote><p><strong>原理简述：</strong><br />
通常，我们在浏览器里面输入一个网址（域名， Domain Name）后，浏览器会向电脑上设置的DNS(Domain Name Server)发出请求以获取该网址设定的IP，获取该网址的IP地址之后，浏览器再向反馈回来的IP发送HTTP请求，并在HTTP报文中包含host请求，而虚拟主机所属的服务器就会根据报文中的host请求返回相应的虚拟主机数据。而因为host请求的存在，我们可以在一台服务器一个IP上配置无限个站点（理论上）。</p></blockquote>
<p>由此看来，如果我们购买了虚拟主机，那么需要进行「双向绑定」，通常可以选择进行两种方式进行「绑定」。<br />
<span id="more-295"></span></p>
<h5>方式一：自助设定</h5>
<ul>
<li><strong>简述：</strong><br />
这种方式好处是，你可以自由支配你的NS设置，如果你有什么特殊的需要，可以很方便进行处理。<br />
缺点是，操作起来稍微繁琐，并且因为IP的特殊性，容易出错。<br />
关于NS设置，这里暂不赘述了，以后在后续的文章会提到的，或者请参阅DNS类文章。</li>
</ul>
<p><strong>自助设定</strong>一般分为两部操作，大概如下：</p>
<ol>
<li><strong>绑定域名</strong><br />
这个操作的作用是让你的服务器能回应客户的host请求，确保你的站点能被找到，<br />
不过，通常这个可能不需要你进行操作，你购买的时候，空间商或者合租者会帮你设置好第一个域名。<br />
那么第二个域名就需要你的操作，而这又分为Addon和Parking，稍候会阐述。</li>
<li><strong>设置A记录解析</strong><br />
这个操作的作用是，当你的客户通过浏览器查询的时候，DNS能返回你虚拟主机的服务器IP。<br />
通常需要设置两个A记录，分别为 <strong>www</strong> 和 <strong>@(域名根)（或留空）。</strong>可能还需要设置MX记录，这个另说。</li>
</ol>
<p>那如果空间商不直接提供虚拟主机的IP地址呢？请参考很久以前写的《<a href="http://mr21.in/2005-04/ns-record.html">Ns Record</a>》。</p>
<h5>方式二：NS绑定</h5>
<ul>
<li><strong>简述：</strong><br />
这种方式最好，只要修改了域名的NS设置，其它什么都不用做，静候几个小时（到十几个小时不等）后生效。<br />
缺点是，NS里面基本上所有的记录受限于你的空间服务商提供的面板(Control Panel)，基本上很难对你的域名NS做到自由自主设置。</li>
</ul>
<p><strong>NS绑定</strong>设置方法请参考各个域名商的面板，同时参考空间商提供的NS服务器地址。</p>
<blockquote><p>例如面板为cPanel的空间商的邮件一般提示都是<br />
Nameserver 1: ns1.hawkhost.com<br />
Nameserver 2: ns2.hawkhost.com </p></blockquote>
<p>基本上关于「绑定」就是这么些东西了，有点乱，凑合着看看吧。</p>
<p>Mr. 21近期会整理推出一系列关于虚拟主机应用的教程与大家交流，不足之处请多多指教。<br />
在虚拟主机界，Mr. 21是没有丝毫名气的，嘿嘿~<br />
不过从使用免费主机到收费主机到现在的DH，积攒了不少经验，光面板的种类大多数都体验过了，<br />
从技术概念上来说，各种面板其实都是异曲同工的，不管是CP、DA、LX等，基本上核心的功能也就那些，<br />
因此，Mr. 21主要着重于讲述虚拟主机使用过程中涉及的概念，实际操作请结合自己的平台进行研究，有疑问或者需要帮助可以直接联系Mr. 21.</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/the-virtual-host-guide-no-1-parking-your-domain-name.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>向Google Blog Search主动推送博客更新</title>
		<link>http://mr21.in/network-technology/automatic-ping-to-google-blog-search.html</link>
		<comments>http://mr21.in/network-technology/automatic-ping-to-google-blog-search.html#comments</comments>
		<pubDate>Sun, 12 Jul 2009 15:18:14 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Blog Search]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Ping]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=282</guid>
		<description><![CDATA[事实上，内容没有标题那么“雄伟”， 谁让Google把博客搜索不直接叫“B-Search”呢，虽然不是那么通俗易懂，好歹比较好记…… 今天在Google Reader里面看到一篇文：《关于信息的五分钟问题》。... ]]></description>
			<content:encoded><![CDATA[<p>事实上，内容没有标题那么“雄伟”，<br />
谁让<a href="http://www.google.com/">Google</a>把<a href="http://blogsearch.google.com/">博客搜索</a>不直接叫“B-Search”呢，虽然不是那么通俗易懂，好歹比较好记……</p>
<p>今天在<a href="http://reader.google.com">Google Reader</a>里面看到一篇文：《<a href="http://www.dbanotes.net/techmemo/information_five_minutes.html">关于信息的五分钟问题</a>》。<br />
里面提到一个信息更新的延迟问题，说大概五分钟左右Google Blog Search才能主动索引到你博客的更新，<br />
这对于在发生某些突发事件时抢关键词和索引排名来说是很不利的，慢一秒慢一分钟就要失去多少的PV/IP呀，<br />
事实上，我是不太关注这些的……</p>
<p>于是进行了Google Search，找到两篇关于主动推送(Pinging Service)的文章，<br />
原文请跳转：<a href="http://www.blogcarta.com/2006/10/17/how-to-ping-google-blog-search/">How To Ping Google Blog Search</a> &#038; <a href="http://www.google.com/help/blogsearch/pinging_API.html">About Google Blog Search Pinging Service API</a>。</p>
<p>对于我们<a href="http://www.wordpress.org">WordPress</a>用户来说，请执行以下操作，以到达主动推送(Push)更新到Google Blog Search的目的，<br />
从根源上消除五分钟（或者三分钟、说一秒也行）的信息延迟。</p>
<ol>
<li>登陆后台(/wp-admin)；</li>
<li>选择<strong>Settings</strong>（设置） -> <strong>Writiing</strong>（撰写）；</li>
<li>找到<strong>Update Services</strong>，然后在下面的输入框添加 <strong>http://blogsearch.google.com/ping/RPC2</strong>；</li>
<li>OK，搞定，更新你的文章试试。</li>
</ol>
<p>不过，有一个更BT的服务，叫<a href="http://pingomatic.com/">Ping-O-Matic</a>，<br />
只要你提交了链接，会帮你推送到23个有Ping服务的博客搜索上去……</p>
<p><strong>Update: July 13rd, 2009</strong><br />
对于国内的博客，可以同时添加“抓虾”、“有道”、“鲜果”等，</p>
<blockquote><p>
鲜果： <strong>http://www.xianguo.com/xmlrpc/ping.php</strong><br />
抓虾： <strong>http://www.zhuaxia.com/rpc/server.php</strong><br />
有道： <strong>http://blog.youdao.com/ping/RPC2</strong>
</p></blockquote>
<p>更多Ping服务请参阅： <a href="http://codex.wordpress.org/Update_Services">http://codex.wordpress.org/Update_Services</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/automatic-ping-to-google-blog-search.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Sell OneBlog.info</title>
		<link>http://mr21.in/network-technology/sell-onebloginfo.html</link>
		<comments>http://mr21.in/network-technology/sell-onebloginfo.html#comments</comments>
		<pubDate>Sun, 01 Mar 2009 11:47:04 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[OneBlog]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=237</guid>
		<description><![CDATA[出售域名 OneBlog.info 。 Sell Domain Name OneBlog.info. Name.com PUSH Whois: http://www.who.is/whois-info/oneblog.info/ MSN &#038; Mail: Live21 [at] msn [dot] co... ]]></description>
			<content:encoded><![CDATA[<p>出售域名 OneBlog.info 。<br />
Sell Domain Name OneBlog.info.</p>
<p>Name.com PUSH<br />
Whois: http://www.who.is/whois-info/oneblog.info/</p>
<p>MSN &#038; Mail:<br />
Live21 [at] msn [dot] com</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/sell-onebloginfo.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

