﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-十三郎的IT生活-随笔分类-Linux</title><link>http://www.cnitblog.com/shisanlangd/category/8037.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 26 Sep 2011 15:00:24 GMT</lastBuildDate><pubDate>Mon, 26 Sep 2011 15:00:24 GMT</pubDate><ttl>60</ttl><item><title>Linux中sqlplus退格显示“^H” 的解决</title><link>http://www.cnitblog.com/shisanlangd/archive/2009/04/10/56205.html</link><dc:creator>十三郎</dc:creator><author>十三郎</author><pubDate>Fri, 10 Apr 2009 04:53:00 GMT</pubDate><guid>http://www.cnitblog.com/shisanlangd/archive/2009/04/10/56205.html</guid><wfw:comment>http://www.cnitblog.com/shisanlangd/comments/56205.html</wfw:comment><comments>http://www.cnitblog.com/shisanlangd/archive/2009/04/10/56205.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/shisanlangd/comments/commentRss/56205.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/shisanlangd/services/trackbacks/56205.html</trackback:ping><description><![CDATA[设定环境变量：<br>
<br>
1）在bash下，把 stty erase ^H 添加到.bash_profile中<br>
<br>
2）在csh下，把 stty erase ^H 添加到.cshrc中<br>
<br>
下面是我今天的实现方法（在bash下）<br>
<br>
[<span href="http://www.linuxdiyf.com/bbs/tag.php?name=root" onclick="tagshow(event)" class="t_tag">root</span>@testdb ~]# su - oracle&nbsp; &nbsp;进入oracle主目录，里面有 .bash_profile <br>
[root@testdb ~]# vi .bash_profile 添加一行<br>
<br>
stty erase ^H<br>
<br>
:wq 保存退出<br>
<br>
重新用oracle登录则可 <img src ="http://www.cnitblog.com/shisanlangd/aggbug/56205.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/shisanlangd/" target="_blank">十三郎</a> 2009-04-10 12:53 <a href="http://www.cnitblog.com/shisanlangd/archive/2009/04/10/56205.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux增加交换分区空间</title><link>http://www.cnitblog.com/shisanlangd/archive/2009/04/09/56181.html</link><dc:creator>十三郎</dc:creator><author>十三郎</author><pubDate>Thu, 09 Apr 2009 06:08:00 GMT</pubDate><guid>http://www.cnitblog.com/shisanlangd/archive/2009/04/09/56181.html</guid><wfw:comment>http://www.cnitblog.com/shisanlangd/comments/56181.html</wfw:comment><comments>http://www.cnitblog.com/shisanlangd/archive/2009/04/09/56181.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/shisanlangd/comments/commentRss/56181.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/shisanlangd/services/trackbacks/56181.html</trackback:ping><description><![CDATA[sdfdsfsd用RedHat的第一张光盘启动系统，在出现Boot:时，录入linux rescue<br><br><font id="" font_word="" class="htd" font-size:14px;="" font-family:宋体,="" verdana,="" arial,="" helvetica,="" sans-serif;="">1.查看当前系统硬盘空间的使用情况&nbsp;<br><br>[gdlc@linux&nbsp;/]#fdisk -l&nbsp;&nbsp; <br>[gdlc@linux&nbsp;/]#fdisk&nbsp;&nbsp;&nbsp;/dev/hda&nbsp;<br><br>n&nbsp;&nbsp;新建一个分区<br>注：分出一个区做为交换分区,</font><font id="" font_word="" class="htd" font-size:14px;="" font-family:宋体,="" verdana,="" arial,="" helvetica,="" sans-serif;="">分区类型应为primary，extend不能做为交换分区</font><br><font id="" font_word="" class="htd" font-size:14px;="" font-family:宋体,="" verdana,="" arial,="" helvetica,="" sans-serif;=""><br>t&nbsp;&nbsp;&nbsp;修改该分区的类型为交换分区（82）<br>注：输入L可看全部的分区类型<br><br>2.创建一个交换分区，命名为hda10<br>[gdlc@linux&nbsp;/]#mkswap&nbsp;&nbsp;/dev/hda10&nbsp;&nbsp;<br><br>3.格式化该分区<br><br>[gdlc@linux&nbsp;/]#free&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>4.查看系统当前交换空间的大小<br><br>5.激活该交换空间&nbsp;<br><br>[gdlc@linux&nbsp;/]#swapon&nbsp;&nbsp;&nbsp;/dev/hda10 <br><br>6.再查看系统交换空间的大小看是否有变化<br><br>[gdlc@linux&nbsp;/]#free&nbsp;<br>&nbsp;<br>7.加入/etc/fstab文件中，使其可自动加载<br><br>8.重新启动机器，查看该交换文件是否被自动激活，如果想关闭交换该交换空间<br><br>[gdlc@linux&nbsp;/]#swapoff&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/hda10&nbsp;&nbsp;&nbsp;&nbsp; </font><br> <img src ="http://www.cnitblog.com/shisanlangd/aggbug/56181.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/shisanlangd/" target="_blank">十三郎</a> 2009-04-09 14:08 <a href="http://www.cnitblog.com/shisanlangd/archive/2009/04/09/56181.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>防火墙配置--打开端口</title><link>http://www.cnitblog.com/shisanlangd/archive/2009/02/01/54078.html</link><dc:creator>十三郎</dc:creator><author>十三郎</author><pubDate>Sun, 01 Feb 2009 01:23:00 GMT</pubDate><guid>http://www.cnitblog.com/shisanlangd/archive/2009/02/01/54078.html</guid><wfw:comment>http://www.cnitblog.com/shisanlangd/comments/54078.html</wfw:comment><comments>http://www.cnitblog.com/shisanlangd/archive/2009/02/01/54078.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/shisanlangd/comments/commentRss/54078.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/shisanlangd/services/trackbacks/54078.html</trackback:ping><description><![CDATA[查看防火墙配置<br># iptables -L -n<br><br>打开22端口<br># iptables -A INPUT -p tcp -d 10.0.0.8 --dport 22 -j ACCEPT<br># iptables -A OUTPUT -p tcp -s 10.0.0.8 --sport 22 -j ACCEPT<br><br>保存配置，两种方法，选其一就可以了<br># service iptables save<br># iptables-save &gt; /etc/sysconfig/iptables<br><br><br>最简单的可以用:setup<br><br>配置文件/etc/sysconfig/iptables<br># Firewall configuration written by system-config-securitylevel<br># Manual customization of this file is not recommended.<br>*filter<br>:INPUT ACCEPT [0:0]<br>:FORWARD ACCEPT [0:0]<br>:OUTPUT ACCEPT [0:0]<br>:RH-Firewall-1-INPUT - [0:0]<br>-A INPUT -j RH-Firewall-1-INPUT<br>-A FORWARD -j RH-Firewall-1-INPUT<br>-A RH-Firewall-1-INPUT -i lo -j ACCEPT<br>-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT<br>-A RH-Firewall-1-INPUT -p 50 -j ACCEPT<br>-A RH-Firewall-1-INPUT -p 51 -j ACCEPT<br>-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT<br>-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT<br>-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<br>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT<br>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT<br>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT<br>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT<br>-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited<br>COMMIT<br>   <img src ="http://www.cnitblog.com/shisanlangd/aggbug/54078.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/shisanlangd/" target="_blank">十三郎</a> 2009-02-01 09:23 <a href="http://www.cnitblog.com/shisanlangd/archive/2009/02/01/54078.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>查看perl 安装 模块</title><link>http://www.cnitblog.com/shisanlangd/archive/2008/08/27/48427.html</link><dc:creator>十三郎</dc:creator><author>十三郎</author><pubDate>Wed, 27 Aug 2008 06:19:00 GMT</pubDate><guid>http://www.cnitblog.com/shisanlangd/archive/2008/08/27/48427.html</guid><wfw:comment>http://www.cnitblog.com/shisanlangd/comments/48427.html</wfw:comment><comments>http://www.cnitblog.com/shisanlangd/archive/2008/08/27/48427.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/shisanlangd/comments/commentRss/48427.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/shisanlangd/services/trackbacks/48427.html</trackback:ping><description><![CDATA[perl -e "use XXXX;";<br>
如果有Error就是沒有安裝該module...<br><br>perldoc perllocal<br>
可以看到版本<br><br><br> <img src ="http://www.cnitblog.com/shisanlangd/aggbug/48427.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/shisanlangd/" target="_blank">十三郎</a> 2008-08-27 14:19 <a href="http://www.cnitblog.com/shisanlangd/archive/2008/08/27/48427.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>LAMP 优化</title><link>http://www.cnitblog.com/shisanlangd/archive/2008/07/21/46966.html</link><dc:creator>十三郎</dc:creator><author>十三郎</author><pubDate>Mon, 21 Jul 2008 02:51:00 GMT</pubDate><guid>http://www.cnitblog.com/shisanlangd/archive/2008/07/21/46966.html</guid><wfw:comment>http://www.cnitblog.com/shisanlangd/comments/46966.html</wfw:comment><comments>http://www.cnitblog.com/shisanlangd/archive/2008/07/21/46966.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/shisanlangd/comments/commentRss/46966.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/shisanlangd/services/trackbacks/46966.html</trackback:ping><description><![CDATA[<p><strong><font color="#000000">　　[LAMP平台]</font></strong></p>
<p><font color="#000000">　　LAMP这个词的由来最早始于德国杂志&#8220;c't Magazine&#8221;，Michael
Kunze在1990年最先把这些项目组合在一起创造了LAMP的缩写字。这些组件虽然并不是开开始就设计为一起使用的，但是，这些开源软件都可以很方便
的随时获得并免费获得。这就导致了这些组件经常在一起使用。在过去的几年里，这些组件的兼容性不断完善，在一起的应用情形变得非常普便。为了改善不同组件
之间的协作，已经创建了某些扩展功能。目前，几乎在所有的Linux发布版中都默认包含了&#8220;LAMP
stack&#8221;的产品。这些产品组成了一个强大的Web应用程序平台</font></p>
<p><font color="#000000">　　LAMP 平台由四个组件组成，呈分层结构。每一层都提供了整个软件栈的一个关键部分：</font></p>
<ul>
    <li><font color="#000000"><strong>Linux：</strong>Linux 处在最低层，提供操作系统。其他每个组件实际上也在 Linux 上运行。但是，并不一定局限于 Linux，如有必要，其他组件也可以在 Microsoft&#174; Windows&#174;、Mac OS X 或 UNIX&#174; 上运行。 </font>
    </li>
    <li><font color="#000000"><strong>Apache：</strong>次低层是 Apache，它是一个 Web
    服务器。Apache 提供可让用户获得 Web 页面的机制。Apache 是一款稳定的、支持关键任务的服务器，Internet 上超过 65％
    的网站都使用它作为 Web 服务器。PHP 组件实际上是在 Apache 中，动态页面可以通过 Apache 和 PHP 创建。 </font>
    </li>
    <li><font color="#000000"><strong>MySQL：</strong>MySQL 提供 LAMP 系统的数据存储端。有了 MySQL，便可以获得一个非常强大的、适合运行大型复杂站点的数据库。在 Web 应用程序中，所有数据、产品、帐户和其他类型的信息都存放在这个数据库中，通过 SQL 语言可以很容易地查询这些信息。 </font>
    </li>
    <li><font color="#000000"><strong>PHP：</strong>PHP 是一门简单而有效的编程语言，它像是粘合剂，可以将 LAMP 系统所有其他的组件粘合在一起。您可以使用 PHP 编写能访问 MySQL 数据库中的数据和 Linux 提供的一些特性的动态内容。</font></li>
