<?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; Server</title>
	<atom:link href="http://mr21.in/tag/server/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>小内存优化VPS的LNMP及fail2ban配置</title>
		<link>http://mr21.in/software/fail2ban-and-lnmp-configration-for-little-memory-vps.html</link>
		<comments>http://mr21.in/software/fail2ban-and-lnmp-configration-for-little-memory-vps.html#comments</comments>
		<pubDate>Tue, 07 Dec 2010 10:28:00 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Dropbear]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=367</guid>
		<description><![CDATA[哈，大家好，21经过长时间的“沉没”，在这个寒冷的冬日怎么着也该冒泡泡以表无恙呀~ 话说，今天是二四节气中的“大雪”，够不上下雪条件的昆明便下起了稀里哗啦的雨，让21这个电动车... ]]></description>
			<content:encoded><![CDATA[<p>哈，大家好，21经过长时间的“沉没”，在这个寒冷的冬日怎么着也该冒泡泡以表无恙呀~ 话说，今天是二四节气中的“大雪”，够不上下雪条件的昆明便下起了稀里哗啦的雨，让21这个电动车男给冻的 …… 无法用言语形容的呀~</p>
<p>经过近半年时间，21手上开始掌握了一些廉价的VPS进行个人学习和实验，基本配置小至128M OpenVZ大至512M Xen都有，当然，买来以后闲置的时间稍微占多了点，不过由于<a href="http://www.Hawkhost.com">Hawkhost</a>空间12.6到期的刺激，我把<a href="http://mr21.in">Mr. 21</a>和<a href="http://75do.in">75%</a>都搬迁到其中一个512M Xen VPS上并且进行了相关的配置。本着内存能少用就少用、资源能节约就节约的原则，我进行了一些学习和模仿。</p>
<p>文中涉及到的操作基本上都需要root权限，且，21个人喜欢nano编辑器，如果你喜欢vi，稍微换一下命令就行。</p>
<h3>基础调配部分及LNMP</h3>
<p>由于21喜欢用Debian，于是参考了<a href="http://www.vpsee.com">VPSee</a>的文章《<a href="http://www.vpsee.com/2009/06/128mb-vps-optimize-centos5/">64MB VPS 上优化 Debian 5</a>》和<a href="http://www.lowendbox.com">LowEndBox</a>的《<a href="http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/">Bootstraping WordPress/Nginx/PHP/MySQL on a Cheap VPS with lowendscript</a>》，对VPS上的OpenSSH、 syslog-ng用Dropbear和inetutils-syslogd进行了替换，从基础上对资源占用进行了控制，大概操作如下：</p>
<ol>
OpenSSH、 syslog-ng的替换，我使用了LEB的lowendscript，在root用户下，如此操作便可：</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;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>lowendbox<span style="color: #000000; font-weight: bold;">/</span>lowendscript<span style="color: #000000; font-weight: bold;">/</span>raw<span style="color: #000000; font-weight: bold;">/</span>master<span style="color: #000000; font-weight: bold;">/</span>setup-debian.sh
<span style="color: #c20cb9; font-weight: bold;">bash</span> setup-debian.sh system</pre></td></tr></table></div>

<p>如果你参考<a href="http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/">这里</a>，会发现LEB的这个脚本其实还可以安装LNMP里面的NMP(Nginx, MySQL, PHP)三个组件，但是我个人比较喜欢国人的<a href="http://lnmp.org">LNMP</a>，于是仅使用LES脚本进行了系统组件的替换。
</ol>
<p>之后，我安装LNMP 0.5（请参考<a href="http://lnmp.org/install.html">这里</a>）作为WEB服务器，并且进行了一些调整，这个调整请按照自己的需求就好。</p>
<ol>
<li>将Nginx的子线程调整为2个，方法如下：

<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>conf<span style="color: #000000; font-weight: bold;">/</span>nginx.conf</pre></td></tr></table></div>

<p>找到worker_processes，将其改成下面的样子：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">worker_processes 2;</pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出。</li>
<li>同时，我将PHP-FPM的子线程也调整为2个，方法如下：

<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>php<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php-fpm.conf</pre></td></tr></table></div>

<p>按Ctrl+W搜索max_children，改成下面这样的格式：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;max_children&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出。再来重启nginx和php-fpm：</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;">invoke-rc.d nginx restart
<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>php<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>php-fpm restart</pre></td></tr></table></div>

</li>
<li>关于这个……MYSQL的调优，这个……21表示个人水平不足，就不献丑了。</li>
</ol>
<h3>Fail2Ban调配部分</h3>
<p>这是一些比较基础的安全方面的调配。</p>
<ol>
<li>首先，是禁用root用户的ssh登录，由于我们已经用Dropbear替换了OpenSSH，所以跟一般教程针对OpenSSH的修改方式不太一样，大概方法如下：

<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>etc<span style="color: #000000; font-weight: bold;">/</span>xinetd.d<span style="color: #000000; font-weight: bold;">/</span>dropbear</pre></td></tr></table></div>

<p>然后把其中的server_args修改为如下样子</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">    server_args     = -i -g</pre></td></tr></table></div>

<p>让 /etc/xinetd.d/dropbear 配置文件看起来像这样</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">service ssh
{
    socket_type     = stream
    only_from       = 0.0.0.0
    wait            = no
    user            = root
    protocol        = tcp
    server          = /usr/sbin/dropbear
    server_args     = -i -g
    disable         = no
}</pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出。<br />
<strong>-g</strong>的意思就是禁用root使用密码登录，但可以用公钥登录(public key)（请参考<a href="http://hostingfu.com/article/use-dropbear-ssh-to-save-memory">这里</a>）。<br />
然后重启Dropbear：</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;">invoke-rc.d xinetd restart</pre></td></tr></table></div>

</li>
<li>
禁用了root账户登录，但是21在某些特定的没有公钥情况下又需要登录SSH，怎么办呢？增加一个普通用户就好了，这个用户不用具备什么特殊权限，只要能登录SSH足矣，大概操作如下：</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;">useradd <span style="color: #7a0874; font-weight: bold;">&#91;</span>username<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #660033;">-p</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>password<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<p>将<strong>[username]</strong>替换为你想要的用户ID（注：不能为纯数字），<strong>[password]</strong>替换为想要的密码便可。<br />
之后我们以<strong>[username]</strong>登录系统，然后输入<strong>su root</strong>，再输入root密码便可以切换到root用户的shell。<br />
推荐不要使用太简单的ID，比如a/ab/abc什么的，为什么？后面告诉你。
</li>
</ol>
<p><span id="more-367"></span>好了，虽然21禁用了root用户的登录，但是还有个无法避免的问题：暴力猜解，如果我们使用了够简单的ID，例如a/ab/abc之类的，那么很容易被锁定为爆破目标，那我就是喜欢a这个ID怎么办呢？好吧，那只好来点稍微强硬点的措施了，21用fail2ban。fail2ban可以监视你的系统或者应用日志，然后匹配日志的错误信息（正则式匹配）执行iptables屏蔽策略，把某IP的包扔掉，fail to ban~</p>
<p>Fail2ban本身已经内置了不少应用的判断规则了</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;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> fail2ban <span style="color: #000000; font-weight: bold;">//</span>安装fail2ban
<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fail2ban<span style="color: #000000; font-weight: bold;">/</span>filter.d<span style="color: #000000; font-weight: bold;">/</span>
apache-auth.conf      apache-overflows.conf  couriersmtp.conf  gssftpd.conf        postfix.conf    qmail.conf      sshd.conf         wuftpd.conf
apache-badbots.conf   common.conf            named-refused.conf  proftpd.conf    sasl.conf       vsftpd.conf       xinetd-fail.conf  apache-noscript.conf
courierlogin.conf     exim.conf              pam-generic.conf    pure-ftpd.conf  sshd-ddos.conf  webmin-auth.conf</pre></td></tr></table></div>

<p>但是我们已经把SSH服务换成了Dropbear，把日志服务换成了inetutils-syslogd，那fail2ban会不会水土不服呢？<br />
哈，这简直是必须的~</p>
<p>我们需要做点工作让fail2ban能适应我们这个精简过的系统，适应Dropbear的错误日志。</p>
<ol>
<li>
首先，Fail2ban需要监视Dropbear的用户登录日志，但是替换成inetutils-syslogd以后，21发现自己的 /var/log/auth.log.1 （没错，我的不是auth.log，是auth.log.1）停滞在某年某月某日了~ 于是稍微看了一下 /var/log/messages 发现里面有我需要的信息，我把它登录信息分离出来方便Fail2ban的读取，如下：</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>etc<span style="color: #000000; font-weight: bold;">/</span>syslog.conf</pre></td></tr></table></div>

<p>默认内容如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="config" style="font-family:monospace;">*.*;mail.none;cron.none -/var/log/messages
cron.*                  -/var/log/cron
mail.*                  -/var/log/mail</pre></td></tr></table></div>

<p>增加一个句子将登录信息分离出来，修改为</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="config" style="font-family:monospace;">*.*;mail.none;cron.none -/var/log/messages
cron.*                  -/var/log/cron
mail.*                  -/var/log/mail
authpriv.*              /var/log/auth.log</pre></td></tr></table></div>

<p>到此为止我们拥有了一个单独的包含Dropbear登录信息的日志文件 /var/log/auth.log。</li>
<li>
接下来我们设置Fail2ban，按照常规对SSH进行防御的教程，说的都是针对OpenSSH的设置和判断规则，而显然Dropbear是被遗忘的，甚至Debian的Bug Report里面都有人提到<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546913">这样的问题</a>，当然，也有人帮忙<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546913#5">解决</a>这样的问题，大牛总是有的~</p>
<p>首先，我们需要下载一个针对Dropbear的判断策略文件，如下：</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;">wget</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=dropbear.conf;att=1;bug=546913&quot;</span> <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fail2ban<span style="color: #000000; font-weight: bold;">/</span>filter.d<span style="color: #000000; font-weight: bold;">/</span>faidropbear.conf</pre></td></tr></table></div>

<p>然后，在fail2ban的配置里面增加对dropbear的监视和动作：</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>etc<span style="color: #000000; font-weight: bold;">/</span>fail2ban<span style="color: #000000; font-weight: bold;">/</span>jail.conf</pre></td></tr></table></div>

<p>按Ctrl+V一直翻页到最下面空白处，增加以下内容</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="config" style="font-family:monospace;">[ssh-iptables]
enabled  = true
port = ssh
filter   = dropbear
logpath  = /var/log/auth.log</pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出，之后，便是我们的收尾动作了，执行</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;">invoke-rc.d fail2ban restart</pre></td></tr></table></div>

</li>
</ol>
<p>完事儿了。</p>
<p>引用参考：<br />
1. Google: <a href="http://www.google.com/ncr">http://www.google.com/ncr</a><br />
2. Debian Bug Report: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546913">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546913</a><br />
3. LowEndBox: <a href="http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/">http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/</a><br />
4. VPSee: <a href="http://www.vpsee.com/2009/06/64mb-vps-optimize-debian5/">http://www.vpsee.com/2009/06/64mb-vps-optimize-debian5/</a><br />
5. HostingFu: <a href="http://hostingfu.com/article/use-dropbear-ssh-to-save-memory">http://hostingfu.com/article/use-dropbear-ssh-to-save-memory</a><br />
6. Easy Firewall Generator: <a href="http://easyfwgen.morizot.net/gen/">http://easyfwgen.morizot.net/gen/</a></p>
<p>- EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/fail2ban-and-lnmp-configration-for-little-memory-vps.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>解决SSH断线后的会话恢复</title>
		<link>http://mr21.in/software/using-screen-when-connecting-to-linux-servers-with-ssh.html</link>
		<comments>http://mr21.in/software/using-screen-when-connecting-to-linux-servers-with-ssh.html#comments</comments>
		<pubDate>Fri, 09 Jul 2010 06:48:46 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=358</guid>
		<description><![CDATA[最近从vpsee\酷胖等博客看到的信息，购买了好几个廉价的VPS在学习，于是就产生了不少基于SSH的困扰，而掉线重连的会话丢失算是一个 …… 感谢GG大神的帮助，我找到了这个工具：screen。 简单... ]]></description>
			<content:encoded><![CDATA[<p>最近从<a href="http://www.vpsee.com/">vpsee</a>\<a href="http://www.whcoupon.com/">酷胖</a>等博客看到的信息，购买了好几个廉价的VPS在学习，于是就产生了不少基于SSH的困扰，而掉线重连的会话丢失算是一个 ……</p>
<p>感谢GG大神的帮助，我找到了这个工具：<strong>screen</strong>。<br />
简单的说，就是这个工具会接管你当前的console会话，然后当前控制台显示的输入/输出就由它负责，如果你掉线后，只要重新启用screen，就是恢复到之前的状态。大概的操作流程如下：</p>
<ol>
<li>以SSH的方式连接你的服务器</li>
<li>安装Screen；<br />
	<strong>debian/ubuntu:</strong> apt-get install screen<br />
	<strong>fedora/centos:</strong> yum install screen</li>
<li>输入<strong style="color:blue;">screen</strong>接管当前会话；</li>
<li>进行自己需要的任何操作；</li>
<li>SSH掉线；</li>
<li>重连SSH并输入<strong style="color:blue;">screen -r</strong>恢复会话；</li>
<li>可以在.bash_profile里加一行<br />
<span style="color:blue;">alias r=&#8217;screen -d `screen -ls |grep Attached|cut -f2|cut -f1 -d&#8221;.&#8221;`;screen -r `screen -ls |grep Detached|cut -f2|cut -f1 -d&#8221;.&#8221;`&#8217;</span><br />
能够方便的切回screen窗口（假设只开了一个screen）。</li>
</ol>
<p>恩，不是啥复杂的东西，但是能解决不小的困扰。</p>
<p>内容引用参考：<br />
雨中的高速公路 &#8211; 《<a href="http://www.rainway.org/2008/05/22/using-screen-when-connecting-to-linux-servers/">在ssh终端下如何解决断线带来的困扰</a>》。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/using-screen-when-connecting-to-linux-servers-with-ssh.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>自制RHEL5 DVD安装盘</title>
		<link>http://mr21.in/software/making-rhel-5-dvd-iso.html</link>
		<comments>http://mr21.in/software/making-rhel-5-dvd-iso.html#comments</comments>
		<pubDate>Sun, 21 Mar 2010 10:44:11 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[DVD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=338</guid>
		<description><![CDATA[最近在学习Red Hat方面的管理，一般来说我们比较容易获取的是RHEL(Red Hat Enterprise Linux)的CD版介质（比如国内的Lupaworld镜像），不过一共6CD安装起来的替换也是很麻烦，我找到一个教程与大家共... ]]></description>
			<content:encoded><![CDATA[<p>最近在学习Red Hat方面的管理，一般来说我们比较容易获取的是RHEL(Red Hat Enterprise Linux)的CD版介质（比如国内的<a href="http://mirror.lupaworld.com/rhel/5/">Lupaworld镜像</a>），不过一共6CD安装起来的替换也是很麻烦，我找到一个教程与大家共享。</p>
<p>文章来源：<a href="http://www.mind-download.com/2007/07/making-rhel-5-dvd-iso.html">Mind Download</a><br />
本教程是基于Linux shell的操作，Unix-like通用，Windows请看文后简述。</p>
<p><strong>一、首先下载6张CD，（借用lupaworld）</strong></p>
<blockquote><p>
32位安装盘<br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-i386-disc1.iso">rhel-server-5.3-i386-disc1.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-i386-disc2.iso">rhel-server-5.3-i386-disc2.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-i386-disc3.iso">rhel-server-5.3-i386-disc3.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-i386-disc4.iso">rhel-server-5.3-i386-disc4.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-i386-disc5.iso">rhel-server-5.3-i386-disc5.iso</a><br />
64位安装盘<br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-x86_64-disc1.iso">rhel-server-5.3-x86_64-disc1.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-x86_64-disc2.iso">rhel-server-5.3-x86_64-disc2.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-x86_64-disc3.iso">rhel-server-5.3-x86_64-disc3.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-x86_64-disc4.iso">rhel-server-5.3-x86_64-disc4.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-x86_64-disc5.iso">rhel-server-5.3-x86_64-disc5.iso</a><br />
<a href="http://mirror.lupaworld.com/rhel/5/rhel-server-5.3-x86_64-disc6.iso">rhel-server-5.3-x86_64-disc6.iso</a>
</p></blockquote>
<p><strong>二、建立6个临时目录，同时挂载6个ISO文件。</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-client-i386-disc1.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-client-i386-disc2.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp2
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-client-i386-disc3.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp3
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-client-i386-disc4.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp4
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-client-i386-disc5.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp5
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-client-i386-disc6.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp6</pre></td></tr></table></div>

<p><strong>三、修改相关的光盘配置文件</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1<span style="color: #000000; font-weight: bold;">/</span>isolinux <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1<span style="color: #000000; font-weight: bold;">/</span>.discinfo .
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +<span style="color: #c20cb9; font-weight: bold;">w</span> isolinux<span style="color: #000000; font-weight: bold;">/</span>isolinux.bin
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> isolinux<span style="color: #000000; font-weight: bold;">/</span>boot.cat</pre></td></tr></table></div>

<p>编辑复制过来的当前目录的.discinfo文件（<strong>nano .discinfo</strong>或<strong>gedit .discinfo</strong>），效果如下（不一定完全一样）：</p>
<blockquote><p>
1170972087.594754<br />
Red Hat Enterprise Linux Client 5<br />
i386<br />
1,2,3,4,5,6 &lt;-主要是修改这里的<strong>1</strong>为现在的<strong>1,2,3,4,5,6</strong><br />
Client/<br />
VT/<br />
Workstation/
</p></blockquote>
<p><strong>四、合并6个CD镜像并写入新的配置文件，生成DVD ISO镜像，红色的是卷标名称，请自定义。</strong></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;">mkisofs <span style="color: #660033;">-v</span> <span style="color: #660033;">-pad</span> <span style="color: #660033;">-o</span> RHEL5-x86_64-DVD.iso <span style="color: #660033;">-V</span> <span style="color: #ff0000;">&quot;RHEL5-x86_64-DVD&quot;</span> <span style="color: #660033;">-b</span> isolinux<span style="color: #000000; font-weight: bold;">/</span>isolinux.bin <span style="color: #660033;">-c</span> isolinux<span style="color: #000000; font-weight: bold;">/</span>boot.cat <span style="color: #660033;">-no-emul-boot</span> <span style="color: #660033;">-boot-load-size</span> <span style="color: #000000;">4</span> <span style="color: #660033;">-boot-info-table</span> <span style="color: #660033;">-r</span> <span style="color: #660033;">-R</span> <span style="color: #660033;">-T</span> <span style="color: #660033;">-m</span> TRANS.TBL <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1<span style="color: #000000; font-weight: bold;">/</span>.discinfo <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1<span style="color: #000000; font-weight: bold;">/</span>isolinux <span style="color: #660033;">-graft-points</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1 .discinfo=.discinfo isolinux<span style="color: #000000; font-weight: bold;">/</span>=isolinux <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp2<span style="color: #000000; font-weight: bold;">/</span>Server <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp3<span style="color: #000000; font-weight: bold;">/</span>Server <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp4<span style="color: #000000; font-weight: bold;">/</span>Server <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp5<span style="color: #000000; font-weight: bold;">/</span>Server <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp6<span style="color: #000000; font-weight: bold;">/</span>Server</pre></td></tr></table></div>

<p><strong>五、扫尾工作</strong></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: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp2
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp3
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp4
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp5
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp6
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> .discinfo</pre></td></tr></table></div>

<p><strong>六、Windows怎么办？</strong><br />
呃，实际上我没有试过，但是我推断，只要把所有的ISO解压后复制到同一目录下（可覆盖同名文件），然后编辑.discinfo文件（如第三步那样），然后用WinISO或者UltraISO创建一个DVD文件，引导文件使用文件目录下的“isolinux/isolinux.bin”文件，并删除“isolinux/boot.cat”文件，然后保存ISO，应该可以，不过，建议尽量使用linux。</p>
<p><strong>七、其它</strong><br />
实际上，RedHat官方就提供了DVD文件，只要注册一个RHN试用30天的帐户就可以下载，这个仅供大家参考。<br />
同时，原作者提供了一个bash脚本用来处理这个过程，只要跟几个镜像放在同一目录下执行就是，文件内容如下：<span id="more-338"></span></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
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp2
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp3
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp4
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp5
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp6
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-server-x86_64-disc1.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-server-x86_64-disc2.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp2
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-server-x86_64-disc3.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp3
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-server-x86_64-disc4.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp4
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-server-x86_64-disc5.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp5
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> ro,loop rhel-<span style="color: #000000;">5</span>-server-x86_64-disc6.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp6
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1<span style="color: #000000; font-weight: bold;">/</span>isolinux <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1<span style="color: #000000; font-weight: bold;">/</span>.discinfo .
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +<span style="color: #c20cb9; font-weight: bold;">w</span> isolinux<span style="color: #000000; font-weight: bold;">/</span>isolinux.bin
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> isolinux<span style="color: #000000; font-weight: bold;">/</span>boot.cat
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/1$/1,2,3,4,5,6/g'</span> .<span style="color: #000000; font-weight: bold;">/</span>.discinfo <span style="color: #000000; font-weight: bold;">&gt;</span> .<span style="color: #000000; font-weight: bold;">/</span>.discinfo
mkisofs <span style="color: #660033;">-v</span> <span style="color: #660033;">-pad</span> <span style="color: #660033;">-o</span> RHEL5-x86_64-DVD.iso <span style="color: #660033;">-V</span> <span style="color: #ff0000;">&quot;RHEL5-x86_64-DVD&quot;</span> <span style="color: #660033;">-b</span> isolinux<span style="color: #000000; font-weight: bold;">/</span>isolinux.bin <span style="color: #660033;">-c</span> isolinux<span style="color: #000000; font-weight: bold;">/</span>boot.cat <span style="color: #660033;">-no-emul-boot</span> <span style="color: #660033;">-boot-load-size</span> <span style="color: #000000;">4</span> <span style="color: #660033;">-boot-info-table</span> <span style="color: #660033;">-r</span> <span style="color: #660033;">-R</span> <span style="color: #660033;">-T</span> <span style="color: #660033;">-m</span> TRANS.TBL <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1<span style="color: #000000; font-weight: bold;">/</span>.discinfo <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1<span style="color: #000000; font-weight: bold;">/</span>isolinux <span style="color: #660033;">-graft-points</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1 .discinfo=.discinfo isolinux<span style="color: #000000; font-weight: bold;">/</span>=isolinux <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp2<span style="color: #000000; font-weight: bold;">/</span>Server <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp3<span style="color: #000000; font-weight: bold;">/</span>Server <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp4<span style="color: #000000; font-weight: bold;">/</span>Server <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp5<span style="color: #000000; font-weight: bold;">/</span>Server <span style="color: #007800;">Server</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp6<span style="color: #000000; font-weight: bold;">/</span>Server
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp1
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp2
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp3
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp4
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp5
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp6
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> .discinfo</pre></td></tr></table></div>

<p>保存为sh文件后，使用<strong>sh 脚本名称</strong>，或者<strong>./脚本名称</strong>的方式执行即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/making-rhel-5-dvd-iso.html/feed</wfw:commentRss>
		<slash:comments>0</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>服务器监测和实时SMS警报的思路</title>
		<link>http://mr21.in/software/server-monitor-and-sms-realtime-notify.html</link>
		<comments>http://mr21.in/software/server-monitor-and-sms-realtime-notify.html#comments</comments>
		<pubDate>Fri, 12 Jun 2009 07:13:29 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[2000]]></category>
		<category><![CDATA[A1Monitor]]></category>
		<category><![CDATA[Fetion]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SMS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[实时警报]]></category>
		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=274</guid>
		<description><![CDATA[一直以来， 我手下的一台运行着ASP应用的Win2000服务器总是访问数据库会莫名其妙锁死， 然后用户端访问的页面就提示：数据库查询错误，编码AXXX； 最终分析下来的原因是ASP程序本身的问题，... ]]></description>
			<content:encoded><![CDATA[<p>一直以来，<br />
我手下的一台运行着ASP应用的Win2000服务器总是访问数据库会莫名其妙锁死，<br />
然后用户端访问的页面就提示：<strong>数据库查询错误，编码AXXX</strong>；<br />
最终分析下来的原因是ASP程序本身的问题，所以每次都要人工去执行<strong>iisreset</strong>释放，</p>
<p>而我又不会ASP且开发方对这个缺陷的改进意见总是支支吾吾的，<br />
每次出故障都是同事打电话过来提醒然后我再连接上服务器去执行重置，因为我不太用那个东西……<br />
但老这样，领导也渐渐开始有点意见了，所以，需要一个能及时报警并自动解决IIS重置的方案。</p>
<p>最理想的状态是基本满足以下需求：</p>
<ol>
<li>实时报警，宕机与恢复时通过<strong>MAIL/SMS/CALL</strong>等时效性较高的手段通知；</li>
<li>自动恢复，在发出警报的同时能执行一些额外的命令操作，以达到自动恢复的功能；</li>
<li>字词检测，能通过实时的页面关键字词的监测达到判断业务系统的正常性；</li>
<li>费用低廉，最好是免费了，不能免费的话，再说吧……</li>
</ol>
<p>其中至关重要的就是状态监测这一块的，<br />
因为是内网业务系统，无法通过站长保姆这类第三方的Uptime Monitor来监视，只能自己选择可靠的同机房其它服务器进行监测，并且为了排除线路故障外的原因，本机也要监测，同时兼顾到另一个工作现场的使用和线路故障检测，也需要上一个监测点。<br />
总的来说就是三个监测点：服务器本机、机房旁路、远端现场；</p>
<p>最终我在<a href="http://down.chinaz.com">chinaz</a>里面用<strong>monitor</strong>为关键词找到了一个软件：<a href="http://www.a1monitor.com/">A1Monitor</a>；<br />
从官方网站看来，最新版的<strong>A1Monitor 2009</strong>支持有以下特性：</p>
<ol>
<li>Vista兼容性，已经完成了对Vista的测试和工作兼容检查；</li>
<li>没有任何限制免费试用45天（如果企业对正版化有要求，建议购买，$89.95）；</li>
<li>可以监视任何TCP/IP服务器或网页（通过http, https, pop3, smtp, ftp, 或者任何你需要监视的端口)；</li>
<li>支持通过关键字来判断任何网页的正常与否；</li>
<li>你可以在服务器状态监测失败的时候收到邮件、同时A1Monitor还可以重启服务器或者执行一些附加的命令；</li>
<li>可以PING任何IP地址</li>
<li>每次有效的监测状态都会自动生成HTML格式的监测报告</li>
</ol>
<p>事实上，除了VISTA兼容性之外，<br />
我在<a href="http://down.chinaz.com">chinaz</a>找到的<strong>A1Monitor 2007特别版</strong>具备以上所有功能并且在我的2000/XP上工作非常良好，<br />
如果你有这方面的需要，可以去<a href="http://down.chinaz.com">down.chinaz.com</a>搜索<strong>A1Monitor</strong>， <img src='http://mr21.in/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<p>基本上，<br />
需求列表里面的<strong>自动恢复</strong>和<strong>字词检测</strong>使用A1Monitor就可以解决，那实时报警呢？</p>
<p>这个时候我想起了通过<a href="http://www.fetion.com.cn">飞信</a>，因为飞信可以给机主和好友发短信并且免费，那么自己给自己发警报SMS是可行的，<br />
通过Google我找到<a href="http://zhouzaibao.javaeye.com/blog/378631">这篇文章</a>，里面提到了几种发送短信的方式，免费方案就是利用fetion了，</p>
<p>于是乎我从里面选择了<strong>网页命令行</strong>的方式，该方式貌似通过<a href="https://fetionapi.appspot.com/">Fetion API</a>这个Google App项目开发的，<br />
然后我构造了通过Fetion API发送警报的方式，因为可以在链接后面构造参数直接提交接收人和内容，格式如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">https<span style="color: #00AA00;">:</span>//fetionAPI<span style="color: #6666ff;">.appspot</span>.com/api/?from<span style="color: #00AA00;">=</span>您手机号&amp;pw<span style="color: #00AA00;">=</span>您的密码&amp;to<span style="color: #00AA00;">=</span>接收方手机号&amp;msg<span style="color: #00AA00;">=</span>短信内容</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="css" style="font-family:monospace;">iexplore https<span style="color: #00AA00;">:</span>//fetionAPI<span style="color: #6666ff;">.appspot</span>.com/api/?from<span style="color: #00AA00;">=</span>您手机号&amp;pw<span style="color: #00AA00;">=</span>您的密码&amp;to<span style="color: #00AA00;">=</span>接收方手机号&amp;msg<span style="color: #00AA00;">=</span>短信内容</pre></td></tr></table></div>

<p>缺点就是会打开一个IE窗口，并且不会自动关掉，如果要是故障频繁点，还需要人工来关大量的IE窗口。</p>
<p>之后我突然以前看到过的<a href="http://www.it-adv.net">飞信机器人</a>，<br />
一个可以通过<strong>CLI</strong>(Command Line Interface，命令行界面，也有称之为DOS、命令提示符)调用的飞信客户端，<br />
同时适用于Windows/Linux平台，还有一些开发文档，而我们需要用到的只是其中一个非常小的功能，<strong>CLI发短信</strong>，<br />
格式如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">fetion --mobile<span style="color: #00AA00;">=</span>你的号码 --pwd<span style="color: #00AA00;">=</span>密码 --to<span style="color: #00AA00;">=</span>目标号码 --msg-gb<span style="color: #00AA00;">=</span>内容
fetion --sid<span style="color: #00AA00;">=</span>你的飞信ID --pwd<span style="color: #00AA00;">=</span>密码 --to<span style="color: #00AA00;">=</span>目标号码 --msg-gb<span style="color: #00AA00;">=</span>内容</pre></td></tr></table></div>

<p>看到这儿，大多数人应该能明白了，<br />
既然<strong>A1Monitor</strong>允许执行额外的命令，而我的故障处理方式<strong>iisreset</strong>，并且同时执行一个飞信机器人发送短信的命令，<br />
那么只要随便写一个cmd文件，包含上面两条命令，然后放在磁盘方便访问机器人的地方，等着A1执行就好了。</p>
<p>基本上解决方法就是这些了，并且试验过确实有效，当然，整个机房掉电的情况下就比较麻烦了，<br />
不过因为设置了三个监测点，3D防护，基本上可以解决服务器死机、线路故障、机房掉电等情况的近实时（0s~你设定的监测时间间隔）SMS警报，但要求监测机24&#215;7开机。</p>
<p>思路写的有点混乱，如果需要教程的话，请关注后续文章。</p>
<p>Btw,<br />
你当然也可以用这个办法在你的电脑上监控你Web空间的Uptime，<br />
但问题是我想没有多少人能保持电脑24&#215;7并且网络线路一直通常无故障的对吧，比较有难度而已。</p>
<p>本文参考：<br />
利用飞信fetion发送短信，实现服务器报警等： <a href="http://zhouzaibao.javaeye.com/blog/378631">http://zhouzaibao.javaeye.com/blog/378631</a><br />
fetion机器人2009版说明及下载： <a href="http://bbs.it-adv.net/viewthread.php?tid=155">http://bbs.it-adv.net/viewthread.php?tid=155</a><br />
09版fetion机器人安装说明： <a href="http://bbs.it-adv.net/viewthread.php?tid=186">http://bbs.it-adv.net/viewthread.php?tid=186</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/server-monitor-and-sms-realtime-notify.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Win2k自动更新重启后无法登陆</title>
		<link>http://mr21.in/software/win2k-can-not-log-in-after-windows-update.html</link>
		<comments>http://mr21.in/software/win2k-can-not-log-in-after-windows-update.html#comments</comments>
		<pubDate>Thu, 04 Dec 2008 13:25:59 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[2000]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[VNC]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[升级]]></category>
		<category><![CDATA[登陆]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=219</guid>
		<description><![CDATA[今天中午登陆VNC， 得知综合信息平台的Windows 2000 Server因为进行了Windows Update需要重启， 想着正好中午没人在用，重启一下， 结果用于检测的PING在常规时间后有回馈了，但是WEB和VNC无法访问。 ... ]]></description>
			<content:encoded><![CDATA[<p>今天中午登陆VNC，<br />
得知综合信息平台的Windows 2000 Server因为进行了Windows Update需要重启，<br />
想着正好中午没人在用，重启一下，<br />
结果用于检测的PING在常规时间后有回馈了，但是WEB和VNC无法访问。</p>
<p>电话联系同事解决，<br />
物理登陆的结果是：有蓝底背景色，但是登陆窗口没有出现。<br />
后来尝试安全模式，可以进入的。<br />
联想到最后的操作是打补丁，也是开始卸载补丁。</p>
<p>最后经过资料查询和比较，<br />
发现<strong>KB954211</strong>补丁和<strong>卡巴斯基6.0网络版客户端</strong>有冲突，<br />
卸载就好了，从此禁用WU，垃圾！</p>
<p>居然补丁不经过兼容性测试就发布出来了，那是服务器诶！服务器知道不！<br />
很重要的！你们的OS卖那么贵还这么不负责任，害死人的！还全职商业开发，还闭源呢！</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/win2k-can-not-log-in-after-windows-update.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决Linux VNC Viewer无法连接Win</title>
		<link>http://mr21.in/software/vnc-connect-to-windows-with-linux.html</link>
		<comments>http://mr21.in/software/vnc-connect-to-windows-with-linux.html#comments</comments>
		<pubDate>Fri, 28 Nov 2008 19:03:39 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RFB]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VNC]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=216</guid>
		<description><![CDATA[新近安装了Ubuntu 8.10，并且升级各种更新包到最新。 由于工作需要， 需要访问布置了RealVNC的一堆Windows服务器进行日常维护管理， 其中，服务器安装了RealVNC Enterprise Edition v4.3.2, 客户端为Ubuntu 8... ]]></description>
			<content:encoded><![CDATA[<p>新近安装了Ubuntu 8.10，并且升级各种更新包到最新。</p>
<p>由于工作需要，<br />
需要访问布置了<a href="http://www.realvnc.com">RealVNC</a>的一堆Windows服务器进行日常维护管理，<br />
其中，服务器安装了<a href="http://www.realvnc.com/products/enterprise/index.html">RealVNC Enterprise Edition v4.3.2</a>, 客户端为<a href="http://www.ubuntulinux.com">Ubuntu</a> 8.10，</p>
<p>关于安装的VNC viewer，<br />
可以说<strong>新立得</strong>里面有的，我全部都安装测试了，没有一个能用！</p>
<p>不论是直接执行还是通过“终端伺服器用户端”调用，<br />
统统报告“<strong>No match security type</strong>”（没有匹配的安全类型），<br />
头大了，<br />
虽然可以通过RDP连接到终端桌面，但那是虚拟桌面，且服务器只布置了VNC，</p>
<p>经过翻阅新立得的程序说明和各类资料，<br />
发现主要是协议问题，<strong>RFB</strong>的版本过低，新立得里的Viewer最高只能支持<strong>RFB 3.8</strong>，<br />
但是RealVNC Enterprise Edition v4.3.2使用的是<strong>RFB 4.0</strong>，<br />
问题知道了，但是哪里去找支持RFB 4.0的Viewer呢？又折腾了半天~</p>
<p>最终，在RealVNC网站找到<strong>二进制(bin)</strong>的客户端，<br />
有各个OS的Viewer，包括Solaris, Windows, Linux etc, 就是不提供Source，</p>
<p>不过，好在问题解决了，<br />
下载了对应的4.3.2的Viewer，并同时测试了最新的4.4.2的Viewer，<br />
都支持RFB 4.0，OK，问题解决。</p>
<p>后来发现，<br />
新立得里面提供的几个Viewer似乎是RealVNC释出的免费版本（Free edition）使用的源码，<br />
而官方提供的最高版本为：VNC Free Edition 4.1。</p>
<p>结论：以后遇到高版本RFB的VNC Server，试试RealVNC最新的Viewer吧~</p>
<p>下载： http://www.realvnc.com/cgi-bin/download.cgi （填写表单后就出来了）</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/vnc-connect-to-windows-with-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Little ASP Server by NetBox</title>
		<link>http://mr21.in/software/little-asp-server-by-netbox.html</link>
		<comments>http://mr21.in/software/little-asp-server-by-netbox.html#comments</comments>
		<pubDate>Sat, 20 Aug 2005 14:28:07 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[NetBox]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=123</guid>
		<description><![CDATA[从去年开始，一直在使用NetBox作为IIS/ASP的临时替代平台。 由于在CNFREE看到有人说需要“方便”、“简单”的ASP服务器，就推荐了这个，结果人家说：“NetBox没听过，…… ”，很不识货的行为... ]]></description>
			<content:encoded><![CDATA[<p>从去年开始，一直在使用NetBox作为IIS/ASP的临时替代平台。<br />
由于在CNFREE看到有人说需要“方便”、“简单”的ASP服务器，就推荐了这个，结果人家说：“NetBox没听过，…… ”，很不识货的行为。</p>
<p>NetBox内嵌ASP解析，并且程序体积微小（相对与IIS，算Tiny了）<br />
官方介绍：</p>
<blockquote><h4>NetBox 编译器</h4>
<p>　　编译所有内部对象、引擎和脚本文件，并封装到独立可执行文件中，不需要安装任何补丁即可在 Windows 98、Windows NT/2000/XP/.NET 2003 RC1 上直接执行，极大的方便了部署和安装。编译后程序运行速度提高２～１０倍，代码安全性好有效的保护了知识产权，解决了以往 ASP 开发的应用程序的发布问题。</p>
<h4>可编程虚拟机</h4>
<p>　　NetBox 提供了强大的虚拟机对象，供开发商在应用程序中加入用户可编程特性（类似且强于Word 中的宏），提供用户订制计算、复杂商务逻辑的二次开发。由于虚拟机独立于应用程序，它安全可靠，可以控制并去除有害代码。NetBox 的虚拟机对象提供完整的错误回报和错误捕获功能。</p>
<h4>应用服务器</h4>
<p>　　NetBox 提供了可编程的高性能 HTTP 服务器对象，直接编译到应用中无需独立部署。目前 NetBox 使用经业界广泛验证的 OpenSSL 来支持高效安全的 SSL 和 TLS 标准。</p>
<h4>网络服务器</h4>
<p>　　NetBox 提供可编程的高性能 TCP 服务器对象用于编写多线程网络服务器软件，如 FTP，SMTP，POP3，Telnet，网络游戏服务器等。内置的 SSL、TLS 支持，无需编写代码直接支持安全传输。</p>
<h4>强大的 HTML 对话框</h4>
<p>　　NetBox 提供一种新的快速创建桌面应用的方法，开发人员直接使用功能强大，设计容易的 HTML 作为软件界面，支持文字、图形、声音和流媒体的整合，支持数据库访问，支持 HTTP 和 TCP，支持 XML，支持各种加密算法，支持各种外设。NetBox 可以在很短的时间内开发功能强大的多媒体应用、网络应用（离线软件、下载工具等），商业软件客户端等。</p></blockquote>
<p>当然，我们如果仅仅需要一个ASP服务器，那么就不用去下载那么麻烦的工程包（还需要申请授权，确保你的使用是合法的，至于为什么，后面告诉你），</p>
<p>只需要安装后目录中的Netbox.exe文件<img src="http://photos23.flickr.com/35582896_54e8e30388.jpg" alt="Just need it" />就行，而配合使用的就是一个任意文件名（例如main.txt）的配置文件，按照WINDOWS的拖放规则，只需要将配置文件拖放到Netbox.exe上，之后会在任务栏出现一个ICON<img src="http://photos21.flickr.com/35584848_249f7ca873.jpg" alt="NetBox Tray Icon" />，这时代表NETBOX已经在运行。<br />
就这样，一个ASP服务器就开始运行了，没其它东西吗？没，仅此而已了！</p>
<p>当然，NetBox的诞生不是用来做这样的简单应用的。<br />
据我的理解，NetBox.exe只是一个被用来嵌入于“ASP程序包”的服务程序，而整套NetBox是用来打包ASP程序以达到源码保密的目的（因为打包后为一个.exe程序，直接启动就打开该机80端口运行WEB服务，并不公开其中的ASP源码），也就是un-Open Source吧？<br />
因此，可以利用NetBox将ASP程序打包为一个EXE文件，便可以<strong>随处演示</strong>了。</p>
<p>不过，这么简单的事情也就产生了一些麻烦，NetBox被作为WEB后门的打包程序用于“黑客”行为，<a href="http://netbox.cn/news/doc_13.htm">这里</a>就有该公司的一份声明。<br />
产品无罪嘛，万一大家遇到了这样的东西出现在自己服务器上，原谅NetBox吧。</p>
<p>当然，NetBox的功能不仅于此，更多高级的功能，你需要参考<a href="http://netbox.cn/document/">技术文档</a>。</p>
<p>NetBox.exe 明天提供下载。如果谁觉得提供该程序违法了，请告之，我将撤消。<br />
NetBox程序包： http://www.netbox.cn/download/nbsetup.EXE</p>
<p><b>Update: Aug 21st, 2005</b><br />
NetBox Lite Package: http://www.live21.org/download/netbox.zip  (Include netbox.exe and config file)</p>
<p>附 配置文件内容：<br />
<span id="more-123"></span></p>
<pre>
Dim httpd

Shell.Service.RunService "NBWeb", "NetBox Web Server", "NetBox Http Server Sample"

'---------------------- Service Event ---------------------

Sub OnServiceStart()
    Set httpd = CreateObject("NetBox.HttpServer")

    If httpd.Create("", 80) = 0 Then
        Set host = httpd.AddHost("", "\10")

        host.EnableScript = true
        host.AddDefault "default.asp"
        host.AddDefault "default.htm"
        host.AddDefault "default.html"
        host.AddDefault "index.asp"
        host.AddDefault "index.htm"
        host.AddDefault "index.html"

        httpd.Start
    else
        Shell.Quit 0
    end if
End Sub

Sub OnServiceStop()
    httpd.Close
End Sub

Sub OnServicePause()
    httpd.Stop
End Sub

Sub OnServiceResume()
    httpd.Start
End Sub
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/little-asp-server-by-netbox.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

