<?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>haohtml&#039;s blog &#187; Ubuntu</title>
	<atom:link href="http://blog.haohtml.com/index.php/tag/ubuntu/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.haohtml.com</link>
	<description>haohtml&#039;s life and works blog</description>
	<lastBuildDate>Sat, 31 Jul 2010 10:45:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>基于Ubuntu平台的nagios快速指南</title>
		<link>http://blog.haohtml.com/index.php/archives/4704</link>
		<comments>http://blog.haohtml.com/index.php/archives/4704#comments</comments>
		<pubDate>Mon, 19 Jul 2010 04:06:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[监控]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4704</guid>
		<description><![CDATA[4.6.1. 介绍 本指南试图让你通过简单的指令以在20分钟内在Ubuntu平台上通过对Nagios的源程序的安装来监控本地主机。没有讨论更高级的设置项－只是一些基本操作，但这足以使95%的用户启动Nagios。 这些指令在基于Ubuntu6.10(桌面版)的系统下写成的。 What You&#8217;ll End Up With 如果按照本指南安装，最后将是这样结果： Nagios和插件将安装到/usr/local/nagios Nagios将被配置为监控本地系统的几个主要服务(CPU负荷、磁盘利用率等) Nagios的Web接口是URL是http://localhost/nagios/ 4.6.2. 所需软件包 确认你安装好的系统上已经安装如下软件包再继续。 Apache2 GCC编译器与开发库 GD库与开发库 可以用apt-get命令来安装这些软件包，键入命令： sudo apt-get install apache2 sudo apt-get install build-essential sudo apt-get install libgd2-dev 4.6.3. 操作过程 1)建立一个帐号 切换为root用户 sudo -s 创建一个名为nagios的帐号并给定登录口令 /usr/sbin/useradd nagios passwd nagios 在Ubuntu服务器版(6.01或更高版本)，创建一个用户组名为nagios(默认是不创建的)。在Ubuntu桌面版上要跳过这一步。 /usr/sbin/groupadd nagios /usr/sbin/usermod -G nagios nagios 创建一个用户组名为nagcmd用于从Web接口执行外部命令。将nagios用户和apache用户都加到这个组中。 /usr/sbin/groupadd nagcmd /usr/sbin/usermod -G nagcmd nagios /usr/sbin/usermod [...]]]></description>
			<content:encoded><![CDATA[<div lang="zh-CN">
<div>
<div>
<div>
<h3>4.6.1. 介绍</h3>
</div>
</div>
</div>
<p>本指南试图让你通过简单的指令以在20分钟内在Ubuntu平台上通过对Nagios的源程序的安装来监控本地主机。没有讨论更高级的设置项－只是一些基本操作，但这足以使95%的用户启动Nagios。</p>
<p>这些指令在基于Ubuntu6.10(桌面版)的系统下写成的。</p>
<p><strong>What You&#8217;ll End Up With</strong></p>
<p>如果按照本指南安装，最后将是这样结果：</p>
<div>
<ol type="1">
<li>Nagios和插件将安装到/usr/local/nagios</li>
<li>Nagios将被配置为监控本地系统的几个主要服务(CPU负荷、磁盘利用率等)</li>
<li>Nagios的Web接口是URL是http://localhost/nagios/</li>
</ol>
</div>
</div>
<div lang="zh-CN">
<div>
<div>
<div>
<h3><a name="d0e1588"></a>4.6.2. 所需软件包</h3>
</div>
</div>
</div>
<p>确认你安装好的系统上已经安装如下软件包再继续。</p>
<div>
<ol type="1">
<li>Apache2</li>
<li>GCC编译器与开发库</li>
<li>GD库与开发库</li>
</ol>
</div>
<p><span id="more-4704"></span>可以用<strong>apt-get</strong>命令来安装这些软件包，键入命令：</p>
<pre>
sudo apt-get install apache2
sudo apt-get install build-essential
sudo apt-get install libgd2-dev
</pre>
</div>
<div lang="zh-CN">
<div>
<div>
<div>
<h3><a name="d0e1608"></a>4.6.3. 操作过程</h3>
</div>
</div>
</div>
<p><strong>1)建立一个帐号</strong></p>
<p>切换为root用户</p>
<pre>
sudo -s
</pre>
<p>创建一个名为<strong>nagios</strong>的帐号并给定登录口令</p>
<pre>
/usr/sbin/useradd nagios
passwd nagios
</pre>
<p>在Ubuntu服务器版(6.01或更高版本)，创建一个用户组名为<strong>nagios</strong>(默认是不创建的)。在Ubuntu桌面版上要跳过这一步。</p>
<pre>
/usr/sbin/groupadd nagios
/usr/sbin/usermod -G nagios nagios
</pre>
<p>创建一个用户组名为<strong>nagcmd</strong>用于从Web接口执行外部命令。将nagios用户和apache用户都加到这个组中。</p>
<pre>
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data
</pre>
<p><strong>2)下载Nagios和插件程序包</strong></p>
<p>建立一个目录用以存储下载文件</p>
<pre>
mkdir ~/downloads
cd ~/downloads
</pre>
<p>下载Nagios和Nagios插件的软件包（访问<a href="http://www.nagios.org/download/" target="_top">http://www.nagios.org/download/</a>站点以获得最新版本），在写本文档时，最新的Nagios的软件版本是3.0rc1，Nagios插件的版本是1.4.11。</p>
<pre>
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0rc1.tar.gz
wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
</pre>
<p><strong>3)编译与安装Nagios</strong></p>
<p>展开Nagios源程序包</p>
<pre>
cd ~/downloads
tar xzf nagios-3.0rc1.tar.gz
cd nagios-3.0rc1
</pre>
<p>运行Nagios配置脚本并使用先前开设的用户及用户组：</p>
<pre>
./configure --with-command-group=nagcmd
</pre>
<p>编译Nagios程序包源码</p>
<pre>
make all
</pre>
<p>安装二进制运行程序、初始化脚本、配置文件样本并设置运行目录权限</p>
<pre>
make install
make install-init
make install-config
make install-commandmode
</pre>
<p>现在还不能启动Nagios－还有一些要做的&#8230;</p>
<p><strong>4)客户化配置</strong></p>
<p>样例<a title="5.1. 配置概览" href="http://nagios-cn.sourceforge.net/nagios-cn/configuration.html#config">配置文件</a>默认安装在这个目录下<strong>/usr/local/nagios/etc</strong>，这些样例文件可以配置Nagios使之正常运行，只需要做一个简单的修改&#8230;</p>
<p>用你擅长的编辑器软件来编辑这个<strong>/usr/local/nagios/etc/objects/contacts.cfg</strong>配置文件，更改email地址<strong>nagiosadmin</strong>的联系人定义信息中的EMail信息为你的EMail信息以接收报警内容。</p>
<pre>vi /usr/local/nagios/etc/objects/contacts.cfg</pre>
<p><strong>5)配置WEB接口</strong></p>
<p>安装Nagios的WEB配置文件到Apache的conf.d目录下</p>
<pre>
make install-webconf
</pre>
<p>创建一个<strong>nagiosadmin</strong>的用户用于Nagios的WEB接口登录。记下你所设置的登录口令，一会儿你会用到它。</p>
<pre>
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
</pre>
<p>重启Apache服务以使设置生效。</p>
<pre>
/etc/init.d/apache2 reload
</pre>
<p><strong>6)编译并安装Nagios插件</strong></p>
<p>展开Nagios插件的源程序包</p>
<pre>
cd ~/downloads
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
</pre>
<p>编译并安装插件</p>
<pre>
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
</pre>
<p><strong>7)启动Nagios</strong></p>
<p>把Nagios加入到服务列表中以使之在系统启动时自动启动</p>
<pre>
ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
</pre>
<p>验证Nagios的样例配置文件</p>
<pre>
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
</pre>
<p>如果没有报错，可以启动Nagios服务</p>
<pre>
/etc/init.d/nagios start
</pre>
<p><strong>8)登录WEB接口</strong></p>
<p>你现在可以从WEB方式来接入Nagios的WEB接口了，你需要在提示下输入你的用户名(<strong>nagiosadmin</strong>)和口令，你刚刚设置的，这里用系统默认安装的浏览器，用下面这个超链接</p>
<pre>