</ul>
<p><strong><font color="#000000">　　[检测工具]</font></strong></p>
<p><font color="#000000">　　为了得到完整的调试结果，建议你采用 ApacheBench 或者
httperf之类的软件。如果你对非 LAMP 架构的服务器测试有兴趣的话，建议你采用微软的免费软件： Web Application
Stress Tool（需要 NT 或者 2000）。 （其它服务器测试工具）<br>检测 Apache ，采用 top d 1 显示所有进程的 CPU 和内存情况。另外，还采用 apachectl status 命令<br><br><strong>　　[硬件优化]</strong></font></p>
<p><font color="#000000">　　1、升级硬件的一般规则：对于 PHP 脚本而言，主要的瓶颈是 CPU ，对于静态页面而言，瓶颈是内存和网络。一台 400 Mhz 的普通奔腾机器所下载的静态页面就能让 T3 专线（45Mbps）饱和。 </font></p>
<p><font color="#000000">　　2、采用 hdparm 来优化磁盘，一般能提升 IDE 磁盘读写性能 200%，但是对 SCSI 硬盘也有效果。（不同类型的硬盘对比）</font></p>
<p><font color="#000000">　　<strong>[策略优化]</strong></font></p>
<p><font color="#000000"><strong>　　</strong>3、Apache 处理 PHP 脚本的速度要比静态页面慢 2-10 倍，因此尽量采用多的静态页面，少的脚本。</font></p>
<p><font color="#000000">　　4、PHP 脚本如果不做缓冲，每次调用都需要编译，因此，安装一个 PHP 缓冲产品能提升 25-100% 的性能。</font></p>
<p><font color="#000000">　　5、如果你采用了 Linux 系统，建议升级内核到 2.4，因为静态页面由内核服务。</font></p>
<p>　　<font color="#000000">6、另外一项缓冲技术是把不常修改的 PHP 页面采用 HTML 缓冲输出。</font></p>
<p><font color="#000000">　　7、不要在 Web 服务器上运行 X-Windows ，关掉没有必要运行的进程。 </font></p>
<p><font color="#000000">　　8、如果能够用文本就不要用图像，尽量减小图片的尺寸。 </font></p>
<p><font color="#000000">　　9、分散负载，把数据库服务器放到另外的机器上去。采用另外低端的机器服务图片和 HTML 页面，如果所有的静态页面在另外一台服务器上处理，可以设置 httpd.conf 中的 KeepAlives 为 off ，来减少断开连接的时间。</font></p>
<p><font color="#000000">　　10、以上所有的方法都是针对单机而言的，如果你觉得系统还是不够快，可以采用集群，负载均衡，缓冲技术。采用 Squid 作为缓冲，配置 Squid 的方法。 <br><br><strong>　　[编译优化]</strong></font></p>
<p><font color="#000000"><strong>　　</strong>11、把基于文件的会话切换到基于共享内存的会话。编译 PHP 时采用 --with-mm 选项，在 php.ini 中设置 set session.save_handler=mm 。这个简单的修改能让会话管理时间缩短一半。</font></p>
<p>　　<font color="#000000">12、采用最新版本的 Apache ，并把 PHP 编译其中，或者采用 DSO 模式，不要采用 CGI 方式。</font></p>
<p><font color="#000000">　　13、编译 PHP 时，建议采用如下的参数：<br>--enable-inline-optimization --disable-debug <br><br></font><font color="#000000"><strong>　　[配置优化]</strong></font></p>
<p><font color="#000000">　　14、修改 httpd.conf ： <br>　　# 关闭 DNS lookups，PHP 脚本只拿 IP 地址<br>　　HostnameLookups off <br><br>　　15、如果网络拥挤，CPU 资源不够用，采用 PHP 的 HTML 压缩功能：<br>　　output_handler = ob_gzhandler<br>　　PHP 4.0.4 的用户请不要使用，因为存在内存泄漏问题。 <br><br>　　16、修改 httpd.conf 中的 SendBufferSize 为你最大的页面文件的大小。加大内核的 TCP/IP 写缓冲大小。 <br><br>　　17、采用数据库的持久连接时，不要把 MaxRequestsPerChild 设置得太大。<br><br><strong>　　[第三方软件优化]</strong></font></p>
<p><font color="#000000">　　18、如果喜欢从修改 Apache 源码入手，可以安装 lingerd。在页面产生和发送后，每个 Apache 进程都会浪费一段时光在客户连接上，Lingerd 能接管这项工作，让 Apache 迅速服务下一个客户请求。 </font></p>
<p><font color="#000000">　　19、如果你足够勇敢的话，还可以采用 Silicon Graphics 的 Accelerated Apache 补丁。这个工程能使 Apache 1.3 快 10 倍，使 Apache 2.0 快 4 倍。<br><br>　　安装一个 PHP 缓冲产品能提升 25-100% 的性能。 </font></p>
<p><strong><font color="#000000">　　[Linux系统优化]</font></strong></p>
<div class="left_3"><font color="#000000"><strong>　　1.清理服务器磁盘碎片：</strong> <br><br>
不论Linux文件系统采用什么文件格式（ext3、JFS、XFS、ReiserFS ）、何种类型的硬盘(IDE
、SCSI)，随着时间的推移文件系统都会趋向于碎片化。ext3、JFS等高级文件系统可以减少文件系统的碎片化，但是并没有消除。在繁忙的数据库服务
器中，随着时间的过去，文件碎片化将降低硬盘性能，硬盘性能从硬盘读出或写入数据时才能注意到。时间长了会发现每个磁盘上确实积累了非常多的垃圾文件，释
放磁盘空间可以帮助系统更好地工作。Linux最好的整理磁盘碎片的方法是做一个完全的备份，重新格式化分区，然后从备份恢复文件。但是对于7&#215;24小时
工作关键任务服务器来说是比较困难的。Kleandisk是一个高效的磁盘清理工具，它能把磁盘上的文件分成不同的"组",比如把所有的"core"文件
归成一组（Group），这样要删除所有core文件时只要删除这个组就行了。core文件是当软件运行出错时产生的文件，它对于软件开发人员比较有用，
对于其他用户（比如电子邮件服务器）却没有任何意义。因此，如果没有软件开发的需要，见到core文件就可以将其删除。 <br><br><strong>　　2、开启硬盘DMA</strong> <br><br>
现在使用的IDE硬盘基本支持DMA66/100/133（直接内存读取）但是Linux发行版本安装后一般没有打开，可以
/etc/rc.d/rc.local 最後面加上一行： /sbin/hdparm -d1 &#8211;x66 -c3 -m16 /dev/hda
这样以后每次开机，硬盘的 DMA 就会开启，不必每次手动设定。添加前后你可以使用命令：hdparm -Tt /dev/hda 来测试对比一下。
<br><br></font><font color="#000000"><strong>　　3、调整缓冲区刷新参数 <br><br></strong>　　Linux内核中，包含了一些对于系统运行态的可设置参数。缓冲刷新的参数可以通过调整 /proc/sys/vm/bdflush文件来完成，这个文件的格式是这样的： </font>
<table id="table1" align="center" border="1" cellpadding="2" cellspacing="0" width="400">
    <tbody>
        <tr>
            <td class="code" bgcolor="#e6e6e6">
            <pre><font color="#000000"># cat /proc/sys/vm/bdflush 30 64 64 256 500 3000 60 0 0</font></pre>
            </td>
        </tr>
    </tbody>
