<?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>baalchina &#187; Linux</title>
	<atom:link href="http://www.baalchina.net/category/server/linux-%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%ae%a1%e7%90%86/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.baalchina.net</link>
	<description>baalchina技术日志</description>
	<lastBuildDate>Mon, 19 Jul 2010 08:30:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux学习-Samba(V1.0)</title>
		<link>http://www.baalchina.net/2010/07/linux-study-samba/</link>
		<comments>http://www.baalchina.net/2010/07/linux-study-samba/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 08:30:49 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[samba]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2010/07/linux-study-samba/</guid>
		<description><![CDATA[1. Samba的作用，和Windows服务器共享文件，注意Windows是不支持Samba的。
2. Samba使用SMB协议，Server Message Block。
3. Samba的两个进程：smbd和nmbd。
4. 主配置文件：/etc/samba/smb.conf
5. 添加samba用户：#smbpasswd -a username。必须是系统存在的用户。
6. 检查Samba共享的资源：#smbclient -l 192.168.1.1
7. Samba的图形化配置工具叫做SWAT，Samba Web Administration Tool。
]]></description>
			<content:encoded><![CDATA[<p>1. Samba的作用，和Windows服务器共享文件，注意Windows是不支持Samba的。</p>
<p>2. Samba使用SMB协议，Server Message Block。</p>
<p>3. Samba的两个进程：smbd和nmbd。</p>
<p>4. 主配置文件：/etc/samba/smb.conf</p>
<p>5. 添加samba用户：#smbpasswd -a username。必须是系统存在的用户。</p>
<p>6. 检查Samba共享的资源：#smbclient -l 192.168.1.1</p>
<p>7. Samba的图形化配置工具叫做SWAT，Samba Web Administration Tool。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2010/07/linux-study-samba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux学习-NFS(V1.0)</title>
		<link>http://www.baalchina.net/2010/07/linux-study-nfs/</link>
		<comments>http://www.baalchina.net/2010/07/linux-study-nfs/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 06:16:42 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[未分类]]></category>
		<category><![CDATA[nfs]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2010/07/linux%e5%ad%a6%e4%b9%a0-nfsv1-0/</guid>
		<description><![CDATA[

NFS使用RPC（远程过程调用）来协助工作。


NFS和FTP等的区别，透明的访问一个进程，引用文件部分：即不需要产生文件的副本，本地客户端也不需要做任何修改。


NFS服务器的安装


启动inet, portmap, nfs和mount


定义要拿来共享的分区


客户端列表中定义客户端的参数


修改/etc/exports


重启nfs。




NFS的系统结构（注意这是服务器上的）


/etc/exports。主配置文件。


/usr/sbin/exportfs，一个命令


/usr/sbin/showmount，这个主要用户客户端，来查看NFS共享出来的资源。




/etc/exports的配置。将需要共享的文件系统编辑到/etc/exports中，当NFS重启的时候就会自动读取，并将文件共享，设定权限。


修改了exports文件之后，运行exportfs更新一下即可。


NFS客户端挂载，使用mount命令


#mount -t nfs 192.168.1.1:/home/wu /home/nfs/wu


将192.168.1.1上的/home/wu挂载到本地的/home/nfs/wu下。




扫描可共享的文件


#showmount -e 192.168.1.1




卸载，使用#umount命令。


还可以使用/etc/fstab来挂载。


#vi /etc/fstab


server:/usr/local/pub /pub nfs rsize=9192.,wsize=8192,timeo=14,intr




也可以使用autofs来挂载，只有文件系统被使用时才挂载。


首先由一个主文件/etc/auto.master，然后里面引用了分别每个挂载点的配置文件。


比如/etc/auto.master下写一行：/misc /etc/auto.misc


再编辑/etc/auto.misc，添加：wu –rw,soft 192.168.1.1:/project。就是把192.168.1.1下的project挂载到了/misc/wu下。


需要重启autofs生效。




]]></description>
			<content:encoded><![CDATA[<ol>
<li>
<div style="text-align: justify">NFS使用RPC（远程过程调用）来协助工作。</div>
</li>
<li>
<div style="text-align: justify">NFS和FTP等的区别，透明的访问一个进程，引用文件部分：即不需要产生文件的副本，本地客户端也不需要做任何修改。</div>
</li>
<li>
<div style="text-align: justify">NFS服务器的安装</div>
<ol>
<li>
<div style="text-align: justify">启动inet, portmap, nfs和mount</div>
</li>
<li>
<div style="text-align: justify">定义要拿来共享的分区</div>
</li>
<li>
<div style="text-align: justify">客户端列表中定义客户端的参数</div>
</li>
<li>
<div style="text-align: justify">修改/etc/exports</div>
</li>
<li>
<div style="text-align: justify">重启nfs。</div>
</li>
</ol>
</li>
<li>
<div style="text-align: justify">NFS的系统结构（注意这是服务器上的）</div>
<ol>
<li>
<div style="text-align: justify">/etc/exports。主配置文件。</div>
</li>
<li>
<div style="text-align: justify">/usr/sbin/exportfs，一个命令</div>
</li>
<li>
<div style="text-align: justify">/usr/sbin/showmount，这个主要用户客户端，来查看NFS共享出来的资源。</div>
</li>
</ol>
</li>
<li>
<div style="text-align: justify">/etc/exports的配置。将需要共享的文件系统编辑到/etc/exports中，当NFS重启的时候就会自动读取，并将文件共享，设定权限。</div>
</li>
<li>
<div style="text-align: justify">修改了exports文件之后，运行exportfs更新一下即可。</div>
</li>
<li>
<div style="text-align: justify">NFS客户端挂载，使用mount命令</div>
<ol>
<li>
<div style="text-align: justify">#mount -t nfs 192.168.1.1:/home/wu /home/nfs/wu</div>
</li>
<li>
<div style="text-align: justify">将192.168.1.1上的/home/wu挂载到本地的/home/nfs/wu下。</div>
</li>
</ol>
</li>
<li>
<div style="text-align: justify">扫描可共享的文件</div>
<ol>
<li>
<div style="text-align: justify">#showmount -e 192.168.1.1</div>
</li>
</ol>
</li>
<li>
<div style="text-align: justify">卸载，使用#umount命令。</div>
</li>
<li>
<div style="text-align: justify">还可以使用/etc/fstab来挂载。</div>
<ol>
<li>
<div style="text-align: justify">#vi /etc/fstab</div>
</li>
<li>
<div style="text-align: justify">server:/usr/local/pub /pub nfs rsize=9192.,wsize=8192,timeo=14,intr</div>
</li>
</ol>
</li>
<li>
<div style="text-align: justify">也可以使用autofs来挂载，只有文件系统被使用时才挂载。</div>
<ol>
<li>
<div style="text-align: justify">首先由一个主文件/etc/auto.master，然后里面引用了分别每个挂载点的配置文件。</div>
</li>
<li>
<div style="text-align: justify">比如/etc/auto.master下写一行：/misc /etc/auto.misc</div>
</li>
<li>
<div style="text-align: justify">再编辑/etc/auto.misc，添加：wu –rw,soft 192.168.1.1:/project。就是把192.168.1.1下的project挂载到了/misc/wu下。</div>
</li>
<li>
<div style="text-align: justify">需要重启autofs生效。</div>
</li>
</ol>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2010/07/linux-study-nfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux打开telnet-server功能</title>
		<link>http://www.baalchina.net/2010/02/linux-telnet/</link>
		<comments>http://www.baalchina.net/2010/02/linux-telnet/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 08:16:31 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Telnet]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2010/02/linux-telnet/</guid>
		<description><![CDATA[默认linux是关闭telnet-server功能的，我们来安装它。
安装：
[root@disk shell]# yum install telnet-server

telnet-server通过xinetd来控制的，编辑打开：
[root@disk shell]# vi /etc/xinetd.d/telnet

将disable修改为no。
重启一下xinetd:
[root@disk shell]# service xinetd restart     Stopping xinetd: [FAILED]      Starting xinetd: [&#160; OK&#160; ]      [root@disk shell]# 

&#160;
另外还要记得修改防火墙。并通过ntsysv将telnet加成服务。
&#160;
写完上面的我发现以前已经写过类似的了...http://www.baalchina.net/2008/08/linux%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%89%e8%a3%85telnet-server/
]]></description>
			<content:encoded><![CDATA[<p>默认linux是关闭telnet-server功能的，我们来安装它。</p>
<p>安装：</p>
<blockquote><p>[root@disk shell]# yum install telnet-server</p>
</blockquote>
<p>telnet-server通过xinetd来控制的，编辑打开：</p>
<blockquote><p>[root@disk shell]# vi /etc/xinetd.d/telnet</p>
</blockquote>
<p>将disable修改为no。</p>
<p>重启一下xinetd:</p>
<blockquote><p>[root@disk shell]# service xinetd restart     <br />Stopping xinetd: [FAILED]      <br />Starting xinetd: [&#160; OK&#160; ]      <br />[root@disk shell]# </p>
</blockquote>
<p>&#160;</p>
<p>另外还要记得修改防火墙。并通过ntsysv将telnet加成服务。</p>
<p>&#160;</p>
<p>写完上面的我发现以前已经写过类似的了...<a href="http://www.baalchina.net/2008/08/linux%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%89%e8%a3%85telnet-server/">http://www.baalchina.net/2008/08/linux%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%89%e8%a3%85telnet-server/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2010/02/linux-telnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;这样使用RHEL合法吗&#8221;?(zt)</title>
		<link>http://www.baalchina.net/2010/01/isit-legal-to-use-rhel/</link>
		<comments>http://www.baalchina.net/2010/01/isit-legal-to-use-rhel/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 08:30:25 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2010/01/isit-legal-to-use-rhel/</guid>
		<description><![CDATA[某位网友在 Chinaunix.net 的 Linux 系统管理论坛中提出问题“这样使用 RHEL 合法吗？”：   “1. 从网络下载RHEL的ISO文件安装。    2. 不购买RHEL任何服务。    3. 移除系统中redhat注册商标(保留版本号...)。    4. 从ftp.redhat.com官方的srpm编译后升级/下载新版RHEL的ISO文件升级。    5. 使用当前系统自动维护其他子服务器。” 
该网友询问了 Red Hat 官方，得到一些价目表和授权文件，但答复“Red Hat 官方不提供任何法律指导”，意思也就是“到底合不合法，不妨猜猜看？” 本着疑义相与析的精神，各位网友就此展开了热烈的讨论，Red Hat 员工和业余法律爱好者们甚至进行了针锋相对的辩论。 
去年我正好研究过这个问题，现在把旧文找出来整理重贴。 
RHEL 的版权由 GPL 软件版权和 Red Hat 自有版权两部分组成，而由于 GPL 许可证具有传染性，故所有基于 GPL 开发的软件都要符合 GPL 条款，因此 Red [...]]]></description>
			<content:encoded><![CDATA[<p>某位网友在 Chinaunix.net 的 Linux 系统管理论坛中提出问题“这样使用 RHEL 合法吗？”：   <br />“1. 从网络下载RHEL的ISO文件安装。    <br />2. 不购买RHEL任何服务。    <br />3. 移除系统中redhat注册商标(保留版本号...)。    <br />4. 从ftp.redhat.com官方的srpm编译后升级/下载新版RHEL的ISO文件升级。    <br />5. 使用当前系统自动维护其他子服务器。” </p>
<p>该网友询问了 Red Hat 官方，得到一些价目表和授权文件，但答复“Red Hat 官方不提供任何法律指导”，意思也就是“到底合不合法，不妨猜猜看？” 本着疑义相与析的精神，各位网友就此展开了热烈的讨论，Red Hat 员工和业余法律爱好者们甚至进行了针锋相对的辩论。 </p>
<p>去年我正好研究过这个问题，现在把旧文找出来整理重贴。 </p>
<p>RHEL 的版权由 GPL 软件版权和 Red Hat 自有版权两部分组成，而由于 GPL 许可证具有传染性，故所有基于 GPL 开发的软件都要符合 GPL 条款，因此 Red Hat 自有版权部分在 RHEL 中只占很少的部分，只需删除所有 Red Hat Network Code 即可完全自由使用RHEL。这在 RHEL Subscriptions Renewal FAQs 里说得很清楚： </p>
<blockquote><p><em>6. If I don't renew, can I continue to use the software? </em></p>
<p><em>Yes, under the General Public License (GP), you may use the software and maintain your own custom version of Linux. However, you will not have access to: </em></p>
<p><em>* Technical support from Red Hat. </em></p>
<p><em>* Security or software updates via Red Hat Network. You will have to find updates from alternative resources that provide reliable, secure downloads. </em></p>
<p><em>* Support from certified hardware suppliers or software vendors like Oracle for applications running on an expired Red Hat Enterprise Linux subscription. </em></p>
<p><em>* Coverage from the Red Hat Open Source Assurance program, featuring an Intellectual Property Warranty for Red Hat Enterprise Linux customers. Red Hat designed the program to protect customers using open source solutions. </em></p>
<p><em>Please note that when your subscription expires you will still be bound by the terms and conditions of the End User License Agreement and will have to remove all copies of Red Hat Network Code. </em></p>
</blockquote>
<p>Red Hat 的营利模式是 Subscription Business Model，即通过向用户出售技术服务，获取相应年费营利，这在 Red Hat Store 网页上说得也很清楚： </p>
<p>其 Subscription 内容主要包括 phone support、web support 和 unlimited incidents。如果你的技术能力足以自我 Support，又何必购买如此昂贵的 Support 呢？ </p>
<p>这样使用 RHEL 完全合法。其实 Oracle 所谓的 Unbreakable Enterprise Linux 就是把 RHEL 改头换面，再低价出售 Compatiable Subscription（鄙视），详见： <a href="http://en.wikipedia.org/wiki/Oracle_Enterprise_Linux">http://en.wikipedia.org/wiki/Oracle_Enterprise_Linux</a></p>
<p>当 然，Red Hat 为 Linux 的发展付出了巨大的努力，他们提供的 Red Hat Enterprise Linux 系列较之同类产品，无论在功能还是性能方面都有极大的提升（相对于 Fedora 9 和 Ubuntu Server 的测试结果可以看出）。我们应该如何回馈 Red Hat，促使其继续保持对开源软件的巨大热情，进一步推动 RHEL 又好又快发展，这是大家都需要考虑的问题（欢迎购买 Red Hat 相关产品、服务，参加 RHCE/RHCA 认证培训和考试）。 </p>
<p>最后，向各位担心法律问题的朋友，奉上许可证检查脚本： CheckLicense.sh </p>
<blockquote><p>#!/bin/bash     <br /># Author: hutuworm (<a href="http://hutuworm.blogspot.com)">http://hutuworm.blogspot.com)</a>      <br /># RELEASED UNDER GPLv2. </p>
<p>for PACKAGE in `rpm -qa`     <br />do      <br />NOTICE=`rpm -qi $PACKAGE | grep License | grep -iE 'red ?hat'`      <br />if [ ! &quot;$NOTICE&quot; = &quot;&quot; ]      <br />then      <br />echo $PACKAGE &quot;:&quot; $NOTICE ;      <br />fi      <br />done </p>
</blockquote>
<p>在装有 RHEL 的服务器上执行： </p>
<blockquote><p># sh CheckLicense.sh </p>
</blockquote>
<blockquote><p>redhat-logos-1.1.14.3-1 : Size : 993129 License: Copyright ?1999-2002 Red Hat, Inc. All rights reserved. </p>
<p>anaconda-images-9.1-3.RHEL : Size : 5363878 License: Copyright ?2003 Red Hat, Inc. All rights reserved. </p>
<p>anaconda-product-3-1AS : Size : 75111 License: Copyright 2003 Red Hat, Inc. All rights reserved. </p>
</blockquote>
<p>那么只需要把 redhat-logos-1.1.14.3-1、anaconda-images-9.1-3.RHEL、anaconda-product-3-1AS 这三个 rpm 包用 rpm -e 命令从系统中移除，即可高枕无忧。</p>
<p>转载自：<a title="http://www.cnbeta.com/articles/65199.htm" href="http://www.cnbeta.com/articles/65199.htm">http://www.cnbeta.com/articles/65199.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2010/01/isit-legal-to-use-rhel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>最简squid配置教程</title>
		<link>http://www.baalchina.net/2010/01/squid-fast-config/</link>
		<comments>http://www.baalchina.net/2010/01/squid-fast-config/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 02:14:39 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[服务器管理]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2010/01/squid-fast-config/</guid>
		<description><![CDATA[for 刘老大。:lol
首先ssh上去，
vi /etc/hosts

添加你要解析的地址，比如
1.1.1.1 hosts.example.com

其中

1.1.1.1是真实Web服务器的IP地址
hosts.example是服务器的域名

接下来编辑
vi /usr/local/squid/etc/squid.conf

对应添加这两行：
cache_peer_domain example&#160;hosts.example.com 
cache_peer hosts.example.com parent 80 0 originserver no-query name=example&#160;

注意颜色对应。
然后重新配置squid即可。
/usr/local/squid/sbin/squid -k reconfigure

测试通过就ok了。
]]></description>
			<content:encoded><![CDATA[<p>for 刘老大。:lol</p>
<p>首先ssh上去，</p>
<blockquote><p>vi /etc/hosts</p>
</blockquote>
<p>添加你要解析的地址，比如</p>
<blockquote><p>1.1.1.1 hosts.example.com</p>
</blockquote>
<p>其中</p>
<ol>
<li>1.1.1.1是真实Web服务器的IP地址</li>
<li>hosts.example是服务器的域名</li>
</ol>
<p>接下来编辑</p>
<blockquote><p>vi /usr/local/squid/etc/squid.conf</p>
</blockquote>
<p>对应添加这两行：</p>
<blockquote><p>cache_peer_domain <font color="#0000ff">example</font>&#160;<font color="#800000">hosts.example.com</font> </p>
<p>cache_peer <font color="#800000">hosts.example.com</font> parent 80 0 originserver no-query name=<font color="#0000ff">example</font>&#160;</p>
</blockquote>
<p>注意颜色对应。</p>
<p>然后重新配置squid即可。</p>
<blockquote><p>/usr/local/squid/sbin/squid -k reconfigure</p>
</blockquote>
<p>测试通过就ok了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2010/01/squid-fast-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows下使用IIS下建立内网Ubuntu镜像</title>
		<link>http://www.baalchina.net/2009/12/building-ubuntu-mirror-in-windows-server/</link>
		<comments>http://www.baalchina.net/2009/12/building-ubuntu-mirror-in-windows-server/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 05:10:33 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2009/12/building-ubuntu-mirror-in-windows-server/</guid>
		<description><![CDATA[学校里搞一个Ubuntu镜像，可惜有空间的服务器都是Windows的，懒得再搞一个Linux服务器，于是就在Windows下作吧。
需要环境

Windows服务器（废话），启用IIS或者FTP。我用的是IIS。
300G左右的存储（我是同步了所有的文件，包括源码，各个版本，以及各个硬件支持，目前大小是296G，398504个文件）
Linux下镜像采用rsync，那么Windows下就是cwRsync啦。

配置cwRsync
安装，不多说，然后新建一个批处理，代码如下
rsync -vzrtopg --progress&#160; --delete rsync://ubuntu.srt.cn/ubuntu/ /cygdrive/L/mirror/ubuntu/

可以看出，我是从ubuntu.srt.cn/ubuntu同步到本地的l盘的mirror下的ubuntu目录。
完整的国内镜像可以看https://launchpad.net/ubuntu/+archivemirrors，几个地方，USETC的教育网速度不错，srt和lupa的电信速度不错。但是USETC到一定时间就会自动断开，lupa的同步会死掉，最后我是用srt完成的。其实也有很多源比如搜狐网易都有，但是不支持rsync协议。
另外要记得把这个批处理放到计划任务里面去。
配置IIS
这个就很简单了，把l盘的这个目录放出去就行。我开了目录浏览。另外IIS里面需要加一个MIME类型，否则ubuntu的.deb文件会报404，具体看这里：IIS MIME类型设置
客户端配置
以Ubuntu 9.10为例，修改/etc/apt/source.list文件（backup first!）
deb http://linux.nau.edu.cn/ubuntu/ karmic main restricted universe multiverse      deb http://linux.nau.edu.cn/ubuntu/ karmic-security main restricted universe multiverse      deb http://linux.nau.edu.cn/ubuntu/ karmic-updates main restricted universe multiverse      deb http://linux.nau.edu.cn/ubuntu/ karmic-proposed main restricted universe multiverse     [...]]]></description>
			<content:encoded><![CDATA[<p>学校里搞一个Ubuntu镜像，可惜有空间的服务器都是Windows的，懒得再搞一个Linux服务器，于是就在Windows下作吧。</p>
<h4>需要环境</h4>
<ol>
<li>Windows服务器（废话），启用IIS或者FTP。我用的是IIS。</li>
<li>300G左右的存储（我是同步了所有的文件，包括源码，各个版本，以及各个硬件支持，目前大小是296G，398504个文件）</li>
<li>Linux下镜像采用rsync，那么Windows下就是cwRsync啦。</li>
</ol>
<h4>配置cwRsync</h4>
<p>安装，不多说，然后新建一个批处理，代码如下</p>
<blockquote><p>rsync -vzrtopg --progress&#160; --delete rsync://ubuntu.srt.cn/ubuntu/ /cygdrive/L/mirror/ubuntu/</p>
</blockquote>
<p>可以看出，我是从ubuntu.srt.cn/ubuntu同步到本地的l盘的mirror下的ubuntu目录。</p>
<p>完整的国内镜像可以看<a title="https://launchpad.net/ubuntu/+archivemirrors" href="https://launchpad.net/ubuntu/+archivemirrors">https://launchpad.net/ubuntu/+archivemirrors</a>，几个地方，USETC的教育网速度不错，srt和lupa的电信速度不错。但是USETC到一定时间就会自动断开，lupa的同步会死掉，最后我是用srt完成的。其实也有很多源比如搜狐网易都有，但是不支持rsync协议。</p>
<p>另外要记得把这个批处理放到计划任务里面去。</p>
<h4>配置IIS</h4>
<p>这个就很简单了，把l盘的这个目录放出去就行。我开了目录浏览。另外IIS里面需要加一个MIME类型，否则ubuntu的.deb文件会报404，具体看这里：<a href="http://www.baalchina.net/2009/12/iis-mime-type/" target="_blank">IIS MIME类型设置</a></p>
<h4>客户端配置</h4>
<p>以Ubuntu 9.10为例，修改/etc/apt/source.list文件（backup first!）</p>
<blockquote><p>deb <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic main restricted universe multiverse      <br />deb <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic-security main restricted universe multiverse      <br />deb <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic-updates main restricted universe multiverse      <br />deb <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic-proposed main restricted universe multiverse      <br />deb <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic-backports main restricted universe multiverse      <br />deb-src <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic main restricted universe multiverse      <br />deb-src <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic-security main restricted universe multiverse      <br />deb-src <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic-updates main restricted universe multiverse      <br />deb-src <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic-proposed main restricted universe multiverse      <br />deb-src <a href="http://linux.nau.edu.cn/ubuntu/">http://linux.nau.edu.cn/ubuntu/</a> karmic-backports main restricted universe multiverse</p>
<p>&#160;</p>
</blockquote>
<p>然后刷新列表，就可以用新力得了。</p>
<blockquote><p>sudo apt-get update</p>
</blockquote>
<p>&#160;</p>
<p>参照<a href="http://wiki.ubuntu.org.cn/articles/q/r/e/Qref_Source_4d14.html#.E6.BA.90.E5.88.97.E8.A1.A8" target="_blank">Ubuntu中文Wiki的文章</a></p>
<p>&#160;</p>
<p>Tips:</p>
<ol>
<li>Ubuntu的官方镜像列表：<a title="https://launchpad.net/ubuntu/+archivemirrors" href="https://launchpad.net/ubuntu/+archivemirrors">https://launchpad.net/ubuntu/+archivemirrors</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2009/12/building-ubuntu-mirror-in-windows-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>/etc/fstab修改错误无法进入系统的解决方案</title>
		<link>http://www.baalchina.net/2009/12/fstab-failed/</link>
		<comments>http://www.baalchina.net/2009/12/fstab-failed/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 07:19:55 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[服务器管理]]></category>
		<category><![CDATA[fstab]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2009/12/fstab-failed/</guid>
		<description><![CDATA[改vsftp的配额，结果改错了...无法进入系统，提示read-only...
解决方法
用centos光盘启动，按f5，进入rescue模式。
输入：
chroot /mnt/sysimages

现在就可以修改/etc/fstab了。
]]></description>
			<content:encoded><![CDATA[<p>改vsftp的配额，结果改错了...无法进入系统，提示read-only...</p>
<p>解决方法</p>
<p>用centos光盘启动，按f5，进入rescue模式。</p>
<p>输入：</p>
<blockquote><p>chroot /mnt/sysimages</p>
</blockquote>
<p>现在就可以修改/etc/fstab了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2009/12/fstab-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vsftpd的安装与配置（不全，待补充，20091205）</title>
		<link>http://www.baalchina.net/2009/12/vsftpd-install/</link>
		<comments>http://www.baalchina.net/2009/12/vsftpd-install/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 09:06:43 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[FTP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[服务器管理]]></category>
		<category><![CDATA[vsftp]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2009/12/vsftpd-install/</guid>
		<description><![CDATA[对于linux下的ftp，一直一种恐惧心理...哈。
&#160;
首先我们下载安装之
很简单。
[root@php ~]#wget ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.2.2.tar.gz[root@php ~]#tar xvzf vsftpd-2.2.2.tar.gz       [root@php ~]#cd vsftpd-2.2.2      [root@php ~]#make      [root@php ~]#useradd nobody      [root@php ~]#mkdir /usr/share/empty/      [root@php ~]#make install      [root@php ~]#cp vsftpd.conf /etc/ [...]]]></description>
			<content:encoded><![CDATA[<p>对于linux下的ftp，一直一种恐惧心理...哈。</p>
<p>&#160;</p>
<h4>首先我们下载安装之</h4>
<p>很简单。</p>
<blockquote><p>[root@php ~]#wget <a href="ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.2.2.tar.gz">ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.2.2.tar.gz</a>[root@php ~]#tar xvzf vsftpd-2.2.2.tar.gz       <br />[root@php ~]#cd vsftpd-2.2.2      <br />[root@php ~]#make      <br />[root@php ~]#useradd nobody      <br />[root@php ~]#mkdir /usr/share/empty/      <br />[root@php ~]#make install      <br />[root@php ~]#cp vsftpd.conf /etc/      <br />[root@php ~]#/usr/local/sbin/vsftpd &amp;</p>
</blockquote>
<p>可以看到，安装的时候是不需要configure的。</p>
<h4>配置用户账号</h4>
<p>这里用到了一个db_load的工具，默认是没有的，先安装之：</p>
<blockquote><p>[root@php ~]#yum install db4-utils</p>
</blockquote>
<p>然后我们新建一个密码文件，比如user.txt，格式如下：</p>
<blockquote><p>username     <br />password</p>
</blockquote>
<p>接下来把他变成vsftpd的数据库格式，并加权限：</p>
<blockquote><p>[root@php ~]# db_load -T -t hash -f /root/vsftpd/logins.txt /etc/vsftpd_login.db     <br />[root@php ~]# chmod 600 /etc/vsftpd_login.db </p>
</blockquote>
<p>新建一个/etc/pam.d/vsftpd.vu文件，内容如下：</p>
<blockquote><p>auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login     <br />account required /lib/security/pam_userdb.so db=/etc/vsftpd_login </p>
</blockquote>
<p>给ftp新建一个用户：</p>
<blockquote><p>[root@php ~]# useradd -d /home/vsftpd -s /sbin/nologin vsftpd</p>
</blockquote>
<h4>启动之</h4>
<blockquote><p>[root@php ~]# /usr/local/sbin/vsftpd &amp;     <br />[1] 9761</p>
</blockquote>
<p>9761是自动弹出的告诉你pid的。</p>
<p>&#160;</p>
<p>&#160;</p>
<h4>Troubleshooting</h4>
<h5>启动ok,但是ftp连接报错</h5>
<blockquote><p>[右] 正在连接到 210.28.92.18 -&gt; IP=210.28.92.18 PORT=21     <br />[右] 已连接到 210.28.92.18      <br />[右] 500 OOPS: vsftpd: both local and anonymous access disabled!</p>
</blockquote>
<p>将local_enable=YES即可。</p>
<h5>root可以登录，但是设置的帐号却不能</h5>
<p>这个需要注意是否安装了pam。前面我们看到账户使用了pam认证，那么必须有pam的支持。</p>
<blockquote><p>[root@php ~]#yum install pam-devel</p>
</blockquote>
<p>然后再重新编译、安装vsftpd。用ldd命令可以看到vsftpd是否加载了pam：</p>
<blockquote><p>[root@php vsftpd-2.2.2]# ldd /usr/local/sbin/vsftpd      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; linux-gate.so.1 =&gt;&#160; (0x00195000)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#ff0000">libpam.so.0 =&gt; /lib/libpam.so.0 (0x006a7000)       <br /></font>&#160;&#160;&#160;&#160;&#160;&#160;&#160; libdl.so.2 =&gt; /lib/libdl.so.2 (0x0035c000)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; libnsl.so.1 =&gt; /lib/libnsl.so.1 (0x0068e000)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; libresolv.so.2 =&gt; /lib/libresolv.so.2 (0x00744000)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; libutil.so.1 =&gt; /lib/libutil.so.1 (0x0067c000)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; libcap.so.1 =&gt; /lib/libcap.so.1 (0x00688000)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; libc.so.6 =&gt; /lib/libc.so.6 (0x00215000)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; libaudit.so.0 =&gt; /lib/libaudit.so.0 (0x0037b000)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; /lib/ld-linux.so.2 (0x001f2000)</p>
</blockquote>
<p>然后重启vsftpd就ok乐。还算有点扰人的。参考：<a title="http://www.oschina.net/docs/article/10383" href="http://www.oschina.net/docs/article/10383">http://www.oschina.net/docs/article/10383</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2009/12/vsftpd-install/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>升级Apache+PHP</title>
		<link>http://www.baalchina.net/2009/10/upgrade-php-apache/</link>
		<comments>http://www.baalchina.net/2009/10/upgrade-php-apache/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 05:26:47 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2009/10/upgrade-php-apache/</guid>
		<description><![CDATA[招生的时候检测报告说俺们的web server有漏洞，于是决定把Apache+PHP升级一下。
首先看一下版本：
[root@www1 ~]# /usr/local/apache2/bin/apachectl -v      Server version: Apache/2.2.4 (Unix)       Server built:&#160;&#160; Aug&#160; 7 2008 14:07:37

&#160;
php的版本可以写个phpinfo看到。装的是4.4.4。
&#160;
[root@www1 ~]# /usr/local/php/bin/php -i &#124;grep configure      Configure Command =&#62;&#160; './configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib-dir' '--with-bz2' '--with-tiff-dir' '--with-gd=/usr/local/gd2' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-ttf' '--enable-mbstring' '--with-mysql=/usr/local/mysql' '--with-config-file-path=/etc' '--disable-ipv6' '--enable-static'
&#160;

&#160;
更多内容参照：http://www.baalchina.net/2009/08/php-mysql-apache-configure/
注意：

ZO也要装 [...]]]></description>
			<content:encoded><![CDATA[<p>招生的时候检测报告说俺们的web server有漏洞，于是决定把Apache+PHP升级一下。</p>
<p>首先看一下版本：</p>
<blockquote><p>[root@www1 ~]# /usr/local/apache2/bin/apachectl -v      <br />Server version: Apache/2.2.4 (Unix)       <br />Server built:&#160;&#160; Aug&#160; 7 2008 14:07:37</p>
</blockquote>
<p>&#160;</p>
<p>php的版本可以写个phpinfo看到。装的是4.4.4。</p>
<p>&#160;</p>
<blockquote><p>[root@www1 ~]# /usr/local/php/bin/php -i |grep configure      <br />Configure Command =&gt;&#160; './configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib-dir' '--with-bz2' '--with-tiff-dir' '--with-gd=/usr/local/gd2' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-ttf' '--enable-mbstring' '--with-mysql=/usr/local/mysql' '--with-config-file-path=/etc' '--disable-ipv6' '--enable-static'</p>
<p>&#160;</p>
</blockquote>
<p>&#160;</p>
<p>更多内容参照：<a href="http://www.baalchina.net/2009/08/php-mysql-apache-configure/">http://www.baalchina.net/2009/08/php-mysql-apache-configure/</a></p>
<p>注意：</p>
<ul>
<li>ZO也要装 </li>
<li>根据跑的cms程序，php升级的时候尤其是4~5切记不可太随意。不过php4在07年就停止支持了… </li>
<li>备份好conf文件，虽然一般不会有问题…<br />
<h3>
<ul></ul>
<ul>先搞php</ul>
</h3>
<blockquote><p>wget <a href="http://cn2.php.net/get/php-5.2.11.tar.gz/from/cn.php.net/mirror">http://cn2.php.net/get/php-5.2.11.tar.gz/from/cn.php.net/mirror</a>           <br />tar xvzf php-5.2.11.tar.gz           <br />cd php-5.2.11           <br />'./configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib-dir' '--with-bz2' '--with-tiff-dir' '--with-gd=/usr/local/gd2' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-ttf' '--enable-mbstring' '--with-mysql=/usr/local/mysql' '--with-config-file-path=/etc' '--disable-ipv6' '--enable-static'           <br />make;make install</p>
</blockquote>
</li>
</ul>
<h3>然后搞ZO</h3>
<p>&#160;</p>
<p>没啥好说的…bs Zend，居然要注册才给地址</p>
<p><a href="http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz">http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz</a></p>
<p>另外暂时不支持php5.3.0。</p>
<p>&#160;</p>
<h3>然后搞Apache:</h3>
<p>&#160;</p>
<blockquote><p>[root@www1 ~]# ./configure &quot;--prefix=/usr/local/apache2&quot; &quot;--enable-module=so&quot; &quot;--enable-deflate=shared&quot; &quot;--enable-expires=shared&quot; &quot;--enable-rewrite=&quot; &quot;--enable-static-support&quot; &quot;--enable-static-htpasswd&quot; &quot;--enable-static-htdigest&quot; &quot;--enable-static-rotatelogs&quot; &quot;--enable-static-logresolve&quot; &quot;--enable-static-htdbm&quot; &quot;--enable-static-ab&quot; &quot;--enable-static-checkgid&quot; &quot;--enable-ssl&quot; &quot;--disable-userdir&quot; &quot;--with-ssl=/usr/local/openssl&quot; &quot;--with-apr=/usr/local/apr&quot; &quot;--with-apr-util=/usr/local/apr-util/bin&quot;      <br />[root@www1 ~]# make;make install       <br />[root@www1 ~]# /usr/local/apache2/bin/apachectl stop       <br />[root@www1 ~]# /usr/local/apache2/bin/apachectl start       <br />[root@www1 ~]# /usr/local/apache2/bin/apachectl -v</p>
</blockquote>
<p>&#160;</p>
<p>打完收工。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2009/10/upgrade-php-apache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>mysql备份之mysqldump</title>
		<link>http://www.baalchina.net/2009/08/mysqldump-usage/</link>
		<comments>http://www.baalchina.net/2009/08/mysqldump-usage/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 06:59:03 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2009/08/mysqldump-usage/</guid>
		<description><![CDATA[mysqldump其实就是把mysql数据库dump成sql文件。速度相当快（当然，没有直接copy快..哈哈），兼容性好。sql语句嘛，通吃的。
最简单的dump：
/usr/local/mysql/bin/mysqldump --uroot --ppassword discuz cdb_members &#62; /data/backup/members.sql
rsync --vzrtopg –progress  --delete rsync://ubuntu.srt.cn/ubuntu/ /cygdrive/L/mirror/ubuntu/
 
就是把discuz库的cdb_members表dump成members.sql文件。
mysqldump还有很多参数，常用的：

--opt，等同与添加--add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset这一堆参数
--lock-tables，锁表。dump的时候把这个表锁起来，保证表的完整性。
--lock-all-tables，锁有的表，保证库的完整性。

 
参考：
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html
]]></description>
			<content:encoded><![CDATA[<p>mysqldump其实就是把mysql数据库<em>dump</em>成sql文件。速度相当快（当然，没有直接copy快..哈哈），兼容性好。sql语句嘛，通吃的。</p>
<p>最简单的dump：</p>
<blockquote><p>/usr/local/mysql/bin/mysqldump --uroot --ppassword discuz cdb_members &gt; /data/backup/members.sql</p></blockquote>
<p>rsync --vzrtopg –progress  --delete rsync://ubuntu.srt.cn/ubuntu/ /cygdrive/L/mirror/ubuntu/</p>
<p> </p>
<p>就是把discuz库的cdb_members表dump成members.sql文件。</p>
<p>mysqldump还有很多参数，常用的：</p>
<ul>
<li>--opt，等同与添加--add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset这一堆参数</li>
<li>--lock-tables，锁表。dump的时候把这个表锁起来，保证<strong>表</strong>的完整性。</li>
<li>--lock-all-tables，锁有的表，保证<strong>库</strong>的完整性。</li>
</ul>
<p> </p>
<p>参考：</p>
<p><a title="http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html" href="http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html">http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2009/08/mysqldump-usage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
