<?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; Debian</title>
	<atom:link href="http://mr21.in/tag/debian/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.2</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>利用Linux内核的多个安全漏洞提权</title>
		<link>http://mr21.in/codes/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities.html</link>
		<comments>http://mr21.in/codes/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities.html#comments</comments>
		<pubDate>Sun, 19 Dec 2010 16:39:31 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[开源盛试]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Kernel Bug]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=372</guid>
		<description><![CDATA[这是来自VPSee的消息，因为我个人试了一下Debian表示没有鸭梨，于是转过来，手痒的Ubunu用户可以试试…… &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-这是手痒的... ]]></description>
			<content:encoded><![CDATA[<p>这是来自<a href="http://www.vpsee.com/2010/12/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities/">VPSee的消息</a>，因为我个人试了一下Debian表示没有鸭梨，于是转过来，手痒的Ubunu用户可以试试……</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-这是手痒的分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>系统安全高手 Dan Rosenberg 发布了<a href="http://marc.info/?l=full-disclosure&#038;m=129175358621826&#038;w=2">一段 C 程序</a>，这段200多行的程序利用了 Linux Econet 协议的3个安全漏洞，可以导致本地帐号对系统进行拒绝服务或特权提升，也就是说一个普通用户可以通过运行这段程序后轻松获得 root shell，以下在 update 过的 Ubuntu 10.04 Server LTS 上测试通过：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-r</span>
2.6.32-<span style="color: #000000;">21</span>-server
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">gcc</span> full-nelson.c <span style="color: #660033;">-o</span> full-nelson
$ .<span style="color: #000000; font-weight: bold;">/</span>full-nelson
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolving kernel addresses...
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved econet_ioctl to 0xffffffffa0131510
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved econet_ops to 0xffffffffa0131600
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved commit_creds to 0xffffffff8108b820
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved prepare_kernel_cred to 0xffffffff8108bc00
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Calculating target...
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Failed to <span style="color: #000000; font-weight: bold;">set</span> Econet address.
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Triggering payload...
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Got root<span style="color: #000000; font-weight: bold;">!</span>
<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>由于 RHEL/CentOS 默认不支持 Econet 协议，所以测试没有通过：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-r</span>
2.6.18-194.26.1.el5
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">gcc</span> full-nelson.c <span style="color: #660033;">-o</span> full-nelson
$ .<span style="color: #000000; font-weight: bold;">/</span>full-nelson
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Failed to open <span style="color: #c20cb9; font-weight: bold;">file</span> descriptors.</pre></div></div>

<p>如果在企业环境用 Ubuntu 的话可能会比较杯具了，几百个帐号里总可以找到一两个帐号被内部或外部人员通过上面这段程序拿到 root，这对服务器的危害是毁灭性的。前天还在说 Ubuntu 在内核方面无作为，现在想起来还有点后怕。VPSee 提醒正在使用多个普通帐号登录 Ubuntu VPS 的朋友及时升级或打内核补丁，出售 VPN/SSH 帐号、提供免费 SSH 的商家尤其要小心 “客户” 捣乱，使用其他 Linux 发行版的朋友也最好检查一下自己的 VPS 有没有这些高危漏洞。</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-这是手痒的分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>21个人的测试，在Debian 5.0.6上测试，结果如下：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-r</span>
2.6.26-<span style="color: #000000;">2</span>-xen-amd64
$ <span style="color: #c20cb9; font-weight: bold;">gcc</span> h.c <span style="color: #660033;">-o</span> h
$ .<span style="color: #000000; font-weight: bold;">/</span>h
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolving kernel addresses...
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved econet_ioctl to 0xffffffffa017819b
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved econet_ops to 0xffffffffa01791e0
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Failed to resolve kernel symbols.</pre></div></div>

<p>同时，各位提供SSH番羽墙的童鞋，只要把用户的shell设置为nologin便可以表示没有鸭梨了~</p>
<p>-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/codes/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<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>Intel 2200bg for Debian 5 (Lenny)</title>
		<link>http://mr21.in/software/intel-2200bg-for-debian-5-lenny.html</link>
		<comments>http://mr21.in/software/intel-2200bg-for-debian-5-lenny.html#comments</comments>
		<pubDate>Wed, 18 Feb 2009 01:07:02 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[2200]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[non-free]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=228</guid>
		<description><![CDATA[Debian 5 (Lenny) 发布后， 在我的DELL X300工作本子上试装了一下。 整个安装进程似乎比以前的版本快很多， 选Graphic Installer，很快就进入到界面， 发现安装过程需要手动提供名为 ipw2200-bss.fw 的固... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.cathayan.org/item/1873">Debian 5 (Lenny) 发布</a>后，<br />
在我的DELL X300工作本子上试装了一下。</p>
<p>整个安装进程似乎比以前的版本快很多，<br />
选Graphic Installer，很快就进入到界面，<br />
发现安装过程需要手动提供名为 <strong>ipw2200-bss.fw</strong> 的固件，<br />
应该是用于驱动 <strong>Intel 2200 802.11b/g</strong> 无线网卡的非开源自由固件。</p>
<p>基于此，GG搜寻了一下，找到官方提供的解决办法，<br />
相关说明：<a href="http://wiki.debian.org/ipw2200">http://wiki.debian.org/ipw2200</a> （全英文）<br />
下载链接：<a href="http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/lenny/current/">http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/lenny/current/</a></p>
<blockquote><p>
<strong>操作步骤：</strong></p>
<ol>
<li>下载页面提供gz和zip格式，请下载任一个firmware包。</li>
<li>解压，或者直接提取其中的 <strong>firmware-ipw2x00_0.14_all.deb</strong>。</li>
<li>将提取的firmware-ipw2x00_0.14_all.deb放到U盘、MMC/SD卡等可移动介质上（以下统称<strong>U盘</strong>）。</li>
<li>执行你的Debian安装，这个时候随便你插不插U盘。</li>
<li>进行到<strong>探测网络设备</strong>时，会提示你，需要ipw2200-bss.fw文件。</li>
<li>插入你的U盘，点击<strong>继续</strong>。</li>
<li>OK，识别出来了，接下来就是配置网络。</li>
</ol>
</blockquote>
<p>据Debian Wiki说明，<br />
这个fw文件会自动存放在 <strong>/lib/firmware</strong> 目录里。</p>
<p>同时，<br />
看下载的文件名，应该是同时支持2100和2200系列的无线网卡，<br />
且下载的 <strong>firmware.tar.gz</strong> 文件里面还有其它的 non-free 固件，<br />
只要在安装过程中有提示需要fw文件的，都可以用以上办法，<br />
因为那说明Debian已经内置驱动，差固件而已。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/intel-2200bg-for-debian-5-lenny.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AirCrack-ng</title>
		<link>http://mr21.in/software/aircrack-ng.html</link>
		<comments>http://mr21.in/software/aircrack-ng.html#comments</comments>
		<pubDate>Tue, 17 Feb 2009 02:22:51 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[AirCrack]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[FC]]></category>
		<category><![CDATA[RHECL]]></category>
		<category><![CDATA[RPM]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=226</guid>
		<description><![CDATA[由于某种需要，在研究AirCrack， 加上最近研习RHCE的需要，安装了CentOS 5.2， 所以需要搜寻了一下合适的RPM包。 说实话，系统装起来还没玩， 原来Debian的apt很熟，但是YUM就暂时不知所云了， 不... ]]></description>
			<content:encoded><![CDATA[<p>由于某种需要，在研究AirCrack，<br />
加上最近研习RHCE的需要，安装了CentOS 5.2，<br />
所以需要搜寻了一下合适的RPM包。</p>
<p>说实话，系统装起来还没玩，<br />
原来Debian的apt很熟，但是YUM就暂时不知所云了，<br />
<a href="http://blog.cathayan.org/item/1873">不过昨天看到Debian又出世了，Debian 5 (Lenny)</a>，可能又会不坚定了~</p>
<p>不废话了，<br />
链接：<a href="http://packages.sw.be/aircrack-ng/">http://packages.sw.be/aircrack-ng/</a><br />
为什么不去官方呢？因为我没办法流畅访问&#8230;.</p>
<p>里面的RPM包我认为挺全的，<br />
版本： aircrack-ng-0.6.2-1 -> aircrack-ng-0.9.3-1<br />
平台： x86, x86_64<br />
系统： RHEL3/CentOS-3, FC1 -> RHEL5/CentOS-5, FC9</p>
<p>公司发的Dell X300本子内置Intel 2200bg的卡，可以练手咯~<br />
后续会更新相关教程，同时可以访问 http://www.anywlan.com .</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/aircrack-ng.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>免费的午餐？NO</title>
		<link>http://mr21.in/view-points/the-free-no.html</link>
		<comments>http://mr21.in/view-points/the-free-no.html#comments</comments>
		<pubDate>Wed, 26 Mar 2008 15:57:23 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[二一视点]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[BlogBus]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[Crack]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[免费]]></category>

		<guid isPermaLink="false">http://mr21.in/2008/03/26/%e5%85%8d%e8%b4%b9%e7%9a%84%e5%8d%88%e9%a4%90%ef%bc%9fno/</guid>
		<description><![CDATA[一直以来，我都疑惑那些免费网站的盈利方式， 而我想到的第一念头并且深有体会的就是：广告。 深刻的感触来自当初想尽办法去屏蔽的BlogCN广告， 有莫名其妙的Top通栏，有浮动的，还有在LO... ]]></description>
			<content:encoded><![CDATA[<p>一直以来，我都疑惑那些免费网站的盈利方式，<br />
而我想到的第一念头并且深有体会的就是：广告。</p>
<p>深刻的感触来自当初想尽办法去屏蔽的<a href="http://www.blogcn.com">BlogCN</a>广告，<br />
有莫名其妙的Top通栏，有浮动的，还有在LOGO那里还插入BLOGCN自己的。</p>
<p>一切看起来相当不如人意，<br />
至少，不如我的意，所以搬出来了。</p>
<p>今天在<a href="http://okce.net">Ecko’s Blog</a>看到一篇POST《<a href="http://okce.net/posts/304">免费经济学的六种模式</a>》，<br />
里面列出了六种基于免费的服务或者产品获得盈利的模式，非常值得借鉴参考。</p>
<p>连接：<a href="http://okce.net/posts/304">http://okce.net/posts/304</a></p>
<p>其中，<br />
<strong>第一种模式，Freemium，免费增值模式，</strong><br />
我首先想到的是<a href="http://www.blogbus.com">BlogBus</a>的VIP服务：增量的空间和额外的域名绑定，<br />
当然，还有一个使用WP MU提供服务的<a href="http://www.yo2.cn">yo2</a>，它绑定域名也属于增值服务需要额外的费用，</p>
<p><strong>第二种模式，Advertisement，广告模式，</strong><br />
这样的方式其实随处可见，就是典型的Blog+GG Ads，还应该算上新兴的阿里妈妈，</p>
<p>马云的确是个很牛的人，B2B的“<a href="http://www.alibaba.com">阿里爸爸</a>”，BC2C的<a href="http://www.taobao.com">淘宝</a>，怕爷俩孤单，又给张罗了个<a href="http://www.alimama.com">阿里妈妈</a>&#8230;.<br />
Ecko说，这是马云旗下吉祥的一家。(comment below) 哈哈，吉祥三宝~</p>
<p><strong>第三种，Cross-subsidies，交叉补助模式，</strong><br />
文中提到的是“<a href="http://www.gillette.com/">吉列</a>的刀架与刀片”，本来想说喷墨打印机的，</p>
<p>仔细想想，打印机跟吉列不一样，墨水不是唯一匹配的，因为还有兼容墨水的存在，并且质量不差&#8230;.<br />
（关于墨水可以参考<a href="http://googlechinablog.com">Google黑板报</a>&#8220;<a href="http://googlechinablog.com/2008/03/blog-post_04.html">硅谷的见证人—惠普公司 — 亚洲制造的冲击</a> &#8220;）</p>
<p><strong>第四种，Zero marginal cost，</strong><br />
其中说到“可以极低单位成本提供的产品”，这个，还是基于免费而引发的盈利么？</p>
<p>不过，不知道杀毒软件的免费试用（长达3~6个月）算不算呢？</p>
<p>至少，因为<a href="http://www.360Safe.com">360Safe</a>让我长期免费用<a href="http://www.Kaspersky.com.cn">Kaspersky</a>，在向同学朋友推荐的同时自己也成为KAV的付费用户，<br />
在付费之前的服务应该算是免费服务，并且诱发了我消费的心理，虽然待遇是一样的， <img src='http://mr21.in/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<p>虽然，KAV的杀猪叫非常刺耳，不过这不是差别化服务因素，也就可以接受了。</p>
<p>我想，真正理智的消费者，不是到处去找keygen或者Crack的“特别文件”，而是真正去支持一样产品 — 如果你认为它的确优秀，只要不是囊中羞涩或者消费心理被错误导向，没有理由不支持自己喜欢的产品，包括付费和捐赠。缺少理性支持的产品日不久矣~</p>
<p><strong>第五种，Labor exchange，劳务交换模式，</strong><br />
这个自己没能想到，看过之后想想，大量的用户调查回馈数据也属于有偿服务，还有调查问卷~</p>
<p><strong>第六种，Gift economy，礼品经济模式，</strong><br />
我非常赞同原文提到开源软件，Red Hat产品就是一个比较典型的例子：<a href="http://www.redhat.com.cn/rhel/">Red Hat Enterprise</a>和<a href="http://www.centos.org">CentOS</a>。<br />
用产品卖服务，本身产品的价值不高、甚至免费，但是其中带来的后期服务支持和培训费用是不菲的。</p>
<p>由此我联想到<a href="http://www.Ubuntu.com">Ubuntu</a>，通过免费的CD/下载达到极高的市场占有率，进而推动兼容性和通用性的改进，同时千千万万的用户也是千千万万的测试员，通过不断的反馈，可以增进服务器产品的适用性，从而从服务器的产品支持上获得收益。<br />
但是为什么同样都是免费下载的产品，Ubuntu似乎势头看来比它的老爸<a href="http://www.Debian.org">Debian</a>好并且迅速崛起呢？<br />
我想，因为还有<a href="https://shipit.ubuntu.com/">免费的CD可以领取</a>~</p>
<p>当然，我不确定我的猜想是否正确，以上是一些个人的观点，<br />
原文还请访问：<a href="http://okce.net/posts/304">http://okce.net/posts/304</a>，《免费经济学的六种模式》</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/view-points/the-free-no.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Redistribute Ubuntu CD</title>
		<link>http://mr21.in/software/redistribute-ubuntu-cd.html</link>
		<comments>http://mr21.in/software/redistribute-ubuntu-cd.html#comments</comments>
		<pubDate>Sat, 15 Oct 2005 15:54:51 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mr21.in/2005/10/15/redistribute-ubuntu-cd/</guid>
		<description><![CDATA[Ubuntu 5.10 已经发布了！ Ubuntu是基于Debian的一个Linux发行版， 具有Debian优良的包管理机制，对内核进行过较多的修改，因此不完全兼容Debian-deb包。 手头于是有一些多余的Ubuntu 5.04的CD，也借此开... ]]></description>
			<content:encoded><![CDATA[<div class="flip"><img src="http://upload.wikimedia.org/wikipedia/fr/thumb/2/2e/Ubuntu.gif/150px-Ubuntu.gif" alt="" /></div>
<p><a href="http://www.ubuntu.com/newsitems/release510">Ubuntu 5.10 已经发布了</a>！<br />
Ubuntu是基于Debian的一个Linux发行版，<br />
具有Debian优良的包管理机制，对内核进行过较多的修改，因此不完全兼容Debian-deb包。</p>
<p>手头于是有一些多余的<em>Ubuntu 5.04的CD</em>，也借此开了一个淘宝的店铺（达到了10件商品，其中5件是Ubuntu）.. .. ..</p>
<p>不知道我Blog的访客中是否有人对<em>Ubuntu 5.04</em>有兴趣或者喜欢收藏<em>Linux CD</em>而没有得到<em>Ubuntu CD</em>？<br />
如果有，可以访问我的淘宝店铺，买下物品，我只收取邮寄费用。<br />
（嘿嘿，不好意思，我没有<em>Ubuntu基金会</em>那么有钱）</p>
<p>这是第二次收到5.04的CD了，前次收到的10套CD居然都有问题，加载BSD unit的时候就提示错误了。<br />
不过，这次的CD都很漂亮，似乎没有任何瑕疵。</p>
<p>我也已经订“购”了<em>Ubuntu 5.10</em>的CD，<em>Ubuntu基金会</em>已经交付配送了，<br />
如果收到以后，有谁需要可以联系我。<br />
不过，联系<em>Ubuntu基金会</em>来的更便宜，一分钱都不用，嘿嘿，<br />
我只是在发送速度上有优势而已。</p>
<p>相关：<br />
Ubuntu    http://www.ubuntu.com/<br />
Ubuntu shipit    http://shipit.ubuntu.com/<br />
My Taobao Shop    http://shop33298901.taobao.com/</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/redistribute-ubuntu-cd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Distributes CD &amp; Beta CD</title>
		<link>http://mr21.in/view-points/distributes-cd-beta-cd.html</link>
		<comments>http://mr21.in/view-points/distributes-cd-beta-cd.html#comments</comments>
		<pubDate>Sat, 06 Aug 2005 06:20:36 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[二一视点]]></category>
		<category><![CDATA[Beta]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=113</guid>
		<description><![CDATA[前段时间申请了Ubuntu CD跟MS SQL 2005 Beta CD。不过，联想到点<strong>比较废话的问题</strong>.. .. .... ]]></description>
			<content:encoded><![CDATA[<p>前段时间申请了<a href="http://www.ubuntu.org.cn/">Ubuntu Linux (based Debian)</a> CD跟M$ SQL 2005 Beta CD，不过由于学校的收发室人员还处于休假时期，没我们学生那么辛苦，自然就等不到这些东西了。（看了记录，Ubuntu是Jun 30th发出来的。至于M$的那个，在 Ubuntu 3个星期后申请的）</p>
<p>不过，联想到点<strong>比较废话的问题</strong>。就是发散这些CD的根本目的。</p>
<p>按照派发的CD内容，这两种分别是“Distributes ”跟“Beta”。<br />
Ubuntu属于前者，并且提供的是一套完整的系统安装媒介，通过此媒介可以安装一个完整的操作系统，包括Desktop应用。并且基于Debian的强大资源，优势自然没法说。更重要的是该套件是免费的，并且允许自由传播，而且“免费邮寄”……<br />
M$属于后者，提供的仅仅是一种未完成的套件，而该套件发行后的利润是可观的（估计这就是为什么WIN的BETA CD得自己掏钱，而SQL的BETA CD免费发放的原因吧？因为两者的价格差距实在不小）。通过这个CD，你可以预先体验到即将发行的软件，对于培训跟部署可以提前开始，以便正式发行的时候用最快的速度切换平台，实现平滑过度而几乎无损失。</p>
<p>这个问题我昨天跟老爸讨论了一下，顺便骂了一下<strong>M$拿用户开刀做实验品</strong>，还赞颂了一下<strong>OSS的种种好处</strong>.. .. ..<br />
不过事后一想，其实也<strong>不全对</strong>。</p>
<p>对于M$而言，这是一家商业公司，目的就是“<strong>盈利</strong>”，目标就是“<strong>钱……</strong>”，当然，出于这样的目的，并且在用户自愿的情况下，他们拿用户开涮也没什么不对的。反正M$免费提供，你需要的话，试试就是了，顺便把自己发现的什么不足给M$说说，虽然没什么回报，但是相对与事后的似乎机应用，似乎还应该感谢。<br />
细想了一下，这样的关系实际上是双赢的，谁也不亏。（当然，这样的双赢机制对普通用户来说，有点浪费资源了）<br />
就M$方面来说，发布较成熟的BETA版本，几乎等于发布了正式版了（当然，BETA后还会有修改，但应该不会触及核心部分）。<br />
而这样的结果就是大客户（他们的版本兴许更好）以及潜在客户都可以事先体验，并且为以后作出是否升级的决定，而且因为软件还基于BETA阶段，客户的意见就可以让M$为客户服务，进行修改，到能吸引到大量客户的时候，也就是正式发行了。这样，某些被接纳的潜在客户也会浮上水面成为正式客户。这样挺拉拢人心的……<br />
撇来M$种种乱七八糟的手段来说，这是家不错的公司，至少为客户服务不错。（不过，那些乱七八糟的手段是撇不开的，也就是说，这家公司……Sigh）（不过想想李开复事件，M$也够凄凉的）.. .. ..</p>
<p>回来说Ubuntu，这是OSS阵营下的组织，结构是<strong>非盈利</strong>的，目的是推广OSOS (Open Sources Operating System)。而为了推广，他们实行了免费发送发行版的策略，并且是全球邮寄发送，不用付任何费用（Ubuntu组织承担了）。<br />
按照<a href="http://www.ruinstudio.net/blog/kevin/">曉風·蔡（某大的金融学生）</a>的说法，这叫“极力推广”……<br />
我倒不这么认为，而且这样模式我也想不通。<br />
Ubuntu再努力，似乎<strong>一般用户</strong>也只是记住Linux或者Debian而已，直接记忆Ubuntu估计比前两类少（至少在这篇POST之前，我就没好好记住这个单词）。这个品牌效应就不明显。<br />
其次，压盘跟邮寄的费用如果处理？据已经收到CD的Ubuntuer说，是工业压盘的（不是小作坊似的CD-R），这样虽然费用相对低廉，不过加上国际包裹（我猜的，10套CD，估计没这种信函）的费用，应该不可低估了……<br />
不过，我看到了Ubuntu Shop的商品，如果换算成RMB，很不便宜的，一本“<a href="http://www.cafepress.com/ubuntushop.14580825">Ubuntu Journal</a>”标价$9.99（如果我赚的是美金，肯定给赞助一下了），换算成RMB就是￥81.0189，兴许这个是经济来源之一，<br />
其次，在Ubuntu China看到了<a href="http://www.ubuntu.org.cn/donations/document_view">捐助的连接</a>，这个是来源之二吧？（Ubuntu说他们还<strong>未成立“非赢利组织”</strong>，汗.. .. ..）<br />
还有一个不大可能的就是政府资助。不过，瑞典政府有这么做么？这个倒不敢枉加猜测，毕竟不清楚……<br />
接着说到Beta的问题，这个对OSS而言根本不是问题。因为OSS有着得天独厚的OS条件，代码公开，自定义跟测试，补漏都可以最短时间内完成，不像M$ User只能依靠M$一个（TCP/IP Patch似乎例外，不过那东西算是Crack，不管官方的东西了……），OSS可以接受任何人制作的Patch（接受过官方测试的，否则一个Rootkit你就完了……）<br />
我觉得还有一点比较重要。最近在看戴尔·卡耐基的《人性的弱点》，觉得在OSS里面应该算上“自重感”（也就是署名之类的）的问题。各个Programer应该都会在自己的东西里面显著署名该东西，似乎这样更容易得到用户的认可，得到大家承认，做这类工作会更有信心与耐心。（就像现在，我们知道某个Patch是M$出的，但却不知道是M$里面的谁出的，这似乎对该Programer不公平，而且很乏味，不过M$既然付了工资……）</p>
<p>天，，开头说要谈的是CD的派发目的……结果不知道谈到哪里去了，就这样吧，<br />
14：22了，15点还要上课，就先这样了，如果有新发现的话再来Update。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/view-points/distributes-cd-beta-cd.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Set Chinese Input @ Debian</title>
		<link>http://mr21.in/software/set-chinese-input-debian.html</link>
		<comments>http://mr21.in/software/set-chinese-input-debian.html#comments</comments>
		<pubDate>Sat, 16 Jul 2005 13:38:44 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Fcitx]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://mr21.in/2005/07/16/set-chinese-input-debian/</guid>
		<description><![CDATA[这是留给自己看的，防止什么时候忘记了。 全局定义： 在/etc/X11/Xsession.d里面新建一个名为95im-launch的文件，内容为： export G_FILENAME_ENCODING=@GBK export LC_ALL=zh_CN.GBK export XMODIFIERS=@im=fcitx fcitx 个人... ]]></description>
			<content:encoded><![CDATA[<p>这是留给自己看的，防止什么时候忘记了。</p>
<p>全局定义：<br />
在/etc/X11/Xsession.d里面新建一个名为95im-launch的文件，内容为：</p>
<pre>
export G_FILENAME_ENCODING=@GBK
export LC_ALL=zh_CN.GBK
export XMODIFIERS=@im=fcitx
fcitx
</pre>
<p>个人定义：（谢谢<a href="http://blog.cathayan.org">Cathayan</a>提示）<br />
还有，可以在 ~/.xsession 进行个人定义，把以上内容追加在该文件里<br />
（不过，如果全局定义过了，就不用个人定义了）</p>
<p>注意：<br />
其中的“GBK”是我自己的系统编码，请根据实际需要更改。<br />
（例如GB2312，UTF-8）</p>
<p>保存，重新启动X，fcitx就会随着登陆启动了。<br />
（重新启动X请按Ctrl+Alt+BackSpace组合键）</p>
<p>我在~/.bashrc里面设定就不行，真是郁闷了。<br />
<span id="more-101"></span><br />
<b>Update: July 18th, 2005</b><br />
更新了部分内容漏洞，取自Boiling Soul和Cathayan的回复，谢谢。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/set-chinese-input-debian.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>My Debian</title>
		<link>http://mr21.in/software/my-debian.html</link>
		<comments>http://mr21.in/software/my-debian.html#comments</comments>
		<pubDate>Sat, 18 Jun 2005 12:58:16 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[APT-GET]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=78</guid>
		<description><![CDATA[终于，结合了两天的休闲时间，安装了一个Debian 3.1r0。 其中Kernel 2.6.8，还装了GNOME和XFCE4，当然，还有不小心装上去的KDE（因为据说XFCE4运行一些程序要KDELIB支持，结果我就把KDE-CORE选上了，…... ]]></description>
			<content:encoded><![CDATA[<p>终于，结合了两天的休闲时间，安装了一个Debian 3.1r0。<br />
其中Kernel 2.6.8，还装了GNOME和XFCE4，当然，还有不小心装上去的KDE（因为据说XFCE4运行一些程序要KDELIB支持，结果我就把KDE-CORE选上了，……然后，用了1点好几G的空间~~</p>
<p>简单说一下我的安装步骤：</p>
<blockquote><ol>
<li>下载CD1跟CD2（因为有4M ADSL，没必要浪费了）</li>
<li>CD1刻盘启动安装</li>
<li>安装中将CD2挂载为/media/cd2，然后在设置APT源的部分添加/media/cd2到FileSystem</li>
<li>然后就正常安装了。（因为CD1/2中已经有GNOME/KDE了，所以，即使是离线安装到桌面也没问题。）</li>
</ol>
</blockquote>
<p>其中出现了点问题：就是执行PPPOECONF以后，无法PING通PPPOE GATEWAY外的任何地址，幸亏了<a href="http://spaces.msn.com/members/bluedata/">BlueData</a>兄的帮助，解决了，需要执行：</p>
<blockquote><p>route del default eth0<br />
route add default ppp0</p></blockquote>
<p>看起来是路由表的问题。</p>
<p>总的认为，DEBIAN+APT-GET是个好东西！</p>
<p>之前使用的是Gentoo，<br />
虽然在Gentooer看来，一切从Source开始是最完美的，但是我不是很苛求的人，DURON 950的机器，能苛求什么，编译一个GNOME就够我睡一觉了。<br />
按照Gentooer的理解，本地编译能达到最优的性能。不过，似乎所有i386架构的PC都差不多，所以，为了一觉的时候，我决定放弃GENTOO。<br />
当然，也不是说GENTOO就不好，只要“高要求”需要“高场合”，没有合适的环境，追求多出来的一点点速度而耗费一大堆时间，有价值么？</p>
<p>现在使用的是Debian，<br />
现在我也成为了一名Debianer了！这是种不错的感觉，<br />
APT-GET是个方便的东西，按照我的曲解，可以说是“安装预编好包的emerge”，并且速度很快（用CN99的MIRROR），<br />
包也齐全（15000多个），涵盖了各个方面.. .. ..（此处省略好处N字）<br />
不过，有些命令也需要重新熟悉一下，例如GENTOO下的RC-UPDATE这里就没有.. ..) :</p>
<p>不过，现在我对LINUX只能用“涉世未深”来形容，记得当初2002第一次使用LINUX到现在，几乎什么长进都没有，<br />
完了，完全符合我颓废的性格，什么都学不完，<br />
哎.. .. .. </p>
<p>附：<br />
Debian  http://www.Debian.org<br />
Gentoo http://www.Gentoo.org<br />
Debian 3.1r0 http://ftp.yz.yamagata-u.ac.jp/debian-cd/3.1_r0a/i386/   (14 CD)</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/my-debian.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