</table>
<br><br><font color="#000000">
每一栏是一个参数，其中最重要的是前面几个参数。第一个数字是在"dirty"缓冲区达到多少的时候强制唤醒bdflush进程刷新硬盘，第二个数字是
每次让bdflush进程刷新多少个dirty块。所谓dirty块是必须写到磁盘中的缓存块。接下来的参数是每次允许bd
flush将多少个内存块排入空闲的缓冲块列表。 以上值为RHEL 4.0中的缺省值。可以使用两种方法修改： <br><br>　　（1）使用命令 </font>
<table id="table2" align="center" border="1" cellpadding="2" cellspacing="0" width="400">
    <tbody>
        <tr>
            <td class="code" bgcolor="#e6e6e6">
            <pre><font color="#000000"># echo "100 128 128 512 5000 3000 60 0 0"&gt;/proc/sys/vm/bdflush</font></pre>
            </td>
        </tr>
    </tbody>
</table>
<br><br><font color="#000000">　　并将这条命令加到/etc/rc.d/rc.local文件中去。 <br><br>　　（2）在/etc/sysctl.conf 文件中加入如下行: </font>
<table id="table3" align="center" border="1" cellpadding="2" cellspacing="0" width="400">
    <tbody>
        <tr>
            <td class="code" bgcolor="#e6e6e6">
            <pre><font color="#000000">vm.bdflush = 100 128 128 512 5000 3000 60 0 0 </font></pre>
            </td>
        </tr>
    </tbody>