http://localhost/nagios/
</pre>
<p>点击“服务详情”的引导超链来查看你本机的监视详情。你可能需要给点时间让Nagios来检测你机器上所依赖的服务因为检测需要些时间。</p>
<p><strong>9)其他的变更</strong></p>
<p>如果要接收Nagios的EMail警报，需要安装(Postfix)包</p>
<pre>
sudo apt-get install mailx
</pre>
<p>需要编辑Nagios里的EMail通知送出命令，它位于<strong>/usr/local/nagios/etc/commands.cfg</strong>文件中，将里面的&#8217;/bin/mail&#8217;全部替换为&#8217;/usr/bin/mail&#8217;。一旦设置好需要重启动Nagios以使配置生效。</p>
<pre>
sudo /etc/init.d/nagios restart
</pre>
<p>配置EMail的报警项超出了本文档的内容，指向你的系统档案用网页查找或是到这个站点<a href="http://www.nagioscommunity.org/wiki" target="_top">NagiosCommunity.org wiki</a>来查找更进一步的信息，以使Ubuntu系统上可以向外部地址发送EMail信息。</p>
<p>摘自:http://nagios-cn.sourceforge.net/nagios-cn/beginning.html</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4704/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>虚拟机ubuntu9.04下mysql集群的配置方法</title>
		<link>http://blog.haohtml.com/index.php/archives/4551</link>
		<comments>http://blog.haohtml.com/index.php/archives/4551#comments</comments>
		<pubDate>Fri, 09 Jul 2010 04:22:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[设计重构]]></category>
		<category><![CDATA[集群]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql集群]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4551</guid>
		<description><![CDATA[介绍网络环境： 一、测试环境： Server1: ndbd 192.168.245.11 Server2: ndbd 192.168.245.12 Server3: mysqld –ndb-cluster 192.168.245.13 ndbd： 数据库节点。 mysqld –ndb-cluster： MySQL服务器节点，程序直接访问的是这台机器的IP。默认端口仍是3306。 ndbd_mgm ndbd_mgmd：管理节点。管理／查看各库节点和服务器节点的状态。 二、集群方案 1.管理节点:server3(192.168.245.13) 2.存储节点:server1(192.168.245.11),server2(192.168.245.12) 3.SQL节点:server1(192.168.245.11),server2(192.168.245.12),server3(192.168.245.13) 三、mysql安装和配置 1.安装，sudo apt-get install mysql-server 2.配置这三台服务器上配置my.cnf，这三台服务器都要配置 vim /etc/mysql/my.cnf —————————————–my.cnf开始——————————————– ubuntu@ubuntu:~$ cat /etc/mysql/my.cnf # # The MySQL database server configuration file. # # You can copy this to one of: # &#8211; “/etc/mysql/my.cnf” [...]]]></description>
			<content:encoded><![CDATA[<p><strong>介绍网络环境：</strong></p>
<p>一、测试环境：<br />
Server1: ndbd 192.168.245.11<br />
Server2: ndbd 192.168.245.12<br />
Server3: mysqld –ndb-cluster 192.168.245.13<br />
ndbd： 数据库节点。<br />
mysqld –ndb-cluster： MySQL服务器节点，程序直接访问的是这台机器的IP。默认端口仍是3306。<br />
ndbd_mgm ndbd_mgmd：管理节点。管理／查看各库节点和服务器节点的状态。</p>
<p>二、集群方案<br />
1.管理节点:server3(192.168.245.13)<br />
2.存储节点:server1(192.168.245.11),server2(192.168.245.12)<br />
3.SQL节点:server1(192.168.245.11),server2(192.168.245.12),server3(192.168.245.13)<br />
<span id="more-4551"></span><br />
三、mysql安装和配置</p>
<p>1.安装，sudo apt-get install mysql-server</p>
<p>2.配置这三台服务器上配置my.cnf，这三台服务器都要配置<br />
vim /etc/mysql/my.cnf<br />
—————————————–my.cnf开始——————————————–<br />
ubuntu@ubuntu:~$ cat /etc/mysql/my.cnf<br />
#<br />
# The MySQL database server configuration file.<br />
#<br />
# You can copy this to one of:<br />
# &#8211; “/etc/mysql/my.cnf” to set global options,<br />
# &#8211; “~/.my.cnf” to set user-specific options.<br />
#<br />
# One can use all long options that the program supports.<br />
# Run program with –help to get a list of available options and with<br />
# –print-defaults to see which it would actually understand and use.<br />
#<br />
# For explanations see<br />
# <a href="http://dev.mysql.com/doc/mysql/en/server-system-variables.html">http://dev.mysql.com/doc/mysql/en/serve &#8230; ables.html</a></p>
<p># This will be passed to all mysql clients<br />
# It has been reported that passwords should be enclosed with ticks/quotes<br />
# escpecially if they contain “#” chars…<br />
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.<br />
[client]<br />
port = 3306<br />
socket = /var/run/mysqld/mysqld.sock</p>
<p># Here is entries for some specific programs<br />
# The following values assume you have at least 32M ram</p>
<p># This was formally known as [safe_mysqld]. Both versions are currently parsed.<br />
[mysqld_safe]<br />
socket = /var/run/mysqld/mysqld.sock<br />
nice = 0</p>
<p>[mysqld]<br />
#<br />
# * Basic Settings<br />
#</p>
<p>#<br />
# * IMPORTANT<br />
# If you make changes to these settings and your system uses apparmor, you may<br />
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.<br />
#</p>
<p>user = mysql<br />
pid-file = /var/run/mysqld/mysqld.pid<br />
socket = /var/run/mysqld/mysqld.sock<br />
port = 3306<br />
basedir = /usr<br />
datadir = /var/lib/mysql<br />
tmpdir = /tmp<br />
language = /usr/share/mysql/english<br />
skip-external-locking<br />
#<br />
# Instead of skip-networking the default is now to listen only on<br />
# localhost which is more compatible and is not less secure.<br />
# bind-address = 127.0.0.1<br />
#<br />
# * Fine Tuning<br />
#<br />
key_buffer = 16M<br />
max_allowed_packet = 16M<br />
thread_stack = 128K<br />
thread_cache_size = 8<br />
#max_connections = 100<br />
#table_cache = 64<br />
#thread_concurrency = 10<br />
#<br />
# * Query Cache Configuration<br />
#<br />
query_cache_limit = 1M<br />
query_cache_size = 16M<br />
#<br />
# * Logging and Replication<br />
#<br />
# Both location gets rotated by the cronjob.<br />
# Be aware that this log type is a performance killer.<br />
#log = /var/log/mysql/mysql.log<br />
#<br />
# Error logging goes to syslog. This is a Debian improvement <img title="{L_SMILIES_SMILE}" src="http://forum.ubuntu.org.cn/images/smilies/icon_e_smile.gif" alt=":)" /><br />
#<br />
# Here you can see queries with especially long duration<br />
#log_slow_queries = /var/log/mysql/mysql-slow.log<br />
#long_query_time = 2<br />
#log-queries-not-using-indexes<br />
#<br />
# The following can be used as easy to replay backup logs or for replication.<br />
# note: if you are setting up a replication slave, see README.Debian about<br />
# other settings you may need to change.<br />
#server-id = 1<br />
#log_bin = /var/log/mysql/mysql-bin.log<br />
expire_logs_days = 10<br />
max_binlog_size = 100M<br />
#binlog_do_db = include_database_name<br />
#binlog_ignore_db = include_database_name<br />
#<br />
# * BerkeleyDB<br />
#<br />
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.<br />
skip-bdb<br />
#<br />
# * MyISAM<br />
#<br />
# MyISAM is enabled by default with a 10MB datafile in /var/lib/mysql/.<br />
# Read the manual for more MyISAM related options. There are many!<br />
# You might want to disable MyISAM to shrink the mysqld process by circa 100MB.<br />
#skip-innodb<br />
#<br />
# * Security Features<br />
#<br />
# Read the manual, too, if you want chroot!<br />
# chroot = /var/lib/mysql/<br />
#<br />
# For generating SSL certificates I recommend the OpenSSL GUI “tinyca”.<br />
#<br />
# ssl-ca=/etc/mysql/cacert.pem<br />
# ssl-cert=/etc/mysql/server-cert.pem<br />
# ssl-key=/etc/mysql/server-key.pem</p>
<p>ndbcluster<br />
ndb-connectstring=192.168.245.13</p>
<p>[mysqldump]<br />
quick<br />
quote-names<br />
max_allowed_packet = 16M</p>
<p>[mysql]<br />
#no-auto-rehash # faster start of mysql but no tab completition</p>
<p>[isamchk]<br />
key_buffer = 16M</p>
<p>#<br />
# * NDB Cluster<br />
#<br />
# See /usr/share/doc/mysql-server-*/README.Debian for more information.<br />
#<br />
# The following configuration is read by the NDB Data Nodes (ndbd processes)<br />
# not from the NDB Management Nodes (ndb_mgmd processes).<br />
#<br />
[MYSQL_CLUSTER]</p>
<p>ndb-connectstring=192.168.245.13</p>
<p>#<br />
# * IMPORTANT: Additional settings that can override those from this file!<br />
# The files must end with ‘.cnf’, otherwise they’ll be ignored.<br />
#<br />
!includedir /etc/mysql/conf.d/</p>
<p>ubuntu@ubuntu:~$<br />
———————————my.cnf结束———————————————————</p>
<p>主要在：[mysqld]下添加：</p>
<p>ndbcluster<br />
ndb-connectstring=192.168.245.13<br />
和添加<br />
[MYSQL_CLUSTER]</p>
<p>ndb-connectstring=192.168.245.13</p>
<p>上面三台服务器都要一样</p>
<p>2.配置ndb_mgmd.cnf（192.168.245.13服务器上配置）<br />
复制/usr/share/doc/mysql-server-5.0/examples/ndb_mgmd.cnf到/etc/mysql/ndb_mgmd.cnf</p>
<p>编辑ndb_mgmd.cnf<br />
——————-开始————</p>
<p>ubuntu@ubuntu:~$ cat /etc/mysql/ndb_mgmd.cnf<br />
[NDBD DEFAULT]<br />
NoOfReplicas=2<br />
DataMemory=10MB<br />
IndexMemory=25MB<br />
MaxNoOfTables=256<br />
MaxNoOfOrderedIndexes=256<br />
MaxNoOfUniqueHashIndexes=128</p>
<p>[MYSQLD DEFAULT]</p>
<p>[NDB_MGMD DEFAULT]</p>
<p>[TCP DEFAULT]</p>
<p>[NDB_MGMD]<br />
Id=1 # the NDB Management Node (this one)<br />
HostName=192.168.245.13<br />
DataDir= /var/lib/mysql-cluster</p>
<p>[NDBD]<br />
Id=2 # the first NDB Data Node<br />
HostName=192.168.245.11<br />
DataDir= /var/lib/mysql-cluster</p>
<p>[NDBD]<br />
Id=3 # the second NDB Data Node<br />
HostName=192.168.245.12<br />
DataDir=/var/lib/mysql-cluster</p>
<p>[MYSQLD]<br />
Id=4 # the first SQL node<br />
HostName=192.168.245.13<br />
[MYSQLD]<br />
Id=5 # the first SQL node<br />
HostName=192.168.245.11<br />
[MYSQLD]<br />
Id=6 # the first SQL node<br />
HostName=192.168.245.12</p>
<p>ubuntu@ubuntu:~$</p>
<p>——————-结束————</p>
<p>先启动：<br />
13服务器：</p>
<p>sudo /etc/init.d/mysql-ndb-mgm start</p>
<p>然后启动<br />
11.12服务器</p>
<p>sudo /etc/init.d/mysql-ndb start</p>
<p>最后启动，13.11.12服务器mysql服务<br />
sudo /etc/init.d/mysql start</p>
<p>测试：<br />
13服务器上：<br />
neo@mgm:~$ ndb_mgm<br />
– NDB Cluster — Management Client –<br />
ndb_mgm&gt; show<br />
Connected to Management Server at: localhost:1186<br />
Cluster Configuration<br />
———————<br />
[ndbd(NDB)] 2 node(s)<br />
id=2 @192.168.245.11 (Version: 5.0.51, Nodegroup: 0)<br />
id=3 @192.168.245.12 (Version: 5.0.51, Nodegroup: 0, Master)</p>
<p>[ndb_mgmd(MGM)] 1 node(s)<br />
id=1 @192.168.245.13 (Version: 5.0.51)</p>
<p>[mysqld(API)] 2 node(s)<br />
id=4 @192.168.245.13 (Version: 5.0.51)<br />
id=5 @192.168.245.11 (Version: 5.0.51)<br />
id=5 @192.168.245.12 (Version: 5.0.51)</p>
<p>ndb_mgm&gt;</p>
<p>与没有使用簇的MySQL相比，在MySQL簇内操作数据的方式没有太大的区别。</p>
<p>执行这类操作时应记住三点</p>
<p>1.</p>
<p>表必须用ENGINE=NDB或ENGINE=NDBCLUSTER选项创建，或用ALTER TABLE选项更改，以使用NDB Cluster存储引擎在 Cluster内复制它们。如果使用mysqldump的输出从已有数据库导</p>
<p>入表，可在文本编辑器中打开SQL脚本，并将该选项添加到任何表创建语句，或用这类选项之一替换任何已有的ENGINE（或TYPE）选项。<br />
2.</p>
<p>另外还请记住，每个NDB表必须有一个主键。如果在创建表时用户未定义主键，NDB Cluster存储引擎将自动生成隐含的主键。（注释：该隐含 键也将占用空间，就像任何其他的表</p>
<p>索引一样。由于没有足够的内存来容纳这些自动创建的键，出现问题并不罕见）。<br />
3.</p>
<p>当你在一个节点上运行create database mydb;你去其他sql node上执行show databases;将不能看到mydb,你需要创建它，然后use mydb; show tables;你将看到同步的表。</p>
<p>SQL Node 1</p>
<p>neo@sql:~$ mysql -uroot -p<br />
Enter password:<br />
Welcome to the MySQL monitor. Commands end with ; or g.<br />
Your MySQL connection id is 7<br />
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)</p>
<p>Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.</p>
<p>mysql&gt; create database cluster;<br />
Query OK, 1 row affected (0.00 sec)</p>
<p>mysql&gt; use cluster<br />
Database changed<br />
mysql&gt; create table city( id mediumint unsigned not null auto_increment primary key, name varchar(20) not null default ” ) engine = ndbcluster default</p>
<p>charset utf8;<br />
Query OK, 0 rows affected (1.07 sec)</p>
<p>mysql&gt; insert into city values(1, ‘Shenzhen’);<br />
Query OK, 1 row affected (0.12 sec)</p>
<p>mysql&gt; insert into city values(2, ‘Guangdong’);<br />
Query OK, 1 row affected (0.00 sec)</p>
<p>SQL Node 2</p>
<p>neo@sql:~$ mysql -uroot -p<br />
Enter password:<br />
Welcome to the MySQL monitor. Commands end with ; or g.<br />
Your MySQL connection id is 7<br />
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)</p>
<p>Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.</p>
<p>mysql&gt; show databases;<br />
+——————–+<br />
| Database |<br />
+——————–+<br />
| information_schema |<br />
| example |<br />
| mydb |<br />
| mysql |<br />
| neo |<br />
+——————–+<br />
6 rows in set (0.13 sec)</p>
<p>mysql&gt; create database cluster;<br />
Query OK, 1 row affected (0.00 sec)</p>
<p>mysql&gt; show databases;<br />
+——————–+<br />
| Database |<br />
+——————–+<br />
| information_schema |<br />
| cluster |<br />
| example |<br />
| mydb |<br />
| mysql |<br />
| neo |<br />
+——————–+<br />
6 rows in set (0.13 sec)</p>
<p>mysql&gt; use cluster;<br />
Reading table information for completion of table and column names<br />
You can turn off this feature to get a quicker startup with -A</p>
<p>Database changed<br />
mysql&gt; show tables;<br />
+——————-+<br />
| Tables_in_cluster |<br />
+——————-+<br />
| city |<br />
+——————-+<br />
1 row in set (0.01 sec)</p>
<p>mysql&gt; select * from city;<br />
+—-+———–+<br />
| id | name |<br />
+—-+———–+<br />
| 1 | Shenzhen |<br />
| 2 | Guangdong |<br />
+—-+———–+<br />
2 rows in set (0.03 sec)</p>
<p>mysql&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4551/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu关机命令</title>
		<link>http://blog.haohtml.com/index.php/archives/4531</link>
		<comments>http://blog.haohtml.com/index.php/archives/4531#comments</comments>
		<pubDate>Thu, 08 Jul 2010 06:56:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4531</guid>
		<description><![CDATA[1. 关机命令 shutdown 好像ubuntu的终端中默认的是当前用户的命令，只是普通用户，因此在终端器中可以使用sudo -sh 转换到管理员root用户下执行命令。 1)shutdown &#8211;help 可以查看shutdown命令如何使用，当然也可以使用man shutdown命令。 2） shutdown -h now 现在立即关机 3）shutdown -r now 现在立即重启 4）shutdown -r +3 三分钟后重启 5）shutdown -h +3 &#8220;The System will shutdown after 3 minutes&#8221; 提示使用者将在三分钟后关机 6）shutdown -r 20:23 在20：23时将重启计算机 7）shutdown -r 20:23 &#38; 可以将在20：23时重启的任务放到后台去，用户可以继续操作终端 2. 中断命令 1）执行完命令后（若没有转到后台），可以使用CTRL+C来中止命令 2）kill 程序编码 当命令在后台执行时系统会返回一个程序编码，例如：在使用 shutdown -r 20:23 &#38; 系统返回系统编码：4905 我们可以使用kill [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. 关机命令 shutdown</strong></p>
<p>好像ubuntu的终端中默认的是当前用户的命令，只是普通用户，因此在终端器中可以使用sudo -sh 转换到管理员root用户下执行命令。</p>
<p>1)shutdown &#8211;help</p>
<p>可以查看shutdown命令如何使用，当然也可以使用man shutdown命令。</p>
<p>2） shutdown -h now 现在立即关机</p>
<p>3）shutdown -r now 现在立即重启</p>
<p>4）shutdown -r +3 三分钟后重启</p>
<p>5）shutdown -h +3 &#8220;The System will shutdown after 3 minutes&#8221; 提示使用者将在三分钟后关机</p>
<p>6）shutdown -r 20:23 在20：23时将重启计算机</p>
<p>7）shutdown -r 20:23 &amp; 可以将在20：23时重启的任务放到后台去，用户可以继续操作终端<span id="more-4531"></span></p>
<p><strong>2. 中断命令</strong></p>
<p>1）执行完命令后（若没有转到后台），可以使用CTRL+C来中止命令</p>
<p>2）kill 程序编码</p>
<p>当命令在后台执行时系统会返回一个程序编码，例如：在使用 shutdown -r 20:23 &amp; 系统返回系统编码：4905</p>
<p>我们可以使用kill 4905来中止重启命令</p>
<p><strong>3. ps aux | grep 程序编号</strong></p>
<p>我们如果知道程序的编号，我们可以使用ps aux |grep 程序编号来查询该程序编号对应的命令是什么。</p>
<p>例如上面的程序编号为4905 ，我们可以使用ps aux | grep 4905 就可以查到 shutdown -r 20:23 &amp; 的命令</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4531/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu下安装apache+php+mysql+phpmyadmin</title>
		<link>http://blog.haohtml.com/index.php/archives/4522</link>
		<comments>http://blog.haohtml.com/index.php/archives/4522#comments</comments>
		<pubDate>Thu, 08 Jul 2010 05:02:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4522</guid>
		<description><![CDATA[通过这篇文章，让我这个菜鸟成功的安装好了webserver需要的各种软件，特此转载下。 在windows xp系统中可以傻瓜化安装amp，即安装wamp server这个把apache、php、mysql、phpmyadmin集成在一起的套装即可，而且在选择apache模块时还特别方便，真是可以不 用动脑了。由于ubuntu现在的操作也基本傻瓜化了，安装lamp也同样方便，但由于其linux血统，有的地方还需要注意一下。以下简单说明步骤： 1、安装apahce2。 sudo apt-get install apache2 完成后在浏览器地址栏输入127.0.0.1或localhost测试一下，如果网页上显示It works，那么ok。 2、安装php5。 sudo apt-get install php5 一般会自动安装libapache2-mod-php5。有的指南上说，安装apache2后，只安装libapache2-mod-php5即可。要注意的是，安装完php5，别忘记重启apache2。 sudo /etc/init.d/apache2 restart 完成后，在浏览器中运行一下info.php，如果出现php安装完成的各种信息，就成功了。如果你没有info.php，自己写一个，放在/var/www目录下，很简单，如下： &#60;\?php info() \?&#62; 如果总是出现提示下载info.php文件的问题，不要在浏览器地址栏输入http://localhost/info.php，直接用ip地址试 一下，即http://127.0.0.1/info.php。有的指南上说，可以先 sudo a2enmod php5，然后使用sudo /etc/init.d/apache2 restart来重新启动APACHE。总之，一般php的安装不会出现问题。 3、安装mysql。 在php5下安装mysql，在终端输入如下命令： sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql 如果root帐号没有mysql密码，还要建立一个，具体方法看指南即可。以下从指南中抄一段： mysql -u root 进入MYSQL控制台，然后输入 mysql&#62; SET PASSWORD FOR &#8216;root&#8217;@'localhost&#8217; = PASSWORD(&#8216;yourpassword&#8217;); 如果成功MYSQL会提示 Query OK, [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">
<p><span style="font-family: Verdana, 'Lucida Grande', Arial, Helvetica, sans-serif; line-height: 28px; font-size: 14px;"> </span><span style="font-family: Verdana, 'Lucida Grande', Arial, Helvetica, sans-serif; line-height: 25px; font-size: 14px; color: #444444; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">通过这篇文章，让我这个菜鸟成功的安装好了webserver需要的各种软件，特此转载下。</span></p>
<p><span style="font-family: Verdana, 'Lucida Grande', Arial, Helvetica, sans-serif; line-height: 25px; font-size: 14px; color: #444444; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"></p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">在windows xp系统中可以傻瓜化安装amp，即安装wamp server这个把apache、php、mysql、phpmyadmin集成在一起的套装即可，而且在选择apache模块时还特别方便，真是可以不 用动脑了。由于ubuntu现在的操作也基本傻瓜化了，安装lamp也同样方便，但由于其linux血统，有的地方还需要注意一下。以下简单说明步骤：<span id="more-4522"></span></p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">1、安装apahce2。</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">sudo apt-get install apache2</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">完成后在浏览器地址栏输入127.0.0.1或localhost测试一下，如果网页上显示It works，那么ok。</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">2、安装php5。</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">sudo apt-get install php5</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">一般会自动安装libapache2-mod-php5。有的指南上说，安装apache2后，只安装libapache2-mod-php5即可。要注意的是，安装完php5，别忘记重启apache2。</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">sudo /etc/init.d/apache2 restart</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">完成后，在浏览器中运行一下info.php，如果出现php安装完成的各种信息，就成功了。如果你没有info.php，自己写一个，放在/var/www目录下，很简单，如下：</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">&lt;\?php info() \?&gt;</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">如果总是出现提示下载info.php文件的问题，不要在浏览器地址栏输入http://localhost/info.php，直接用ip地址试 一下，即http://127.0.0.1/info.php。有的指南上说，可以先 sudo a2enmod php5，然后使用sudo /etc/init.d/apache2 restart来重新启动APACHE。总之，一般php的安装不会出现问题。</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">3、安装mysql。</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">在php5下安装mysql，在终端输入如下命令：</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">如果root帐号没有mysql密码，还要建立一个，具体方法看指南即可。以下从指南中抄一段：</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">mysql -u root</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">进入MYSQL控制台，然后输入</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">mysql&gt; SET PASSWORD FOR &#8216;root&#8217;@'localhost&#8217; = PASSWORD(&#8216;yourpassword&#8217;);</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">如果成功MYSQL会提示</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">Query OK, 0 rows affected (0.00 sec)</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">MYSQL命令可以多行执行，但是请您不要忘记，一定要以“；”分号结尾哦 。</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">先不用建立新用户，安装phpmyadmin后，可在图形化界面下建立。</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">4、安装phpmyadmin。</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">这个要说一下，命令虽然很简单，如下：</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">sudo apt-get install phpmyadmin</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">但会默认安装到/usr/share目录下去，所以还要copy到/var/www目录下，先cd到/usr/share目录，用如下命令：</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">sudo cp  -r -a /phpmyadmin/ /var/www</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">-r是拷贝目录， -a 保持权限不变。然后，打开一个配置文件:</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">sudo gedit /etc/phpmyadmin/apache.conf</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">把alias一行改为如下形式，即把目录设置为/www/phpmyadmin：</p>
<blockquote style="word-wrap: break-word; word-break: break-all; margin-top: 20px; margin-right: 30px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-color: #3b5998; border-style: solid;">
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">Alias /phpmyadmin /var/www/phpmyadmin</p>
</blockquote>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">重新启动apache。完成后在浏览器地址栏输入http://localhost/phpmyamin，按提示输入用户名和密码，因为前面没有建 立mysql新用户，这里输入root和root的mysql密码好了。进入图形管理界面后，建立一个用户，给他all previliges，即全部权限。 :lol:</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">建立一个blog或cms或其他什么名称的数据库，供你安装wordpress或其他文章管理程序或博客使用。</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">小结：</p>
<p style="word-wrap: break-word; word-break: break-all; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; padding: 0px;">总之，现在无论在windows还是在ubuntu上，amp服务器配置都傻瓜化了，对我们菜鸟来说当然是好事。在ubuntu下看来要注意的是： 一、安装php5，用http://127.0.0.1/info.php测试一下，如果总是用http://localhost/info.php，可 能老是提示你下载info.php文件。二、phpmyadmin管理mysql数据库很方便，但默认安装到/usr/share，所以要拷贝到/var /www下面去才能工作，也别忘记在其配置文件中把虚拟目录改为/var/www/phpmyadmin。</p>
<p></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4522/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ubuntu查看内核版本和发行版本</title>
		<link>http://blog.haohtml.com/index.php/archives/4519</link>
		<comments>http://blog.haohtml.com/index.php/archives/4519#comments</comments>
		<pubDate>Thu, 08 Jul 2010 03:53:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[内核]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4519</guid>
		<description><![CDATA[查看内核版本： 方法一：uname -r 输出： 2.6.32-23-generic 方法二：cat /proc/version 输出： Linux version 2.6.32-23-generic (buildd@rothera) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010 查看发行版本： 方法一：cat /etc/issue 输出： Ubuntu 8.04 \n \l 方法二：lsb_release -a 输出： No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 10.04 LTS Release:        10.04 Codename:       lucid]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">查看<strong>内核</strong>版本：<br />
</span>方法一：uname -r<br />
输出：<br />
2.6.32-23-generic<br />
方法二：cat /proc/version<br />
输出：<br />
Linux version 2.6.32-23-generic (buildd@rothera) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010</p>
<p><span style="color: #ff0000;">查看<strong>发行</strong>版本：</span><code><br />
方法一：cat /etc/issue</code><br />
输出：<br />
Ubuntu 8.04 \n \l<br />
方法二：lsb_release -a<br />
输出：<br />
No LSB modules are available.<br />
Distributor ID: Ubuntu<br />
Description:    Ubuntu 10.04 LTS<br />
Release:        10.04<br />
Codename:       lucid</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4519/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu手动设置IP/DNS地址的方法</title>
		<link>http://blog.haohtml.com/index.php/archives/4508</link>
		<comments>http://blog.haohtml.com/index.php/archives/4508#comments</comments>
		<pubDate>Thu, 08 Jul 2010 03:26:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4508</guid>
		<description><![CDATA[Ubuntu的网络参数保存在文件 /etc/network/interfaces中，默认设置使用dhcp，内容如下： # The primary network interface auto eth0 iface eth0 inet dhcp 设置静态ip的方法如下： 1） 编辑 /etc/network/interfaces 1.1）将dhcp 一行屏蔽 # The primary network interface auto eth0 #iface eth0 inet dhcp 1.2）添加和静态ip有关的参数 # The primary network interface iface eth0 inet static address 192.168.0.10 netmask 255.255.255.0 gateway 192.168.0.1 2）编辑 /etc/resolv.conf，设置dns nameserver 202.96.134.133 nameserver 202.106.0.20 3）执行下面两个命令，启用新设置 $sudo ifdown [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: monospace;"><span style="font-size: small;">Ubuntu的网络参数保存在文件 /etc/network/interfaces中，默认设置使用dhcp，内容如下：</span></span></p>
<p># The primary network interface<br />
auto eth0<br />
iface eth0 inet dhcp</p>
<p>设置静态ip的方法如下：<br />
1） 编辑 /etc/network/interfaces<br />
1.1）将dhcp 一行屏蔽<br />
# The primary network interface<br />
auto eth0<br />
#iface eth0 inet dhcp<br />
<span id="more-4508"></span>1.2）添加和静态ip有关的参数<br />
# The primary network interface<br />
iface eth0 inet static<br />
address 192.168.0.10<br />
netmask 255.255.255.0<br />
gateway 192.168.0.1</p>
<p>2）编辑 /etc/resolv.conf，设置dns<br />
nameserver 202.96.134.133<br />
nameserver 202.106.0.20</p>
<p>3）执行下面两个命令，启用新设置<br />
<strong> $sudo ifdown eth0<br />
$sudo ifup eth0</strong></p>
<p>网络重启可以用下面的指今：<br />
<strong>#sudo /etc/init.d/networking restart</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4508/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu开启SSH服务</title>
		<link>http://blog.haohtml.com/index.php/archives/4505</link>
		<comments>http://blog.haohtml.com/index.php/archives/4505#comments</comments>
		<pubDate>Thu, 08 Jul 2010 03:22:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4505</guid>
		<description><![CDATA[网上有很多介绍在Ubuntu下开启SSH服务的文章，但大多数介绍的方法测试后都不太理想，均不能实现远程登录到Ubuntu上，最后分析原因是都没有真正开启ssh-server服务。最终成功的方法如下： sudo apt-get install openssh-server Ubuntu缺省安装了openssh-client,所以在这里就不安装了，如果你的系统没有安装的话，再用apt-get安装上即可。 然后确认sshserver是否启动了： ps -e &#124;grep ssh 如果只有ssh-agent那ssh-server还没有启动，需要/etc/init.d/ssh start，如果看到sshd那说明ssh-server已经启动了。 ssh-server配置文件位于/ etc/ssh/sshd_config，在这里可以定义SSH的服务端口，默认端口是22，你可以自己定义成其他端口号，如222。然后重启SSH服务： sudo /etc/init.d/ssh resar ssh连接：ssh xjtu129@202.117.15.165]]></description>
			<content:encoded><![CDATA[<p>网上有很多介绍在Ubuntu下开启SSH服务的文章，但大多数介绍的方法测试后都不太理想，均不能实现远程登录到Ubuntu上，最后分析原因是都没有真正开启ssh-server服务。最终成功的方法如下：</p>
<p><strong>sudo apt-get install openssh-server</strong></p>
<p>Ubuntu缺省安装了openssh-client,所以在这里就不安装了，如果你的系统没有安装的话，再用apt-get安装上即可。</p>
<p>然后确认sshserver是否启动了：</p>
<p><strong>ps -e |grep ssh</strong></p>
<p>如果只有ssh-agent那ssh-server还没有启动，需要/etc/init.d/ssh start，如果看到sshd那说明ssh-server已经启动了。</p>
<p>ssh-server配置文件位于/ etc/ssh/sshd_config，在这里可以定义SSH的服务端口，默认端口是22，你可以自己定义成其他端口号，如222。然后重启SSH服务：</p>
<p><strong>sudo /etc/init.d/ssh resar </strong></p>
<p>ssh连接：ssh xjtu129@202.117.15.165</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4505/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[教程]ubuntu server 10.4下LVS-DR实验</title>
		<link>http://blog.haohtml.com/index.php/archives/4386</link>
		<comments>http://blog.haohtml.com/index.php/archives/4386#comments</comments>
		<pubDate>Mon, 05 Jul 2010 14:16:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[lvs]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4386</guid>
		<description><![CDATA[目标：负载均衡器LVS(ip为：192.168.3.10，虚拟IP为：192.168.3.100），实机两台分别为rs２（ip为：192.168.3.20）,rs３（ip为192.168.3.30），这三台机器都安装一块网块，实机上安装apache。在一客户端cs(ip为：192.168.3.1）上访问http://192.168.3.100,会轮流访问两台实机，则实验成功。 对于虚拟IP的机器,没有必要安装其它软件的,只需要安装ipvsadm 个就可以了,而对于Real Server来说,由于要访问网页,所以需要安装apache的,注意配置中的端口信息,硬件和软件配置最好一样. １. 配置LVS机器： 在ubuntu server 10.4 默认安装是没有安装ipvsadm软件包的，在网上看了很多教程，都要编辑内核，但现在2.6.32内核已经不需要再编辑了。 #sudo apt-get install ipvsadm 会提示 please run dpkg –reconfigure ipvsadm #sudo dpkg–reconfigure ipvsadm (dpkg与-reconfigure是连到一起中间没空格） #sudo ifconfig eth0:0 192.168.3.100 netmask 255.255.255.255 broadcast 192.168.3.100 #sudo route add –host 192.168.3.100 dev eth0:0 #sudo ipvsadm –A –t 192.168.3.100:80 –s rr #sudo ipvsadm –a –t 192.168.3.100:80 –r 192.168.3.20 –g #sudo [...]]]></description>
			<content:encoded><![CDATA[<p>目标：负载均衡器LVS(ip为：192.168.3.10，虚拟IP为：192.168.3.100），实机两台分别为rs２（ip为：192.168.3.20）,rs３（ip为192.168.3.30），这三台机器都安装一块网块，实机上安装apache。在一客户端cs(ip为：192.168.3.1）上访问<a href="http://192.168.3.100/" target="\&quot;_blank\&quot;">http://192.168.3.100</a>,会轮流访问两台实机，则实验成功。</p>
<p>对于虚拟IP的机器,没有必要安装其它软件的,只需要安装ipvsadm 个就可以了,而对于Real Server来说,由于要访问网页,所以需要安装apache的,注意配置中的端口信息,硬件和软件配置最好一样.</p>
<div><strong>１. 配置LVS机器：</strong></div>
<div>在ubuntu server 10.4 默认安装是没有安装ipvsadm软件包的，在网上看了很多教程，都要编辑内核，但现在2.6.32内核已经不需要再编辑了。</div>
<div>#sudo apt-get install ipvsadm</div>
<div>会提示 please run dpkg –reconfigure ipvsadm</div>
<div>#sudo dpkg–reconfigure ipvsadm (dpkg与-reconfigure是连到一起中间没空格）</div>
<div><a href="http://blog.haohtml.com/wp-content/uploads/2010/07/cluster_1.png"><img class="alignnone size-full wp-image-4515" title="cluster_1" src="http://blog.haohtml.com/wp-content/uploads/2010/07/cluster_1.png" alt="" width="513" height="174" /></a><br />
<span id="more-4386"></span></div>
<div><a href="http://blog.haohtml.com/wp-content/uploads/2010/07/cluster_2.png"><img class="alignnone size-full wp-image-4516" title="cluster_2" src="http://blog.haohtml.com/wp-content/uploads/2010/07/cluster_2.png" alt="" width="523" height="170" /></a></div>
<div><a href="http://blog.haohtml.com/wp-content/uploads/2010/07/cluster_3.png"><img class="alignnone size-full wp-image-4517" title="cluster_3" src="http://blog.haohtml.com/wp-content/uploads/2010/07/cluster_3.png" alt="" width="526" height="180" /></a></div>
<blockquote>
<div>#sudo ifconfig eth0:0 192.168.3.100 netmask 255.255.255.255 broadcast 192.168.3.100</div>
<div>#sudo route add –host 192.168.3.100 dev eth0:0</div>
<div>#sudo ipvsadm –A –t 192.168.3.100:80 –s rr</div>
<div>#sudo ipvsadm –a –t 192.168.3.100:80 –r 192.168.3.20 –g</div>
<div>#sudo ipvsadm –a –t 192.168.3.100:80  -r 192.168.3.30 –g</div>
<div>#sudo ipvsadm –save</div>
</blockquote>
<div>*:这里rr表示ipvsadm的8种算法中的轮询，做实验选这个算法，效果比较明显。</div>
<div>eth0:0 中后面的0表示第一个ip,一个网卡可以绑定多个ip,从0开始,依次类推 eth0:1,eth0:2&#8230;</div>
<div>-g,就是lvs的三种模式中的LVS-DR模式。</div>
<div>-i 就是遂道LVS-TUN.</div>
<div>为什么eth0:0的broadcast就是它的IP，因为他的netmask为/32.(the VIP is a /32 addr, so the brd addr is the VIP, not x.x.x.255.)</div>
<div>对于ifconfig这个命令不熟悉的话,可以参考:<a href="http://blog.haohtml.com/index.php/archives/4545">http://blog.haohtml.com/index.php/archives/4545</a></div>
<div>修改<strong>/etc/sysctl.conf</strong></div>
<div><strong><br />
</strong></div>
<blockquote>
<div>net.ipv4.ip_forward=0</div>
<div>net.ipv4.conf.all.send_redirects=1</div>
<div>net.ipv4.conf.default.send_redirects=1</div>
<div>net.ipv4.conf.eth0.send_redirects=1</div>
<div>#sudo sysctl -p</div>
</blockquote>
<div><strong>2. 配置实机rs2,rs3为如下</strong></div>
<div><strong><br />
</strong></div>
<blockquote>
<div>#sudo ifconfig lo:0 192.168.3.100 netmask 255.255.255.255 broadcast 192.168.3.100</div>
<div>#sudo route add –host 192.168.3.100 dev lo:0</div>
</blockquote>
<div>修改/etc/sysctl.conf</div>
<blockquote>
<div>net.ipv4.ip_forward=0</div>
<div>net.ipv4.conf.lo.arp_ignore=1</div>
<div>net.ipv4.conf.lo.arp_announce=2</div>
<div>net.ipv4.conf.all.arp_ignore=1</div>
<div>net.ipv4.conf.all.arp_announce=2</div>
<div>#sudo sysctl –p</div>
</blockquote>
<div>把rs2，rs3的/var/www下的index.html的内容修改为“this is rs2”,”this is rs3”,当访问时区别访问的是那台机器，查看实验是否成功(如果没有安装apache,安装教程请参考这里:<a href="http://blog.haohtml.com/index.php/archives/4522">http://blog.haohtml.com/index.php/archives/4522</a>)。</div>
<div>在实验过程中：刚开始没有修改实机rs2,rs3下的/etc/sysctl.conf,在访问<a href="http://192.168.3.100" target="\&quot;_blank\&quot;">http://192.168.3.100</a>时，有时能轮流的访问rs2,rs3，有时不能，修改后，发现效果很好，达到实验目标。为什么要修改可以参考以下<a title="http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.arp_problem.html" href="http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.arp_problem.html" target="\&quot;_blank\&quot;">http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.arp_problem.html</a>的内容，专门讲解了关于LVS的 ARP ，也有专门讲解了在LVS-DR模式中ARP问题及如何去解决ARP问题，也有arp_ingnore,arp_announce具体的意思。要想深入学习LVS，必须要看这个LVS-HOWTO</div>
<div>以下这个博客也很好的讲解了LVS,可以参考。</div>
<div><a title="http://hi.baidu.com/fengyezhidu/blog/item/08338050e94a345a1138c278.html" href="http://hi.baidu.com/fengyezhidu/blog/item/08338050e94a345a1138c278.html" target="\&quot;_blank\&quot;">http://hi.baidu.com/fengyezhidu/blog/item/08338050e94a345a1138c278.html</a></div>
<div>*:</div>
<div>用firefox浏览器，在地址栏中输入：about:config,找到network.http.keep-alive 把值修改为false,利于查看实验结果。 我自己的时候发现每刷新两次ip会更换一次,对于配置信息暂时还不明白,所以也不清楚是怎么回事了,有兴趣的可以试一下了.</div>
<p>本文出自 “<a href="http://xuchengji.blog.51cto.com">匠人</a>” 博客，请务必保留此出处<a href="http://xuchengji.blog.51cto.com/160472/326059">http://xuchengji.blog.51cto.com/160472/326059</a></p>
<p><a class="hidden" href="http://xuchengji.blog.51cto.com/160472/326059">本文出自 51CTO.COM技术博客</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4386/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu 10.04 键盘无法识别</title>
		<link>http://blog.haohtml.com/index.php/archives/4130</link>
		<comments>http://blog.haohtml.com/index.php/archives/4130#comments</comments>
		<pubDate>Sun, 27 Jun 2010 08:32:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=4130</guid>
		<description><![CDATA[使用的是Vmware 7.0.0, 安装Ubuntu10.04镜像却无法识别键盘。在登录画面时，不能输入密码，插外接键盘也不行。 在Ubuntu10.04下键盘的NUMLOCK指示灯不亮 切换到windows下后就亮了， 虚拟机的另一个系统的键盘也可以正常使用。请问有什么解决方法？ 解决办法： 1、在登录界面中调出Universal Access Preferences面板，勾选第一个选项“Use on-screen keyboard”，此时会弹出一个软键盘，将面板关闭，直接用软键盘输入密码即可。 2、通过屏幕键盘输入密码登入系统，这时键盘就可以使用了。 3、编辑配置文件/etc /default/console-setup 把最后四行改为： XKBMODEL=&#8221;SKIP&#8221; XKBLAYOUT=&#8221;us&#8221; XKBVARIANT=&#8221;U.S. English&#8221; XKBOPTIONS=&#8221;" 修改为： XKBMODEL=&#8221;pc105&#8243; XKBLAYOUT=&#8221;us&#8221; XKBVARIANT=&#8221;" XKBOPTIONS=&#8221;" 4、重新启动，在图形登录界面中就能使用键盘了。]]></description>
			<content:encoded><![CDATA[<p>使用的是Vmware 7.0.0, 安装Ubuntu10.04镜像却无法识别键盘。在登录画面时，不能输入密码，插外接键盘也不行。 在Ubuntu10.04下键盘的NUMLOCK指示灯不亮 切换到windows下后就亮了， 虚拟机的另一个系统的键盘也可以正常使用。请问有什么解决方法？</p>
<p>解决办法：</p>
<p>1、在登录界面中调出Universal Access Preferences面板，勾选第一个选项“Use on-screen keyboard”，此时会弹出一个软键盘，将面板关闭，直接用软键盘输入密码即可。</p>
<p>2、通过屏幕键盘输入密码登入系统，这时键盘就可以使用了。</p>
<p>3、编辑配置文件/etc /default/console-setup</p>
<p>把最后四行改为：</p>
<p>XKBMODEL=&#8221;SKIP&#8221;</p>
<p>XKBLAYOUT=&#8221;us&#8221;</p>
<p>XKBVARIANT=&#8221;U.S. English&#8221;</p>
<p>XKBOPTIONS=&#8221;"</p>
<p>修改为：</p>
<p>XKBMODEL=&#8221;pc105&#8243;</p>
<p>XKBLAYOUT=&#8221;us&#8221;</p>
<p>XKBVARIANT=&#8221;"</p>
<p>XKBOPTIONS=&#8221;"</p>
<p>4、重新启动，在图形登录界面中就能使用键盘了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/4130/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu使用命令大全</title>
		<link>http://blog.haohtml.com/index.php/archives/3529</link>
		<comments>http://blog.haohtml.com/index.php/archives/3529#comments</comments>
		<pubDate>Sat, 01 May 2010 05:14:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=3529</guid>
		<description><![CDATA[Ubuntu使用命令大全，好好掌握吧。 查看软件xxx安装内容 #dpkg -L xxx 查找软件 #apt-cache search 正则表达式 查找文件属于哪个包 #dpkg -S filename apt-file search filename 查询软件xxx依赖哪些包 #apt-cache depends xxx 查询软件xxx被哪些包依赖 #apt-cache rdepends xxx 增加一个光盘源 #sudo apt-cdrom add 系统升级 #sudo apt-get update #sudo apt-get upgrade #sudo apt-get dist-upgrade 清除所以删除包的残余配置文件 #dpkg -l &#124;grep ^rc&#124;awk ‘{print $2}’ &#124;tr [”\n”] [” “]&#124;sudo xargs dpkg -P - 编译时缺少h文件的自动处理 #sudo [...]]]></description>
			<content:encoded><![CDATA[<p>Ubuntu使用命令大全，好好掌握吧。<br />
查看软件xxx安装内容<br />
#dpkg -L xxx<br />
查找软件<br />
#apt-cache search 正则表达式<br />
查找文件属于哪个包<br />
#dpkg -S filename apt-file search filename<br />
查询软件xxx依赖哪些包<br />
#apt-cache depends xxx<br />
查询软件xxx被哪些包依赖<br />
#apt-cache rdepends xxx<br />
增加一个光盘源<br />
#sudo apt-cdrom add<br />
系统升级<br />
#sudo apt-get update<br />
#sudo apt-get upgrade<br />
#sudo apt-get dist-upgrade<br />
清除所以删除包的残余配置文件<br />
#dpkg -l |grep ^rc|awk ‘{print $2}’ |tr [”\n”] [” “]|sudo xargs dpkg -P -<br />
编译时缺少h文件的自动处理<br />
#sudo auto-apt run ./configure<span id="more-3529"></span><br />
查看安装软件时下载包的临时存放目录<br />
#ls /var/cache/apt/archives<br />
备份当前系统安装的所有包的列表<br />
#dpkg –get-selections | grep -v deinstall &gt; ~/somefile<br />
从上面备份的安装包的列表文件恢复所有包<br />
#dpkg –set-selections  /proc/sys/net/ipv4/ip_forward<br />
#sudo iptables -t nat -I POSTROUTING -j MASQUERADE<br />
查看路由信息<br />
#netstat -rn sudo route -n<br />
手工增加删除一条路由<br />
#sudo route add -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1<br />
#sudo route del -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1<br />
修改网卡MAC地址的方法<br />
#sudo ifconfig eth0 down 关闭网卡<br />
#sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE 然后改地址<br />
#sudo ifconfig eth0 up 然后启动网卡<br />
统计当前IP连接的个数<br />
#netstat -na|grep ESTABLISHED|awk ‘{print $5}’|awk -F: ‘{print  $1}’|sort|uniq -c|sort -r -n<br />
#netstat -na|grep SYN|awk ‘{print $5}’|awk -F: ‘{print $1}’|sort|uniq  -c|sort -r -n<br />
统计当前20000个IP包中大于100个IP包的IP地址<br />
#tcpdump -tnn -c 20000 -i eth0 | awk -F “.” ‘{print $1″.”$2″.”$3″.”$4}’ |  sort | uniq -c | sort -nr | awk ‘ $1 &gt; 100 ‘<br />
屏蔽IPV6<br />
#echo “blacklist ipv6″ | sudo tee /etc/modprobe.d/blacklist-ipv6<br />
服务<br />
添加一个服务<br />
#sudo update-rc.d 服务名 defaults 99<br />
删除一个服务<br />
#sudo update-rc.d 服务名 remove<br />
临时重启一个服务<br />
#/etc/init.d/服务名 restart<br />
临时关闭一个服务<br />
#/etc/init.d/服务名 stop<br />
临时启动一个服务<br />
#/etc/init.d/服务名 start<br />
设置<br />
配置默认Java使用哪个<br />
#sudo update-alternatives –config java<br />
修改用户资料<br />
#sudo chfn userid<br />
给apt设置代理<br />
#export http_proxy=http://xx.xx.xx.xx:xxx<br />
修改系统登录信息<br />
#sudo vim /etc/motd<br />
中文<br />
转换文件名由GBK为UTF8<br />
#sudo apt-get install convmv convmv -r -f cp936 -t utf8 –notest –nosmart  *<br />
批量转换src目录下的所有文件内容由GBK到UTF8<br />
#find src -type d -exec mkdir -p utf8/{} \; find src -type f -exec iconv  -f GBK -t UTF-8 {} -o utf8/{} \; mv utf8/* src rm -fr utf8<br />
转换文件内容由GBK到UTF8<br />
#iconv -f gbk -t utf8 $i &gt; newfile<br />
转换 mp3 标签编码<br />
#sudo apt-get install python-mutagen find . -iname “*.mp3” -execdir  mid3iconv -e GBK {} \;<br />
控制台下显示中文<br />
#sudo apt-get install zhcon 使用时，输入zhcon即可<br />
文件<br />
快速查找某个文件<br />
#whereis filename<br />
#find 目录 -name 文件名<br />
查看文件类型<br />
#file filename<br />
显示xxx文件倒数6行的内容<br />
#tail -n 6 xxx<br />
让tail不停地读地最新的内容<br />
#tail -n 10 -f /var/log/apache2/access.log<br />
查看文件中间的第五行（含）到第10行（含）的内容<br />
#sed -n ‘5,10p’ /var/log/apache2/access.log<br />
查找包含xxx字符串的文件<br />
#grep -l -r xxx .<br />
全盘搜索文件(桌面可视化)<br />
gnome-search-tool<br />
查找关于xxx的命令<br />
#apropos xxx man -k xxx<br />
通过ssh传输文件<br />
#scp -rp /path/filenameusername@remoteIP:/path<br />
#将本地文件拷贝到服务器上<br />
#scp -rpusername@remoteIP:/path/filename/path<br />
#将远程文件从服务器下载到本地<br />
查看某个文件被哪些应用程序读写<br />
#lsof 文件名<br />
把所有文件的后辍由rm改为rmvb<br />
#rename ’s/.rm$/.rmvb/’ *<br />
把所有文件名中的大写改为小写<br />
#rename ‘tr/A-Z/a-z/’ *<br />
删除特殊文件名的文件，如文件名：–help.txt<br />
#rm — –help.txt 或者 rm ./–help.txt<br />
查看当前目录的子目录<br />
#ls -d */. 或 echo */.<br />
将当前目录下最近30天访问过的文件移动到上级back目录<br />
#find . -type f -atime -30 -exec mv {} ../back \;<br />
将当前目录下最近2小时到8小时之内的文件显示出来<br />
#find . -mmin +120 -mmin -480 -exec more {} \;<br />
删除修改时间在30天之前的所有文件<br />
#find . -type f -mtime +30 -mtime -3600 -exec rm {} \;<br />
查找guest用户的以avi或者rm结尾的文件并删除掉<br />
#find . -name ‘*.avi’ -o -name ‘*.rm’ -user ‘guest’ -exec rm {} \;<br />
查找的不以java和xml结尾,并7天没有使用的文件删除掉<br />
#find . ! -name *.java ! -name ‘*.xml’ -atime +7 -exec rm {} \;<br />
统计当前文件个数<br />
#ls /usr/bin|wc -w<br />
统计当前目录个数<br />
#ls -l /usr/bin|grep ^d|wc -l<br />
显示当前目录下2006-01-01的文件名<br />
#ls -l |grep 2006-01-01 |awk ‘{print $8}’<br />
FTP<br />
上传下载文件工具-filezilla<br />
#sudo apt-get install filezilla<br />
filezilla无法列出中文目录？<br />
站点-&gt;字符集-&gt;自定义-&gt;输入：GBK<br />
本地中文界面<br />
1）下载filezilla中文包到本地目录，如~/<br />
2）#unrar x Filezilla3_zhCN.rar<br />
3) 如果你没有unrar的话，请先安装rar和unrar<br />
#sudo apt-get install rar unrar<br />
#sudo ln -f /usr/bin/rar /usr/bin/unrar<br />
4）先备份原来的语言包,再安装；实际就是拷贝一个语言包。<br />
#sudo cp /usr/share/locale/zh_CN/filezilla.mo  /usr/share/locale/zh_CN/filezilla.mo.bak<br />
#sudo cp ~/locale/zh_CN/filezilla.mo  /usr/share/locale/zh_CN/filezilla.mo<br />
5）重启filezilla,即可！<br />
解压缩<br />
解压缩 xxx.tar.gz<br />
#tar -zxvf xxx.tar.gz<br />
解压缩 xxx.tar.bz2<br />
#tar -jxvf xxx.tar.bz2<br />
压缩aaa bbb目录为xxx.tar.gz<br />
#tar -zcvf xxx.tar.gz aaa bbb<br />
压缩aaa bbb目录为xxx.tar.bz2<br />
#tar -jcvf xxx.tar.bz2 aaa bbb<br />
解压缩 RAR 文件<br />
1) 先安装<br />
#sudo apt-get install rar unrar<br />
#sudo ln -f /usr/bin/rar /usr/bin/unrar<br />
2) 解压<br />
#unrar x aaaa.rar<br />
Nautilus<br />
显示隐藏文件<br />
Ctrl+h<br />
显示地址栏<br />
Ctrl+l<br />
特殊 URI 地址<br />
* computer:/// &#8211; 全部挂载的设备和网络<br />
* network:/// &#8211; 浏览可用的网络<br />
* burn:/// &#8211; 一个刻录 CDs/DVDs 的数据虚拟目录<br />
* smb:/// &#8211; 可用的 windows/samba 网络资源<br />
* x-nautilus-desktop:/// &#8211; 桌面项目和图标<br />
*file:///- 本地文件<br />
* trash:/// &#8211; 本地回收站目录<br />
* ftp:// &#8211; FTP 文件夹<br />
* ssh:// &#8211; SSH 文件夹<br />
* fonts:/// &#8211; 字体文件夹，可将字体文件拖到此处以完成安装<br />
* themes:/// &#8211; 系统主题文件夹<br />
查看已安装字体<br />
在nautilus的地址栏里输入”fonts:///“，就可以查看本机所有的fonts<br />
程序<br />
详细显示程序的运行信息<br />
#strace -f -F -o outfile<br />
日期和时间<br />
设置日期<br />
#date -s mm/dd/yy<br />
设置时间<br />
#date -s HH:MM<br />
将时间写入CMOS<br />
#hwclock –systohc<br />
读取CMOS时间<br />
#hwclock –hctosys<br />
从服务器上同步时间<br />
#sudo ntpdate time.nist.gov<br />
#sudo ntpdate time.windows.com<br />
控制台<br />
不同控制台间切换<br />
Ctrl + ALT + ← Ctrl + ALT + →<br />
指定控制台切换<br />
Ctrl + ALT + Fn(n:1~7)<br />
控制台下滚屏<br />
SHIFT + pageUp/pageDown<br />
控制台抓图<br />
#setterm -dump n(n:1~7)<br />
数据库<br />
mysql的数据库存放在地方<br />
#/var/lib/mysql<br />
从mysql中导出和导入数据<br />
#mysqldump 数据库名 &gt; 文件名 #导出数据库<br />
#mysqladmin create 数据库名 #建立数据库<br />
#mysql 数据库名  GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY  “123456″;<br />
’123456‘是root的密码，可以自由设置，但最好是设个安全点的。<br />
#mysql&gt; quit; 退出mysql<br />
apache2的操作命令<br />
启动：#sudo /etc/init.d/apache2 start<br />
重启：#sudo /etc/init.d/apache2 restart<br />
关闭：#sudo /etc/init.d/apache2 stop<br />
apache2的默认主目录：/var/www/<br />
Ubuntu 7.10 更换软件源、更新系统<br />
网通建议用台湾的源，电信就用cn99<br />
在终端输入: #sudo gedit /etc/apt/sources.list<br />
# Ubuntu.cn99.com 更新服务器（江苏省常州市电信，推荐电信用户使用。）<br />
deb http://ubuntu.cn99.com/ubuntu/ gutsy main restricted universe  multiverse<br />
deb http://ubuntu.cn99.com/ubuntu/ gutsy-security main restricted  universe multiverse<br />
deb http://ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted  universe multiverse<br />
# mirror.rootguide.org更新服务器 (上海市 电信):<br />
deb http://mirror.rootguide.org/ubuntu/ gutsy main restricted universe  multiverse<br />
deb-src http://mirror.rootguide.org/ubuntu/ gutsy main restricted  universe multiverse<br />
deb http://mirror.rootguide.org/ubuntu/ gutsy-updates main restricted  universe multiverse<br />
# Mirror.lupaworld.com 更新服务器（浙江省杭州市电信，亚洲地区官方更新服务器）<br />
deb http://cn.archive.ubuntu.com/ubuntu gutsy main restricted universe  multiverse<br />
deb http://cn.archive.ubuntu.com/ubuntu gutsy-security main restricted  universe multiverse<br />
deb http://cn.archive.ubuntu.com/ubuntu gutsy-updates main restricted  universe multiverse<br />
# ubuntu.cnsite.org 更新服务器（福建省福州市 电信）<br />
deb http://ubuntu.cnsite.org/ubuntu/ gutsy main restricted universe  multiverse<br />
deb-src http://ubuntu.cnsite.org/ubuntu/ gutsy main restricted universe  multiverse<br />
deb http://ubuntu.cnsite.org/ubuntu/ gutsy-updates main restricted  universe multiverse<br />
#清华大学 更新服务器（教育网，推荐校园网和网通用户使用）<br />
deb http://mirror9.net9.org/ubuntu/ gutsy main multiverse restricted  universe<br />
deb http://mirror9.net9.org/ubuntu/ gutsy-backports main multiverse  restricted universe<br />
deb http://mirror9.net9.org/ubuntu/ gutsy-proposed main multiverse  restricted universe<br />
将里面乱七八糟的东西删了，将你复制的源列表粘贴到里面，保存退出。<br />
在终端输入<br />
#sudo apt-get update<br />
#sudu apt-get upgrade<br />
这样便更新以及升级了系统。<br />
桌面汉化：<br />
System&gt;Language Support&gt;Chinese选项勾打上。<br />
安装解码器、flashplayer、java虚拟机、微软字体<br />
这是ubuntu推出的一个新软件包，将一次性将上面几个东东自动装好<br />
在终端输入<br />
#sudo apt-get install ubuntu-restricted-extras<br />
FireFox 中安装 FlashPlayer 插件<br />
先下载插件: install_flash_player_9_linux.tar.gz<br />
#tar -zxf install_flash_player_9_linux.tar.gz<br />
#./flashplayer-installer<br />
回答(y/n/q)? n/q<br />
#sudo cp libflashplayer.so /usr/lib/firefox/plugins<br />
启动 firefox 即可！<br />
安装媒体播放器<br />
安装的是mplayer<br />
终端输入：#sudo apt-get install mplayer mozilla-mplayer totem-xine  libxine-extracodecs<br />
另外需要一个w32codecs文件，是用来支持那些私有媒体格式的解码器，源里已经没有w32codecs了，我们可以从这里下载那个后缀为.deb的 安装</p>
<p>http://www.debian-multimedia.org/pool/main/w/w32codecs/</p>
<p>mplayer调试(视频、字幕)<br />
启动mplayer,右键－&gt;Preferences－&gt;Video<br />
Available drivers选择xv<br />
然后进入Font标签 Font里选择一个中文字体，Encoding里设置为Simplified Chinese charset (CP936)<br />
安装下载工具（多线程下载、BT下载、电驴）<br />
还是终端输入：#sudo apt-get install d4x amule azureus<br />
即可。<br />
或者把 beryl-manager添加到启动项内<br />
字体更换<br />
我推荐大家使用文泉驿字体，在</p>
<p>http://wqy.sourceforge.net</p>
<p>下载deb包安装<br />
在“系统“－&gt;”首选项“－&gt;”字体“中调整字体<br />
apt下载的deb包清理<br />
在使用完apt后，系统下载的deb包会留存在硬盘里，我们可以把它们删除，释放硬盘空间。<br />
终端输入：#sudo apt-get clean<br />
安装rar压缩、解压工具<br />
终端输入：#sudo apt-get install rar unrar<br />
启用root（最高权限）帐户<br />
终端输入：#sudo passwd root<br />
输入你希望的root用户的密码<br />
安装QQ<br />
终端输入：#sudo apt-get install eva<br />
便可安装eva了，如果你是使用scim(选择中文语言支持的自动安装的就是scim)，为了可以在eva里面输入文字，要在终端输入：sudo  apt-get install scim-qtimm<br />
系统会安装支持QT的scim插件，这样你就可以使用eva聊qq了。<br />
显卡驱动安装<br />
进入“系统”－&gt;“系统管理”－&gt;“受限驱动管理器”<br />
找到你的显卡，把那个框点成对号，会提示你安装显卡驱动，然后按照提示一步一步安装完毕，重启即可。<br />
beryl的安装<br />
你的系统在安装完毕之后就已经有了一个内置的桌面效果软件（能实现简单的桌面特效，包括3D立方体），使用方法是（必须将显卡驱动装好）进入“系统”“首 选项”“桌面效果”，点击“启用桌面效果”，如果你需要使用3D立方体桌面，那么选中“立方体上的工作区”即可。<br />
如果你对这个简单的桌面特效工具不太满意，想追求更华丽的桌面，那么安装beryl仍然是个很好的选择。如今安装beryl不会像以前一样麻烦 了，feisty的源里已经有了beryl的软件包，我们只需要在终端里输入：<br />
#sudo apt-get install beryl-core beryl-plugins beryl-plugins-data  emerald beryl-settings beryl-manager beryl beryl-dev emerald-themes<br />
安装完毕即可了。<br />
启动方法：“应用程序”－&gt;”系统工具”－&gt;”Beryl Manager”<br />
或者直接在终端输入：#beryl-manager<br />
如何设定/改变/启用 root 使用者的密码?<br />
#sudo passwd root<br />
为了启用 root 帐号 (也就是 设置一个口令) 使用:<br />
#sudo passwd root<br />
当你使用完毕后屏蔽 root 帐号 使用:<br />
#sudo passwd -l root<br />
这个将锁住 root 帐号.<br />
如何在终端机模式下切换到 root 身份?<br />
#sudo -s -H<br />
Password:<br />
安装VNC server<br />
第一步, 获取安装文件<br />
#sudo apt-get install vnc4server<br />
第二步, 修改VNC Password, 6-8位<br />
#vncpasswd<br />
Password: ******<br />
Verify:*****<br />
第三步, 修改配置<br />
系统-&gt;首选项-&gt;远程桌面<br />
选择-&gt;请求用户输入此密码-&gt;输入至少6位密码<br />
第四步, 启动VNC server<br />
#vncserver<br />
第五步，通过客户端连接<br />
#vncviewer 192.168.0.1<br />
安装MS字体<br />
#sudo apt-get install msttcorefonts<br />
vim配置<br />
1) 首先安装 vim 完整版本<br />
#sudo apt-get install vim-full<br />
2) vim中文在线帮助<br />
a. 先下载文档 vimcdoc-1.5.0.tar.gz<br />
b. 解压, 执行./vimcdoc.sh, vi里面, 执行:help, 就都是中文的了.<br />
3) 启用本地配置 VIM version 7.1 (说明文档)<br />
#cp etc/vim/vimrc ~/.vimrc<br />
#vim ~/.vimrc<br />
1.  &#8220;&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"<br />
2. &#8221; 一般设定<br />
3.  &#8220;&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"&#8221;"<br />
4. &#8221; 设定默认解码<br />
5. set fenc=utf-8<br />
6. set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936<br />
” 不要使用vi的键盘模式，而是vim自己的<br />
set nocompatible<br />
” history文件中需要记录的行数<br />
set history=100<br />
” 在处理未保存或只读文件的时候，弹出确认<br />
set confirm<br />
” 与windows共享剪贴板<br />
set clipboard+=unnamed<br />
” 侦测文件类型<br />
filetype on<br />
” 载入文件类型插件<br />
filetype plugin on<br />
” 为特定文件类型载入相关缩进文件<br />
filetype indent on<br />
” 保存全局变量<br />
set viminfo+=!<br />
” 带有如下符号的单词不要被换行分割<br />
set iskeyword+=_,$,@,%,#,-<br />
” 语法高亮<br />
syntax on<br />
” 高亮字符，让其不受100列限制<br />
:highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white<br />
:match OverLength ‘\%101v.*’<br />
” 状态行颜色<br />
highlight StatusLine guifg=SlateBlue guibg=Yellow<br />
highlight StatusLineNC guifg=Gray guibg=White<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” 文件设置<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” 不要备份文件（根据自己需要取舍）<br />
set nobackup<br />
” 不要生成swap文件，当buffer被丢弃的时候隐藏它<br />
setlocal noswapfile<br />
set bufhidden=hide<br />
” 字符间插入的像素行数目<br />
set linespace=0<br />
” 增强模式中的命令行自动完成操作<br />
set wildmenu<br />
” 在状态行上显示光标所在位置的行号和列号<br />
set ruler<br />
set rulerformat=%20(%2*%,h,l<br />
” 可以在buffer的任何地方使用鼠标（类似office中在工作区双击鼠标定位）<br />
set mouse=a<br />
set selection=exclusive<br />
set selectmode=mouse,key<br />
” 启动的时候不显示那个援助索马里儿童的提示<br />
set shortmess=atI<br />
” 通过使用: commands命令，告诉我们文件的哪一行被改变过<br />
set report=0<br />
” 不让vim发出讨厌的滴滴声<br />
set noerrorbells<br />
” 在被分割的窗口间显示空白，便于阅读<br />
set fillchars=vert:\ ,stl:\ ,stlnc:\<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” 搜索和匹配<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” 高亮显示匹配的括号<br />
set showmatch<br />
” 匹配括号高亮的时间（单位是十分之一秒）<br />
set matchtime=5<br />
” 在搜索的时候忽略大小写<br />
set ignorecase<br />
” 不要高亮被搜索的句子（phrases）<br />
set nohlsearch<br />
” 在搜索时，输入的词句的逐字符高亮（类似firefox的搜索）<br />
set incsearch<br />
” 输入:set list命令是应该显示些啥？<br />
set listchars=tab:\|\ ,trail:.,extends:&gt;,precedes:&lt;,eol:$<br />
” 光标移动到buffer的顶部和底部时保持3行距离<br />
set scrolloff=3<br />
” 不要闪烁<br />
set novisualbell<br />
” 我的状态行显示的内容（包括文件类型和解码）<br />
set statusline=%F%m%r%h%w\ [FORMAT=%{&amp;ff}]\ [TYPE=%Y]\  [POS=%l,%v][%p%%]\ %{strftime(\”%d/%m/%y\ -\ %H:%M\”)}<br />
” 总是显示状态行<br />
set laststatus=2<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” 文本格式和排版<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” 自动格式化<br />
set formatoptions=tcrqn<br />
” 继承前一行的缩进方式，特别适用于多行注释<br />
set autoindent<br />
” 为C程序提供自动缩进<br />
set smartindent<br />
” 使用C样式的缩进<br />
set cindent<br />
” 制表符为4<br />
set tabstop=4<br />
” 统一缩进为4<br />
set softtabstop=4<br />
set shiftwidth=4<br />
” 不要用空格代替制表符<br />
set noexpandtab<br />
” 不要换行<br />
set nowrap<br />
” 在行和段开始处使用制表符<br />
set smarttab<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” CTags的设定<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” 按照名称排序<br />
let Tlist_Sort_Type = “name”<br />
” 在右侧显示窗口<br />
let Tlist_Use_Right_Window = 1<br />
” 压缩方式<br />
let Tlist_Compart_Format = 1<br />
” 如果只有一个buffer，kill窗口也kill掉buffer<br />
let Tlist_Exist_OnlyWindow = 1<br />
” 不要关闭其他文件的tags<br />
let Tlist_File_Fold_Auto_Close = 0<br />
” 不要显示折叠树<br />
let Tlist_Enable_Fold_Column = 0<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” Autocommands<br />
“”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;”&#8221;<br />
” 只在下列文件类型被侦测到的时候显示行号，普通文本文件不显示<br />
if has(”autocmd”)<br />
autocmd FileType  xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number<br />
autocmd FileType xml,html vmap ‘</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/3529/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