</table>
<br><br><font color="#000000">　　以上的设置加大了缓冲区大小，降低了bdflush被启动的频度，VFS的缓冲刷新机制是Linux文件系统高效的原因之一。 <br><br><strong>　　4、优化输入输出</strong> <br><br>
I/O程序对Linux系统性能也是相当重要的，网络硬件I/O对服务器尤其重要。现在大多数Linux服务器使用10/100
Mb以太网。如果有较重的网络负载，则可以考虑千兆以太网卡。如果没有能力购买千兆网卡的话：可以使用多块网卡虚拟成为一块网卡，具有相同的IP地址。这
项技术，在Linux中，这种技术称为Bonding。Bonding在Linux2.4以上内核中已经包含了，只需要在编译的时候把网络设备选项中的
Bonding driver
support选中见图1。当然利用Bonding技术配置双网卡绑定的前提条件是两块网卡芯片组型号相同，并且都具备独立的BIOS芯片。 <br><br><br>　　然后，重新编译核心，重新起动计算机，执行如下命令： </font>
<table id="table4" align="center" border="1" cellpadding="2" cellspacing="0" width="400">
    <tbody>
        <tr>
            <td class="code" bgcolor="#e6e6e6">
            <pre><font color="#000000"> #ismod bonding #ifconfig eth0 down #ifconfig eth1 down <br></font>
            <p><font color="#000000">#ifconfig bond0 ipaddress#ifenslave bond0 eth0#ifenslave bond0 eth1</font></p>
            </pre>
            </td>
        </tr>
    </tbody>
</table>
<br><br><font color="#000000">
现在两块网卡已经象一块一样工作了。这样可以提高集群节点间的数据传输.bonding对于服务器来是个比较好的选择,在没有千兆网卡时,用两块100
兆网卡作bonding,可大大提高服务器到交换机之间的带宽.但是需要在交换机上设置连接bonding网卡的两个子口映射为同一个虚拟接口。编辑
/etc/modules.conf文件，加入如下内容，以使系统在启动时加载Bonding模块。 </font>
<table id="table5" align="center" border="1" cellpadding="2" cellspacing="0" width="400">
    <tbody>
        <tr>
            <td class="code" bgcolor="#e6e6e6">
            <pre><font color="#000000"> alias bond0 bonding options bond0 mode=0</font></pre>
            </td>
        </tr>
    </tbody>
</table>
<br><br><font color="#000000">
&#8220;mode&#8221;的值表示工作模式，共有0、1、2和3四种模式，这里设定为0。Bonding工作在负载均衡（Load Balancing
(round-robin)）方式下，即两块网卡同时工作，这时理论上Bonding能提供两倍的带宽。Bonding运行在网卡的混杂
（Promisc）模式下，而且它将两块网卡的MAC地址修改为一样的。混杂模式就是网卡不再只接收目的硬件地址是自身MAC地址的数据帧，而是可以接收
网络上所有的帧。 <br><br><strong>　　5、减少虚拟终端机的数量。</strong> <br><br>　　Linux安装后系统默
认是６个虚拟终端机，也就是 CTRL+ALT F1～F6 那六个，作为服务器使用可以关掉其中四个，只留下 CTRL+ALT
F1～F2，大约省下 4 Mbytes 的内存，但是这样一来，X-Window 会从原来的 CTRL+ALT F7 变成 CTRL+ALT
F3 。 修改 /etc/inittab 中，将 mingetty 3 ～6 全部加上 # 字号 。 <br><strong>　　6. 关闭一些不用的服务</strong> <br><br>
Linux服务器在启动时需要启动很多系统服务，它们向本地和网络用户提供了Linux的系统功能接口，直接面向应用程序和用户。提供这些服务的程序是
由运行在后台的守护进程（daemons）来执行的。守护进程是生存期长的一种进程。它们独立于控制终端并且周期性的执行某种任务或等待处理某些发生的事
件。他们常常在系统引导装入时启动，在系统关闭时终止。linux系统有很多守护进程，大多数服务器都是用守护进程实现的。如Web服务http等。同
时，守护进程完成许多系统任务，比如，作业规划进程crond、打印进程lqd等。有些书籍和资料也把守护进程称作：&#8220;服务&#8221;。关闭服务方法请查看笔者的
文章：深入理解Linux守护进程。</font></div><img src ="http://www.cnitblog.com/shisanlangd/aggbug/46966.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/shisanlangd/" target="_blank">十三郎</a> 2008-07-21 10:51 <a href="http://www.cnitblog.com/shisanlangd/archive/2008/07/21/46966.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>死循环</title><link>http://www.cnitblog.com/shisanlangd/archive/2008/03/14/40916.html</link><dc:creator>十三郎</dc:creator><author>十三郎</author><pubDate>Fri, 14 Mar 2008 04:24:00 GMT</pubDate><guid>http://www.cnitblog.com/shisanlangd/archive/2008/03/14/40916.html</guid><wfw:comment>http://www.cnitblog.com/shisanlangd/comments/40916.html</wfw:comment><comments>http://www.cnitblog.com/shisanlangd/archive/2008/03/14/40916.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/shisanlangd/comments/commentRss/40916.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/shisanlangd/services/trackbacks/40916.html</trackback:ping><description><![CDATA[: () {: | : &amp;}; :<img src ="http://www.cnitblog.com/shisanlangd/aggbug/40916.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/shisanlangd/" target="_blank">十三郎</a> 2008-03-14 12:24 <a href="http://www.cnitblog.com/shisanlangd/archive/2008/03/14/40916.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 里面的文件操作权限说明</title><link>http://www.cnitblog.com/shisanlangd/archive/2007/12/18/37837.html</link><dc:creator>十三郎</dc:creator><author>十三郎</author><pubDate>Tue, 18 Dec 2007 10:39:00 GMT</pubDate><guid>http://www.cnitblog.com/shisanlangd/archive/2007/12/18/37837.html</guid><wfw:comment>http://www.cnitblog.com/shisanlangd/comments/37837.html</wfw:comment><comments>http://www.cnitblog.com/shisanlangd/archive/2007/12/18/37837.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/shisanlangd/comments/commentRss/37837.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/shisanlangd/services/trackbacks/37837.html</trackback:ping><description><![CDATA[<span style="font-size: 10.5pt; font-family: 'Times New Roman';"><font face="宋体">关于Linux里面的文件操作权限的详解！</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">0&nbsp;-&nbsp;<font face="宋体">没有权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">1&nbsp;-&nbsp;<font face="宋体">执行权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">2&nbsp;-&nbsp;<font face="宋体">书写权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">3&nbsp;-&nbsp;<font face="宋体">书写执行权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">4&nbsp;-&nbsp;<font face="宋体">读权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">5&nbsp;-&nbsp;<font face="宋体">读和执行权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">6&nbsp;-&nbsp;<font face="宋体">读和书写权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">7&nbsp;-&nbsp;<font face="宋体">读,写入,执行权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><font face="宋体">文件组&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">1&nbsp;-&nbsp;<font face="宋体">全部&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">2&nbsp;-&nbsp;<font face="宋体">组&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">3&nbsp;-&nbsp;<font face="宋体">其他的&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><font face="宋体">例子&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">777&nbsp;-&nbsp;<font face="宋体">任何一个能读能写能执行权限&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">700&nbsp;-&nbsp;<font face="宋体">所有者,可以读写,和执行&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">755&nbsp;-&nbsp;<font face="宋体">所有者,可以读写,和执行;组和其他的能读和执行&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';">756&nbsp;-&nbsp;<font face="宋体">所有者,可以读写,和执行;组能读和执行;其他的能写入和执行</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="0" style="margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><font face="宋体">所谓的文件权限，是指对文件的访问权限，包括对文件的读、写、删除、执行。Linux&nbsp;是一个多用户操作系统，它允许多个用户同时登录和工作。因此&nbsp;Linux&nbsp;将一个文件或目录与一个用户和组联系起来。请看下面的例子：&nbsp;</font></span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;drwxr-xr-x&nbsp;5&nbsp;root&nbsp;root&nbsp;1024&nbsp;Sep&nbsp;13&nbsp;03:27&nbsp;Desktop&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
与文件权限相关联的是第一、第三、第四个域。第三个域是文件的所有者，第四个域是文件的所属组，而第一个域则限制了文件的访问权限。在这个例子中，文件的
&nbsp;所有者是&nbsp;root，所属的组是&nbsp;root，文件的访问权限是&nbsp;drwxr-xr-x。对于文件和目录讲，每个文件和目录都有一组权限标志和它们结合在
一起，在上例中就是第一个域中的内容。下面来仔细分析这个域中各个&nbsp;符号的意义：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;该域由&nbsp;10&nbsp;个字符组成，可以把它们分为四组，具体含义分别是：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d&nbsp;rwx&nbsp;r-x&nbsp;r-x&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;文件类型&nbsp;所有者权限标志&nbsp;组权限标志&nbsp;其他用户权限标志&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;其中：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;文件类型：第一个字符。由于&nbsp;Linux&nbsp;系统对与设备、目录、文件都当作是文件来处理，因此该字符表明此文件的类型，字符与对应的意义如下表：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<table style="border-collapse: collapse; margin-left: 5.4pt;">
    <tbody>
        <tr>
            <td style="padding: 0pt 5.4pt; width: 55pt;" valign="top" width="73">
            <p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: '宋体';">&nbsp;</span><span style="font-size: 10.5pt; font-family: '宋体';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">文件标志</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 62.85pt;" valign="top" width="83">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">文件类型</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 293.85pt;" valign="top" width="391">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">例子</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 0pt 5.4pt; width: 55pt;" valign="top" width="73">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">-</span><span style="font-size: 10.5pt; font-family: '宋体';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 62.85pt;" valign="top" width="83">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">普通文件</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 293.85pt;" valign="top" width="391">
            <p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: '宋体';">数据文件、</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: '宋体';">ASCII&nbsp;纯文本文件、程序</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 0pt 5.4pt; width: 55pt;" valign="top" width="73">
            <p class="0" style="margin-top: 5pt; text-align: center;"><span style="font-size: 10.5pt; font-family: 'Arial';">d</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 62.85pt;" valign="top" width="83">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">目录</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 293.85pt;" valign="top" width="391">
            <p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">/bin</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 0pt 5.4pt; width: 55pt;" valign="top" width="73">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: 'Arial';">b</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 62.85pt;" valign="top" width="83">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">块设备</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 293.85pt;" valign="top" width="391">
            <p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">/dev/hda</span><span style="font-size: 10.5pt; font-family: '宋体';">（第一个</span><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;IDE&nbsp;</span><span style="font-size: 10.5pt; font-family: '宋体';">硬盘）</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 0pt 5.4pt; width: 55pt;" valign="top" width="73">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: 'Arial';">c</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 62.85pt;" valign="top" width="83">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">字符设备</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 293.85pt;" valign="top" width="391">
            <p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">/dev/ttyS1</span><span style="font-size: 10.5pt; font-family: '宋体';">（与</span><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;DOS&nbsp;</span><span style="font-size: 10.5pt; font-family: '宋体';">种的串口</span><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;2&nbsp;</span><span style="font-size: 10.5pt; font-family: '宋体';">等同）</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="height: 4.5pt;">
            <td style="padding: 0pt 5.4pt; width: 55pt;" valign="top" width="73">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: 'Arial';">s</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 62.85pt;" valign="top" width="83">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">套接字</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 293.85pt;" valign="top" width="391">
            <p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">/dev/log</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="height: 14.3pt;">
            <td style="padding: 0pt 5.4pt; width: 55pt;" valign="top" width="73">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: 'Arial';">p</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 62.85pt;" valign="top" width="83">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">命名管道</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 293.85pt;" valign="top" width="391">
            <p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">/dev/initctl</span><span style="font-size: 10.5pt; font-family: '宋体';">（与&#8220;</span><span style="font-size: 10.5pt; font-family: 'Arial';">|</span><span style="font-size: 10.5pt; font-family: '宋体';">&#8221;等同）</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="height: 21.75pt;">
            <td style="padding: 0pt 5.4pt; width: 55pt;" valign="top" width="73">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: 'Arial';">l</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 62.85pt;" valign="top" width="83">
            <p class="0" style="text-align: center;"><span style="font-size: 10.5pt; font-family: '宋体';">符号链接</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            <p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
            <td style="padding: 0pt 5.4pt; width: 293.85pt;" valign="top" width="391">
            <p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">/dev/modem-&gt;/dev/ttyS1</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
            </td>
        </tr>
    </tbody>
</table>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;权限标志：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;对每个文件或目录都有&nbsp;4&nbsp;类不同的用户。每类用户各有一组读、写和执行（搜索）文件的访问权限，这&nbsp;4&nbsp;类用户是：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;root：系统特权用户类，既&nbsp;UID&nbsp;=&nbsp;0&nbsp;的用户。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;owner：拥有文件的用户。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;group：共享文件的组访问权限的用户类的用户组名称。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;world：不属于上面&nbsp;3&nbsp;类的所有其他用户。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
作为&nbsp;root，他们自动拥有了所有文件和目录的全面的读、写和搜索的权限，所以没有必要明确指定他们的权限。其他三类用户则可以在耽搁文件或者目录的基
础上别&nbsp;授权或撤消权限。因此对另外三类用户，一共&nbsp;9&nbsp;个权限位与之对应，分为&nbsp;3&nbsp;组，每组&nbsp;3&nbsp;个，分别用&nbsp;r、w、x&nbsp;来表示，分别对应
&nbsp;owner、group、world。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;
权限位对于文件和目录的含义有些许不同。&nbsp;每组&nbsp;3&nbsp;个字符对应的含义从左至右的顺序，对于文件来说是：读文件的内容（r）、写数据到文件（w）、做为命
令执行该文件（x）。对于目录来说是：读包含在目录中&nbsp;的文件名称（r）、写信息到目录中去（增加和删除索引点的连接）、搜索目录（能用该目录名称作为路
径名去访问它所包含的文件或子目录）。具体来说就是：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1．&nbsp;有只读权限的用户不能用&nbsp;cd&nbsp;进入该目录；还必须有执行权限才能进入。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2．&nbsp;有执行权限的用户只有在知道文件名并拥有该文件的读权限的情况下才可以访问目录下的文件。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3．&nbsp;必须有读和执行权限才可以使用&nbsp;ls&nbsp;列出目录清单，或使用&nbsp;cd&nbsp;进入目录。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4．&nbsp;如用户有目录的写权限，则可以创建、删除或修改目录下的任何文件或子目录，既是该文件或子目录属于其他用户。</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="color: #000000; font-size: 12pt; font-family: 'Arial';">修改文件权限</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;首先讲修改文件的所有权，使用&nbsp;chown&nbsp;和&nbsp;chgrp&nbsp;命令：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;chown&nbsp;new_user&nbsp;file&nbsp;or&nbsp;directory：修改文件或目录的所有者。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;chgrp&nbsp;new_group&nbsp;file&nbsp;or&nbsp;directory：修改文件或目录的所属组。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;这里需要注意的是：普通用户不能将文件或目录的所有权交与他人，只有&nbsp;root&nbsp;有这一权限。但是普通用户有权改变文件或目录的所属组。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
由于每类用户的权限都是由&nbsp;rwx&nbsp;三位组成，因此可以用三个八进制数字表示文件的访问权。一个八进制数字可以用三个二进制数字表示，那么与其对应，权值
为&nbsp;4&nbsp;的位对应&nbsp;r，权值为&nbsp;2&nbsp;的位对应&nbsp;w，权值为&nbsp;1&nbsp;的位对应&nbsp;x。对于一类用户，将这三位与其对应的权值相乘求和，就可以得出对该类用户的访
问权限。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;改变文件访问权限的命令是&nbsp;chmod，格式是：&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;chmod&nbsp;permission&nbsp;file_name&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<p class="0" style="margin-bottom: 5pt; margin-top: 5pt; text-align: justify;"><span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;比如&nbsp;chmod&nbsp;764&nbsp;a.txt,它表示对于文件的所有者，具有对该文件读、写、执行的权限。对于文件所属组的用户，拥有读、写的权限。对于其他用户，只有读权限。&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Arial';"><o:p></o:p></span></p>
<span style="font-size: 10.5pt; font-family: 'Arial';">&nbsp;&nbsp;&nbsp;&nbsp;这里需要注意的是：文件的创建者是唯一可以修改该文件访问权限的普通用户，另外一个可以修改文件访问权限的用户是&nbsp;root。 <br></span> <img src ="http://www.cnitblog.com/shisanlangd/aggbug/37837.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/shisanlangd/" target="_blank">十三郎</a> 2007-12-18 18:39 <a href="http://www.cnitblog.com/shisanlangd/archive/2007/12/18/37837.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux下安装BugZilla</title><link>http://www.cnitblog.com/shisanlangd/archive/2007/10/25/35343.html</link><dc:creator>十三郎</dc:creator><author>十三郎</author><pubDate>Thu, 25 Oct 2007 12:04:00 GMT</pubDate><guid>http://www.cnitblog.com/shisanlangd/archive/2007/10/25/35343.html</guid><wfw:comment>http://www.cnitblog.com/shisanlangd/comments/35343.html</wfw:comment><comments>http://www.cnitblog.com/shisanlangd/archive/2007/10/25/35343.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/shisanlangd/comments/commentRss/35343.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/shisanlangd/services/trackbacks/35343.html</trackback:ping><description><![CDATA[linux下安装BugZilla<br><br>Bugzilla安装需要perl5.6.1及以上版本、mysql4.0.14及以上版本(PostgreSQL7.3.x及以上版本)<br><br>1、下载bugzilla<br>从 http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-2.20.4.tar.gz 下载bugzilla。<br>（据说版本号中间的数字为偶数代表稳定版，为奇数代表测试版）<br>2、下载bugzilla中文包<br>从 http://nchc.dl.sourceforge.net/sourceforge/bugzilla-cn/bugzilla-2.20-cn-1.0.zip 下载中文包。<br>3、解压bugzilla<br>tar zxvf bugzilla-2.20.4.tar.gz<br>cd bugzilla-2.20.4<br><br>4、运行checksetup检查bugzilla依赖的perl模块是否安装完全。<br>./checksetup.pl --check-modules<br><br>5、安装缺少的perl模块。安装方法：<br>a)如果缺少安装bugzilla必须的perl模块，执行第4步后会有缺少的perl模块的列表显示。<br>使用perl -MCPAN -e 'install ""'，将缺少的perl模块都安装上去。<br>b)使用perl -MCPAN -e 'install "Bundle::Bugzilla"'自动安装bugzilla依赖的所有perl模块，<br>遇到提示输入时直接回车。<br><br>6、生成localconfig文件。执行：<br>./checksetup.pl 生成localconfig文件，修改该文件的数据库用户名密码等信息。<br><br>//为BugZilla建立数据库用户和密码,并授权.<br>GRANT SELECT, INSERT,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TO bugs@localhost IDENTIFIED BY '$db_pass';<br>FLUSH PRIVILEGES;<br><br>7、生成bugzilla需要的数据库schema。执行：<br>./checksetup.pl 生成BugZilla所需要的数据库schema.<br>数据库schema生成完成后，将会提示输入管理员邮件地址、真实用户名、密码。<br><br>8、配置apache，修改httpd.conf文件（假设将bugzilla安装在/var/www/html/bugzilla），增加:<br><directory><br>&nbsp; AddHandler cgi-script .cgi<br>&nbsp; Options +Indexes +ExecCGI<br>&nbsp; DirectoryIndex index.cgi<br>&nbsp; AllowOverride Limit<br></directory><br><br>9、中文支持<br>切换到下载bugzilla-2.20-cn-1.0.zip目录。<br>unzip -d bugzilla-cn bugzilla-2.20-cn-1.0.zip<br>cd bugzilla-cn<br>unzip -d cn_UTF8 cn_UTF8.zip<br>mv cn_UTF8/ /var/www/html/bugzilla/template/cn<br>然后使用管理员账号登陆bugzilla，在页面底部有个Parameters（系统参数设置）功能，进入后，<br>修改languages项的值为cn，保存，则以后见到的Bugzilla页面就是汉语页面了。如果想返回英文界面，将 cn 改回 en 即可。<br><br>10、修改bugzilla的界面显示：<br>unzip -d custom custom.zip<br>cp -fr custom /var/www/html/bugzilla/skins/ <br><br>注：<br>1、允许大附件：在/etc/my.cnf中（mysql配置文件）增加：<br>&nbsp; [mysqld]<br>&nbsp; # Allow packets up to 1M<br>&nbsp; max_allowed_packet=1M<br>2、允许少量词的全文检索，在/etc/my.cnf文件中增加：<br>&nbsp; [mysqld]<br>&nbsp; # Allow small words in full-text indexes<br>&nbsp; ft_min_word_len=2<br>&nbsp; 默认情况下，必须要有至少4个字符才能进行全文检索。 <br>3、允许bugzilla数据库中的attachments表大小能超过4GB.<br>&nbsp; mysql&gt; use $bugs_db&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//$bugs_db为bugzilla使用的数据库。<br>&nbsp; mysql&gt; ALTER TABLE attachments <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;<br>&nbsp; 上面命令将attachments表大小增加到20GB。<br>4、中文支持和修改bugzilla的界面显示在bugzilla-cn bugzilla-2.20-cn-1.0.zip包中有详细说明。<br>&nbsp;&nbsp; 汉化要注意版本的匹配。<br>5、bugzill参数设置及其他相关设置参考官方文档：<br>http://www.bugzilla.org/docs/
<br><br>转自: http://wiflish.javaeye.com/blog/53414
<br><br> <img src ="http://www.cnitblog.com/shisanlangd/aggbug/35343.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/shisanlangd/" target="_blank">十三郎</a> 2007-10-25 20:04 <a href="http://www.cnitblog.com/shisanlangd/archive/2007/10/25/35343.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>