<?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>九王爷的府邸 &#187; GDB</title>
	<atom:link href="http://www.9wy.net/archives/tag/gdb/feed" rel="self" type="application/rss+xml" />
	<link>http://www.9wy.net</link>
	<description>王府重地，宵小回避</description>
	<lastBuildDate>Wed, 01 Sep 2010 03:41:16 +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>[转]EMACS快捷键大全</title>
		<link>http://www.9wy.net/archives/599</link>
		<comments>http://www.9wy.net/archives/599#comments</comments>
		<pubDate>Sun, 15 Nov 2009 02:46:59 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[EMACS]]></category>
		<category><![CDATA[Font]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=599</guid>
		<description><![CDATA[网上看到的，觉得非常不错，给转到这里来了 本文在署名-非商业性使用-相同方式共享 3.0版权协议下发布, 转载请注明出自aifreedom.com C = Control M = Meta = Alt&#124;Esc Del = Backspace 基本快捷键(Basic) C-x C-f &#8220;find&#8221;文件, 即在缓冲区打开/新建一个文件 C-x C-s 保存文件 C-x C-w 使用其他文件名另存为文件 C-x C-v 关闭当前缓冲区文件并打开新文件 C-x i 在当前光标处插入文件 C-x b 新建/切换缓冲区 C-x C-b 显示缓冲区列表 C-x k 关闭当前缓冲区 C-z 挂起emacs C-X C-c 关闭emacs 光标移动基本快捷键(Basic Movement) C-f 后一个字符 C-b 前一个字符 C-p 上一行 C-n [...]]]></description>
			<content:encoded><![CDATA[<p>网上看到的，觉得非常不错，给转到这里来了<br />
本文在署名-非商业性使用-相同方式共享 3.0版权协议下发布, 转载请注明出自aifreedom.com</p>
<p>C = Control<br />
M = Meta = Alt|Esc<br />
Del = Backspace</p>
<p>基本快捷键(Basic)<br />
C-x C-f &#8220;find&#8221;文件, 即在缓冲区打开/新建一个文件<br />
C-x C-s 保存文件<br />
C-x C-w 使用其他文件名另存为文件<br />
C-x C-v 关闭当前缓冲区文件并打开新文件<br />
C-x i 在当前光标处插入文件<br />
C-x b 新建/切换缓冲区<br />
C-x C-b 显示缓冲区列表<br />
C-x k 关闭当前缓冲区<br />
C-z 挂起emacs<br />
C-X C-c 关闭emacs</p>
<p>光标移动基本快捷键(Basic Movement)<br />
C-f 后一个字符<br />
C-b 前一个字符<br />
C-p 上一行<br />
C-n 下一行<br />
M-f 后一个单词<br />
M-b 前一个单词<br />
C-a 行首<br />
C-e 行尾<br />
C-v 向下翻一页<br />
M-v 向上翻一页<br />
M-< 到文件开头<br />
M-> 到文件末尾</p>
<p>编辑(Editint)<br />
M-n 重复执行后一个命令n次<br />
C-u 重复执行后一个命令4次<br />
C-u n 重复执行后一个命令n次<br />
C-d 删除(delete)后一个字符<br />
M-d 删除后一个单词<br />
Del 删除前一个字符<br />
M-Del 删除前一个单词<br />
C-k 移除(kill)一行</p>
<p>C-Space 设置开始标记 (例如标记区域)<br />
C-@ 功能同上, 用于C-Space被操作系统拦截的情况<br />
C-w 移除(kill)标记区域的内容<br />
M-w 复制标记区域的内容<br />
C-y 召回(yank)复制/移除的区域/行<br />
M-y 召回更早的内容 (在kill缓冲区内循环)<br />
C-x C-x 交换光标和标记</p>
<p>C-t 交换两个字符的位置<br />
M-t 交换两个单词的位置<br />
C-x C-t 交换两行的位置<br />
M-u 使从光标位置到单词结尾处的字母变成大写<br />
M-l 与M-u相反<br />
M-c 使从光标位置开始的单词的首字母变为大写</p>
<p>重要快捷键(Important)<br />
C-g 停止当前运行/输入的命令<br />
C-x u 撤销前一个命令<br />
M-x revert-buffer RETURN (照着这个输入)撤销上次存盘后所有改动<br />
M-x recover-file RETURN 从自动存盘文件恢复<br />
M-x recover-session RETURN 如果你编辑了几个文件, 用这个恢复</p>
<p>在线帮助(Online-Help)<br />
C-h c 显示快捷键绑定的命令<br />
C-h k 显示快捷键绑定的命令和它的作用<br />
C-h l 显示最后100个键入的内容<br />
C-h w 显示命令被绑定到哪些快捷键上<br />
C-h f 显示函数的功能<br />
C-h v 显示变量的含义和值<br />
C-h b 显示当前缓冲区所有可用的快捷键<br />
C-h t 打开emacs教程<br />
C-h i 打开info阅读器<br />
C-h C-f 显示emacs FAQ<br />
C-h p 显示本机Elisp包的信息</p>
<p>搜索/替换(Seach/Replace)<br />
C-s 向后搜索<br />
C-r 向前搜索<br />
C-g 回到搜索开始前的位置(如果你仍然在搜索模式中)<br />
M-% 询问并替换(query replace)</p>
<p>Space或y 替换当前匹配<br />
Del或n 不要替换当前匹配<br />
. 仅仅替换当前匹配并退出(替换)<br />
, 替换并暂停(按Space或y继续)<br />
! 替换以下所有匹配<br />
^ 回到上一个匹配位置<br />
RETURN或q 退出替换</p>
<p>使用正则表达式(Regular expression)搜索/替换<br />
可在正则表达式中使用的符号:<br />
^ 行首<br />
$ 行尾<br />
. 单个字符<br />
.* 任意多个(包括没有)字符<br />
\< 单词开头<br />
\> 单词结尾<br />
[] 括号中的任意一个字符(例如[a-z]表示所有的小写字母)</p>
<p>M C-s RETURN 使用正则表达式向后搜索<br />
M C-r RETURN 使用正则表达式向前搜索<br />
C-s 增量搜索<br />
C-s 重复增量搜索<br />
C-r 向前增量搜索<br />
C-r 重复向前增量搜索<br />
M-x query-replace-regexp 使用正则表达式搜索并替换</p>
<p>窗口命令(Window Commands)<br />
C-x 2 水平分割窗格<br />
C-x 3 垂直分割窗格<br />
C-x o 切换至其他窗格<br />
C-x 0 关闭窗格<br />
C-x 1 关闭除了光标所在窗格外所有窗格<br />
C-x ^ 扩大窗格<br />
M-x shrink-window 缩小窗格<br />
M C-v 滚动其他窗格内容<br />
C-x 4 f 在其他窗格中打开文件<br />
C-x 4 0 关闭当前缓冲区和窗格<br />
C-x 5 2 新建窗口(frame)<br />
C-x 5 f 在新窗口中打开文件<br />
C-x 5 o 切换至其他窗口<br />
C-x 5 0 关闭当前窗口</p>
<p>书签命令(Bookmark commands)<br />
C-x r m 在光标当前位置创建书签<br />
C-x r b 转到书签<br />
M-x bookmark-rename 重命名书签<br />
M-x bookmark-delete 删除书签<br />
M-x bookmark-save 保存书签<br />
C-x r l 列出书签清单</p>
<p>d 标记等待删除<br />
Del 取消删除标记<br />
x 删除被标记的书签<br />
r 重命名<br />
s 保存列表内所有书签<br />
f 转到当前书签指向的位置<br />
m 标记在多窗口中打开<br />
v 显示被标记的书签(或者光标当前位置的书签)<br />
t 切换是否显示路径列表<br />
w 显示当前文件路径<br />
q 退出书签列表</p>
<p>M-x bookmark-write 将所有书签导出至指定文件<br />
M-x bookmark-load 从指定文件导入书签</p>
<p>Shell<br />
M-x shell 打开shell模式<br />
C-c C-c 类似unix里的C-c(停止正在运行的程序)<br />
C-d 删除光标后一个字符<br />
C-c C-d 发送EOF<br />
C-c C-z 挂起程序(unix下的C-z)<br />
M-p 显示前一条命令<br />
M-n 显示后一条命令</p>
<p>DIRectory EDitor (dired)<br />
C-x d 打开dired<br />
C(大写C) 复制<br />
d 标记等待删除<br />
D 立即删除<br />
e或f 打开文件或目录<br />
g 刷新当前目录<br />
G 改变文件所属组(chgrp)<br />
k 从屏幕上的列表里删除一行(不是真的删除)<br />
m 用*标记<br />
n 光标移动到下一行<br />
o 在另一个窗格打开文件并移动光标<br />
C-o 在另一个窗格打开文件但不移动光标<br />
P 打印文件<br />
q 退出dired<br />
Q 在标记的文件中替换<br />
R 重命名文件<br />
u 移除标记<br />
v 显示文件内容<br />
x 删除有D标记的文件<br />
Z 压缩/解压缩文件<br />
M-Del 移除标记(默认为所有类型的标记)<br />
~ 标记备份文件(文件名有~的文件)等待删除<br />
# 标记自动保存文件(文件名形如#name#)等待删除<br />
*/ 用*标记所有文件夹(用C-u */n移除标记)<br />
= 将当前文件和标记文件(使用C-@标记而不是dired的m标记)比较<br />
M-= 将当前文件和它的备份比较<br />
! 对当前文件应用shell命令<br />
M-} 移动光标至下一个用*或D标记的文件<br />
M-{ 移动光标至上一个用*或D标记的文件<br />
% d 使用正则表达式标记文件等待删除<br />
% m 使用正则表达式标记文件为*<br />
+ 新建文件夹<br />
> 移动光标至后一个文件夹<br />
< 移动光标至前一个文件夹<br />
s 切换排序模式(按文件名/日期)</p>
<p>或许把这个命令归入这一类也很合适:<br />
M-x speedbar 打开一个独立的目录显示窗口</p>
<p>Telnet<br />
M-x telnet 打开telnet模式<br />
C-d 删除后一个字符或发送EOF<br />
C-c C-c 停止正在运行的程序(和unix下的C-c类似)<br />
C-c C-d 发送EOF<br />
C-c C-o 清除最后一个命令的输出<br />
C-c C-z 挂起正在运行的命令<br />
C-c C-u 移除前一行<br />
M-p 显示前一条命令</p>
<p>Text<br />
只能在text模式里使用<br />
M-s 使当前行居中<br />
M-S 使当前段落居中<br />
M-x center-region 使被选中的区域居中</p>
<p>宏命令(Macro-commands)<br />
C-x ( 开始定义宏<br />
C-x ) 结束定义宏<br />
C-x e 运行最近定义的宏<br />
M-n C-x e 运行最近定义的宏n次<br />
M-x name-last-kbd-macro 给最近定义的宏命名(用来保存)<br />
M-x insert-kbd-macro 将已命名的宏保存到文件<br />
M-x load-file 载入宏</p>
<p>编程(Programming)<br />
M C-\ 自动缩进光标和标记间的区域<br />
M-m 移动光标到行首第一个(非空格)字符<br />
M-^ 将当前行接到上一行末尾处<br />
M-; 添加缩进并格式化的注释<br />
C, C++和Java模式<br />
M-a 移动光标到声明的开始处<br />
M-e 移动光标到声明的结尾处<br />
M C-a 移动光标到函数的开始处<br />
M C-e 移动光标到函数的结尾处<br />
C-c RETURN 将光标移动到函数的开始处并标记到结尾处<br />
C-c C-q 根据缩进风格缩进整个函数<br />
C-c C-a 切换自动换行功能<br />
C-c C-d 一次性删除光标后的一串空格(greedy delete)</p>
<p>为了实现下面的一些技术, 你需要在保存源代码的目录里运行&#8221;etags<br />
*.c *.h *.cpp&#8221;(或者源代码的其他的扩展名)<br />
M-.(点) 搜索标签<br />
M-x tags-search ENTER 在所有标签里搜索(使用正则表达式)<br />
M-,(逗号) 在tags-search里跳至下一个匹配处<br />
M-x tags-query-replace 在设置过标签的所有文件里替换文本</p>
<p>GDB(调试器)<br />
M-x gdb 在另一个的窗格中打开gdb</p>
<p>版本控制(Version Control)<br />
C-x v d 显示当前目录下所有注册过的文件(show all registered files in this dir)<br />
C-x v = 比较不同版本间的差异(show diff between versions)<br />
C-x v u 移除上次提交之后的更改(remove all changes since last checkin)<br />
C-x v ~ 在不同窗格中显示某个版本(show certain version in different window)<br />
C-x v l 打印日志(print log)<br />
C-x v i 标记文件等待添加版本控制(mark file for version control add)<br />
C-x v h 给文件添加版本控制文件头(insert version control header into file)<br />
C-x v r 获取命名过的快照(check out named snapshot)<br />
C-x v s 创建命名的快照(create named snapshot)<br />
C-x v a 创建gnu风格的更改日志(create changelog file in gnu-style)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/599/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux webserver 常用维护命令</title>
		<link>http://www.9wy.net/archives/551</link>
		<comments>http://www.9wy.net/archives/551#comments</comments>
		<pubDate>Fri, 20 Mar 2009 01:03:22 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://9wy.net/?p=551</guid>
		<description><![CDATA[这里是维护时常用的一些命令，放在这里，备忘 注：大部分非原创，只是收集到这里而已 * 实时查看正在执行的sql语句 1./usr/sbin/tcpdump -i eth0 -s 0 -l -w &#8211; dst port 3306 &#124; strings &#124; egrep -i &#8216;SELECT&#124;UPDATE&#124;DELETE&#124;INSERT&#124;SET&#124;COMMIT&#124;ROLLBACK&#124;CREATE&#124;DROP&#124;ALTER&#124;CALL&#8217; * 查看http连接 1.netstat -n &#124; awk &#8216;/^tcp/ {++state[$NF]} END {for(key in state) print key,&#8221;\t&#8221;,state[key]}&#8217; * 查看SYN状态的http连接 1.netstat -an &#124; grep SYN &#124; awk &#8216;{print $5}&#8217; &#124; awk -F: &#8216;{print $1}&#8217; &#124; sort &#124; uniq [...]]]></description>
			<content:encoded><![CDATA[<p>这里是维护时常用的一些命令，放在这里，备忘</p>
<p><span style="color: #ff0000;">注：大部分非原创，只是收集到这里而已</span></p>
<p>* 实时查看正在执行的sql语句<br />
1./usr/sbin/tcpdump -i eth0 -s 0 -l -w &#8211; dst port 3306 | strings | egrep -i &#8216;SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER|CALL&#8217;</p>
<p>* 查看http连接<br />
1.netstat -n | awk &#8216;/^tcp/ {++state[$NF]} END {for(key in state) print key,&#8221;\t&#8221;,state[key]}&#8217;</p>
<p>* 查看SYN状态的http连接<br />
1.netstat -an | grep SYN | awk &#8216;{print $5}&#8217; | awk -F: &#8216;{print $1}&#8217; | sort | uniq -c | sort -nr | more</p>
<p>* 查看TIME_WAIT状态的http连接<br />
1.netstat -tna | cut -b 49- |grep TIME_WAIT | sort |more<br />
2.netstat -an | grep TIME_WAIT | awk &#8216;{print $5}&#8217; | awk -F: &#8216;{print $1}&#8217; | sort | uniq -c | sort -nr | more</p>
<p>* 查看ESTABLISHED状态的http连接<br />
1.netstat -an | grep ESTABLISHED | awk &#8216;{print $5}&#8217; | awk -F: &#8216;{print $1}&#8217; | sort | uniq -c | sort -nr | more<br />
2.netstat -an | grep &#8220;:80&#8243; | grep ESTABLISHED | sort | more</p>
<p>* 批量kill进程<br />
1.ps -efww|grep sqlr-listener|grep -v grep|cut -c 9-15|xargs kill -9</p>
<p>* 查看活动的php-cgi连接数<br />
1.netstat -anpo|grep php-cgi|wc -l</p>
<p>* 按ip查看httpd连接数<br />
1.netstat -anlp | grep 80 | grep tcp | awk {&#8216;print $5&#8242;} | awk -F: {&#8216;print $1&#8242;}| sort |uniq -c | sort -nr</p>
<p>* 禁IP<br />
1.iptables -A INPUT -s IP地址 -j REJECT<br />
2.iptables -A INPUT -s IP地址/24 -j REJECT<br />
3.route add -net IP地址 netmask 255.255.255.0 reject</p>
<p>* 调试命令<br />
1.strace -p pid</p>
<p>* 跟踪指定的进程pid.<br />
1.gdb -p pid</p>
<p>* 跟踪指定的进程pid.</p>
<p>* 批量查找文件并删除<br />
1.find . -name test.php -exec rm {} \;<br />
2.find . -name test.php | xargs rm -rf</p>
<p>* 更改某一目录下所有目录的权限, 不包括文件, aaa 是目录名<br />
1.find aaa -type d -exec chmod 755 {} \;</p>
<p>* 替换文件内容<br />
1.sed -i &#8216;s/b/strong/g&#8217; index.html</p>
<p>此命令搜索 index.html 文件中的 b 并将其替换为 strong。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/551/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在windows下用dbg在emacs里面调试程序</title>
		<link>http://www.9wy.net/archives/234</link>
		<comments>http://www.9wy.net/archives/234#comments</comments>
		<pubDate>Tue, 09 Dec 2008 22:04:27 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[SoftWare]]></category>
		<category><![CDATA[EMACS]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.csbde.cn/?p=290</guid>
		<description><![CDATA[在windows下面也可以用gdb调试程序了.跟在linux下面一样,先到mingw的主页 http://sourceforge.net/projects/mingw/,下载gdb包来安装,地址: http://sourceforge.net/project/showfiles.php?group_id=2435&#38;package_id=20507 选择适合的版本下载(我选择的是gdb-6.8-mingw-3.tar.bz2),下载后解压就会得到 几个文件夹,跟mingw下面的文件夹是一一对应的,直接复制过去就可以了, 调试上图: 使用: 当你在Emacs里面编辑好文件以后,编译.记得编译时要添加编译选项g, 比如我编译test.cpp时使用的是 g++ -ggdb3 test.cpp -o test.exe ,编译好以后就可以进行调试了,M-x gdba RET,你就会看到上面这样的图片了,开始你的调试之旅吧]]></description>
			<content:encoded><![CDATA[<p>在windows下面也可以用gdb调试程序了.跟在linux下面一样,先到mingw的主页</p>
<p>http://sourceforge.net/projects/mingw/,下载gdb包来安装,地址:</p>
<p>http://sourceforge.net/project/showfiles.php?group_id=2435&amp;package_id=20507</p>
<p>选择适合的版本下载(我选择的是gdb-6.8-mingw-3.tar.bz2),下载后解压就会得到<br />
几个文件夹,跟mingw下面的文件夹是一一对应的,直接复制过去就可以了,<br />
调试上图:<br />
<img src="http://www.9wy.net/wp-content/uploads/2008/12/screen_gdb.png" alt="screen_gdb" title="screen_gdb" width="614" height="442" class="alignnone size-full wp-image-393" /></p>
<p>使用:<br />
当你在Emacs里面编辑好文件以后,编译.记得编译时要添加编译选项g,<br />
比如我编译test.cpp时使用的是 g++ -ggdb3 test.cpp -o test.exe<br />
,编译好以后就可以进行调试了,M-x gdba RET,你就会看到上面这样的图片了,开始你的调试之旅吧</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/234/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>打造适合自己的System</title>
		<link>http://www.9wy.net/archives/179</link>
		<comments>http://www.9wy.net/archives/179#comments</comments>
		<pubDate>Tue, 14 Oct 2008 04:02:50 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[SoftWare]]></category>
		<category><![CDATA[CMD]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Font]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.csbde.cn/?p=206</guid>
		<description><![CDATA[下面是自己的一些步骤仅供参考： 打造适合自己的系统 1 增加快捷键 1.1 增加Ctrl+R快捷命令行命令 1.1 建立sort目录，将常用操作快捷方式加入到其中（记得将名字改成简单易记的英文 名字），并将sort目录添加到系统环境path中。 2 软件设置 2.1 下载将firefox。 2.2 firefox AddonList 2.2.1 Ietab *2.2.2 vimperator 2.2.3 firebug *2.2.4 google toolbar(只用书签功能） 2.2.5 Adblock Plus 2.2.6 Autofile Forms *2.2.7 User Agent Switcher *2.2.8 Web Developer 2.2 下载VIM，下载自己的VIM配置文件 ?View Code VIM&#34; author: feelinglucky&#60;i.feelinglucky@gmail.com&#62; &#34; modify: Simon&#60;csbdess@gmail.com &#34; website: http://csbde.cn &#34; date: 2008-10-07 &#34; [...]]]></description>
			<content:encoded><![CDATA[<p>下面是自己的一些步骤仅供参考：<br />
打造适合自己的系统<br />
1 增加快捷键<br />
1.1 增加Ctrl+R快捷命令行命令<br />
1.1 建立sort目录，将常用操作快捷方式加入到其中（记得将名字改成简单易记的英文<br />
名字），并将sort目录添加到系统环境path中。<br />
<span id="more-179"></span><br />
2 软件设置</p>
<li>2.1 下载将firefox。
<li>2.2 firefox AddonList
<li>2.2.1 Ietab
<li>*2.2.2 vimperator
<li>2.2.3 firebug
<li>*2.2.4 google toolbar(只用书签功能）
<li>2.2.5 Adblock Plus
<li>2.2.6 Autofile Forms
<li>*2.2.7 User Agent Switcher
<li>*2.2.8 Web Developer</li>
<p>2.2 下载VIM，下载自己的VIM配置文件</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p179code2'); return false;">View Code</a> VIM</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1792"><td class="code" id="p179code2"><pre class="vim" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">&quot;  author: feelinglucky&lt;i.feelinglucky@gmail.com&gt;</span>
<span style="color: #adadad; font-style: italic;">&quot;  modify:  Simon&lt;csbdess@gmail.com</span>
<span style="color: #adadad; font-style: italic;">&quot; website: http://csbde.cn</span>
<span style="color: #adadad; font-style: italic;">&quot;    date: 2008-10-07</span>
<span style="color: #adadad; font-style: italic;">
&quot; 在处理未保存或只读文件的时候，弹出确认</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">confirm</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">linebreak</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">textwidth</span>=<span style="color: #000000; font-weight:bold;">80</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">nocompatible</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">backspace</span>=<span style="color: #000000; font-weight:bold;">2</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">history</span>=<span style="color: #000000; font-weight:bold;">400</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">ruler</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">number</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">hlsearch</span>
<span style="color: #adadad; font-style: italic;">&quot;逐字符高亮搜索词语</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">incsearch</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">expandtab</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">noerrorbells</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">novisualbell</span>
<span style="color: #adadad; font-style: italic;">&quot;高亮的时间</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">matchtime</span>=<span style="color: #000000; font-weight:bold;">5</span>
<span style="color: #adadad; font-style: italic;">&quot;close visual bell</span>
<span style="color: #804040;">set</span> t_vb=
<span style="color: #804040;">set</span> <span style="color: #668080;">foldmethod</span>=marker
<span style="color: #804040;">set</span> <span style="color: #668080;">tabstop</span>=<span style="color: #000000; font-weight:bold;">4</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">shiftwidth</span>=<span style="color: #000000; font-weight:bold;">4</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">nobackup</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">nowritebackup</span>
<span style="color: #adadad; font-style: italic;">&quot;set noswapfile</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">smarttab</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">smartindent</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">autoindent</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">cindent</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">wrap</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">autoread</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">cmdheight</span>=<span style="color: #000000; font-weight:bold;">1</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">showtabline</span>=<span style="color: #000000; font-weight:bold;">2</span>
<span style="color: #adadad; font-style: italic;">&quot;和其他程序共用剪贴(Windows)</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">clipboard</span><span style="color: #000000;">+</span>=unnamed
<span style="color: #804040;">set</span> <span style="color: #668080;">tabpagemax</span>=<span style="color: #000000; font-weight:bold;">20</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">laststatus</span>=<span style="color: #000000; font-weight:bold;">2</span>
<span style="color: #adadad; font-style: italic;">&quot;状态栏</span>
<span style="color: #adadad; font-style: italic;">&quot;set statusline=%F%m%r%h [%{&amp;ff}] [%Y] %w  %=[POS] %l,%c %=%P</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">statusline</span>= <span style="color: #000000;">%</span>F<span style="color: #000000;">%</span>m<span style="color: #000000;">%</span>r<span style="color: #000000;">%</span>h <span style="color: #000000;">%</span>w <span style="color: #000000;">&#91;</span>PWD<span style="color: #000000;">&#93;</span> <span style="color: #000000;">%</span>r<span style="color: #000000;">%</span><span style="color: #000000;">&#123;</span>CurrectDir<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">%</span>h  <span style="color: #000000;">%</span>=<span style="color: #000000;">&#91;</span><span style="color: #000000;">%</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&amp;</span>fenc==<span style="color: #C5A22D;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">?&amp;</span>enc<span style="color: #000000;">:&amp;</span>fenc<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#91;</span>POS<span style="color: #000000;">&#93;</span> <span style="color: #000000;">%</span>l,<span style="color: #000000;">%</span>c <span style="color: #000000;">%</span>= <span style="color: #000000;">%</span>P
<span style="color: #C5A22D;">&quot;set statusline=%F%m%r%h%w [FORMAT=%{&amp;ff}] [TYPE=%Y] [POS=%l,%v][%p%%] %{strftime(&quot;</span><span style="color: #000000;">%</span>d<span style="color: #000000;">/%</span>m<span style="color: #000000;">/%</span>y <span style="color: #000000;">-</span> <span style="color: #000000;">%</span>H<span style="color: #000000;">:%</span>M<span style="color: #C5A22D;">&quot;)}[PWD] %r%{CurrectDir()}%h
function! CurrectDir()
    return substitute(getcwd(), &quot;</span><span style="color: #C5A22D;">&quot;, &quot;</span><span style="color: #C5A22D;">&quot;, &quot;</span>g<span style="color: #C5A22D;">&quot;)
endfunction
let g:calendar_diary=$VIM
&nbsp;
&quot;</span> 配置多语言环境
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;multi_byte&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">set</span> <span style="color: #668080;">encoding</span>=utf<span style="color: #000000;">-</span><span style="color: #000000; font-weight:bold;">8</span>
    <span style="color: #804040;">set</span> <span style="color: #668080;">termencoding</span>=utf<span style="color: #000000;">-</span><span style="color: #000000; font-weight:bold;">8</span>
    <span style="color: #804040;">set</span> <span style="color: #668080;">formatoptions</span><span style="color: #000000;">+</span>=mM
    <span style="color: #804040;">set</span> <span style="color: #668080;">fencs</span>=utf<span style="color: #000000;">-</span><span style="color: #000000; font-weight:bold;">8</span>,gbk
&nbsp;
    <span style="color: #804040;">if</span> v<span style="color: #000000;">:</span>lang =<span style="color: #000000;">~?</span> <span style="color: #C5A22D;">'^(zh)|(ja)|(ko)'</span>
        <span style="color: #804040;">set</span> <span style="color: #668080;">ambiwidth</span>=double
    <span style="color: #804040;">endif</span>
&nbsp;
    <span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
        source <span style="color: #000000;">$</span>VIMRUNTIME<span style="color: #000000;">/</span>delmenu<span style="color: #000000;">.</span>vim
        source <span style="color: #000000;">$</span>VIMRUNTIME<span style="color: #000000;">/</span>menu<span style="color: #000000;">.</span>vim
        source <span style="color: #000000;">$</span>VIMRUNTIME<span style="color: #000000;">/</span>mswin<span style="color: #000000;">.</span>vim
        behave mswin
        language messages zh_CN<span style="color: #000000;">.</span>utf<span style="color: #000000;">-</span><span style="color: #000000; font-weight:bold;">8</span>
    <span style="color: #804040;">endif</span>
<span style="color: #804040;">else</span>
    <span style="color: #804040;">echoerr</span> <span style="color: #C5A22D;">&quot;Sorry, this version of (g)vim was not compiled with +multi_byte&quot;</span>
<span style="color: #804040;">endif</span>
&nbsp;
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'gui_running'</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
        source <span style="color: #000000;">$</span>VIMRUNTIME<span style="color: #000000;">/</span>mswin<span style="color: #000000;">.</span>vim
    <span style="color: #804040;">endif</span>
<span style="color: #adadad; font-style: italic;">
    &quot; Always show file types in menu</span>
    <span style="color: #804040;">let</span> do_syntax_sel_menu=<span style="color: #000000; font-weight:bold;">1</span>
&nbsp;
    unmap  <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>Y<span style="color: #000000;">&gt;|</span>  <span style="color: #C5A22D;">&quot; &lt;c-Y&gt; for Redo is kept in insert mode
    iunmap &lt;c-A&gt;|  &quot;</span> <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>A<span style="color: #000000;">&gt;</span> <span style="color: #804040;">for</span> Select<span style="color: #000000;">-</span>All <span style="color: #668080;">is</span> kept <span style="color: #804040;">in</span> normal <span style="color: #25BB4D;">mode</span>
<span style="color: #adadad; font-style: italic;">    &quot; Key mapping to switch windows quickly (&lt;c-Tab&gt; is already mapped)</span>
    <span style="color: #804040;">nnoremap</span> <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>S<span style="color: #000000;">-</span>Tab<span style="color: #000000;">&gt;</span> <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>W<span style="color: #000000;">&gt;</span>W
    inoremap <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>S<span style="color: #000000;">-</span>Tab<span style="color: #000000;">&gt;</span> <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>O<span style="color: #000000;">&gt;&lt;</span>c<span style="color: #000000;">-</span>W<span style="color: #000000;">&gt;</span>W
<span style="color: #adadad; font-style: italic;">
    &quot; 针对 Windows 的配置</span>
    <span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #804040;">set</span> <span style="color: #668080;">guifont</span>=新宋体<span style="color: #000000;">:</span>h10<span style="color: #000000;">:</span>cGB2312
<span style="color: #adadad; font-style: italic;">       &quot; set guifontwide=YaHei Consolas Hybrid:h10</span>
        <span style="color: #C5A22D;">&quot;au GUIEnter * simalt ~x &quot;</span> 最大化窗口
         <span style="color: #804040;">set</span> <span style="color: #668080;">lines</span>=<span style="color: #000000; font-weight:bold;">30</span>
        <span style="color: #804040;">set</span> <span style="color: #668080;">columns</span>=<span style="color: #000000; font-weight:bold;">85</span>
    <span style="color: #804040;">elseif</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;unix&quot;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #804040;">set</span> <span style="color: #668080;">guifont</span>=
        <span style="color: #804040;">set</span> <span style="color: #668080;">guifontwide</span>=
    <span style="color: #804040;">elseif</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;mac&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">||</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;macunix&quot;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #804040;">set</span> <span style="color: #668080;">guifont</span>=
        <span style="color: #804040;">set</span> <span style="color: #668080;">guifontwide</span>=
    <span style="color: #804040;">endif</span>
&nbsp;
    <span style="color: #804040;">colorscheme</span> desert
    <span style="color: #804040;">set</span> <span style="color: #668080;">guioptions</span>=
    <span style="color: #804040;">set</span> <span style="color: #668080;">guioptions</span><span style="color: #000000;">+</span>=r
    <span style="color: #804040;">set</span> <span style="color: #668080;">cursorline</span>
<span style="color: #804040;">else</span>
<span style="color: #adadad; font-style: italic;">    &quot; English messages only</span>
<span style="color: #adadad; font-style: italic;">    &quot;language messages en</span>
<span style="color: #adadad; font-style: italic;">
    &quot; set the default theme in no-GUI</span>
    <span style="color: #804040;">colorscheme</span> default
<span style="color: #adadad; font-style: italic;">
    &quot; Do not increase the windows width in taglist</span>
    <span style="color: #804040;">let</span> Tlist_Inc_Winwidth=<span style="color: #000000; font-weight:bold;">0</span>
<span style="color: #adadad; font-style: italic;">
    &quot; Set text-mode menu</span>
    <span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'wildmenu'</span><span style="color: #000000;">&#41;</span>
        <span style="color: #804040;">set</span> <span style="color: #668080;">wildmenu</span>
        <span style="color: #804040;">set</span> cpoptions<span style="color: #000000;">-</span>=<span style="color: #000000;">&lt;</span>
        <span style="color: #804040;">set</span> <span style="color: #668080;">wildcharm</span>=<span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>Z<span style="color: #000000;">&gt;</span>
        nmap <span style="color: #000000;">&lt;</span>f10<span style="color: #000000;">&gt;</span>      <span style="color: #000000;">:</span>emenu <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>Z<span style="color: #000000;">&gt;</span>
        imap <span style="color: #000000;">&lt;</span>f10<span style="color: #000000;">&gt;</span> <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>O<span style="color: #000000;">&gt;:</span>emenu <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>Z<span style="color: #000000;">&gt;</span>
    <span style="color: #804040;">endif</span>
<span style="color: #adadad; font-style: italic;">
    &quot; Change encoding according to the current console code page</span>
    <span style="color: #804040;">if</span> <span style="color: #000000;">&amp;</span>termencoding <span style="color: #000000;">!</span>= <span style="color: #C5A22D;">''</span> <span style="color: #000000;">&amp;&amp;</span> <span style="color: #000000;">&amp;</span>termencoding <span style="color: #000000;">!</span>= <span style="color: #000000;">&amp;</span>encoding
        <span style="color: #804040;">let</span> <span style="color: #000000;">&amp;</span>encoding=<span style="color: #000000;">&amp;</span>termencoding
        <span style="color: #804040;">let</span> <span style="color: #000000;">&amp;</span>fileencodings=<span style="color: #C5A22D;">'ucs-bom,utf-8,'</span> <span style="color: #000000;">.</span> <span style="color: #000000;">&amp;</span>encoding
    <span style="color: #804040;">endif</span>
<span style="color: #804040;">endif</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;autocmd&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">filetype</span> <span style="color: #25BB4D;">plugin</span> <span style="color: #25BB4D;">indent</span> <span style="color: #25BB4D;">on</span>
<span style="color: #adadad; font-style: italic;">   &quot; autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number</span>
&nbsp;
    <span style="color: #804040;">augroup</span> vimrcEx
        <span style="color: #804040;">au</span><span style="color: #000000;">!</span>
        <span style="color: #804040;">autocmd</span> <span style="color: #25BB4D;">FileType</span> text <span style="color: #804040;">setlocal</span> <span style="color: #668080;">textwidth</span>=<span style="color: #000000; font-weight:bold;">80</span>
        <span style="color: #804040;">autocmd</span> <span style="color: #25BB4D;">BufReadPost</span> <span style="color: #000000;">*</span>
                     <span style="color: #804040;">if</span> <span style="color: #25BB4D;">line</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;'&quot;</span><span style="color: #C5A22D;">&quot;) &gt; 0 &amp;&amp; line(&quot;</span><span style="color: #C5A22D;">'&quot;&quot;) &lt;= line(&quot;$&quot;) |
                       exe &quot;normal g`&quot;&quot; |
                     endif
    augroup END
    function! AutoClose()
        :inoremap ( ()&lt;esc&gt;i
        :inoremap &quot; &quot;&quot;&lt;esc&gt;i
        :inoremap '</span> <span style="color: #C5A22D;">''</span><span style="color: #000000;">&lt;</span>esc<span style="color: #000000;">&gt;</span>i
        <span style="color: #000000;">:</span>inoremap <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&lt;</span>esc<span style="color: #000000;">&gt;</span>i
        <span style="color: #000000;">:</span>inoremap <span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&lt;</span>esc<span style="color: #000000;">&gt;</span>i
        <span style="color: #000000;">:</span>inoremap <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>r<span style="color: #000000;">&gt;</span>=ClosePair<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">')'</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;cr&gt;</span>
        <span style="color: #000000;">:</span>inoremap <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>r<span style="color: #000000;">&gt;</span>=ClosePair<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'}'</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;cr&gt;</span>
        <span style="color: #000000;">:</span>inoremap <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>r<span style="color: #000000;">&gt;</span>=ClosePair<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">']'</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;cr&gt;</span>
    endf
&nbsp;
    <span style="color: #804040;">function</span><span style="color: #000000;">!</span> ClosePair<span style="color: #000000;">&#40;</span>char<span style="color: #000000;">&#41;</span>
        <span style="color: #804040;">if</span> <span style="color: #25BB4D;">getline</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'.'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #25BB4D;">col</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'.'</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span> == a<span style="color: #000000;">:</span>char
            <span style="color: #804040;">return</span> <span style="color: #C5A22D;">&quot;&lt;right&gt;&quot;</span>
        <span style="color: #804040;">else</span>
            <span style="color: #804040;">return</span> a<span style="color: #000000;">:</span>char
        <span style="color: #804040;">endif</span>
    endf
<span style="color: #adadad; font-style: italic;">
    &quot;auto close for PHP and Javascript script</span>
    <span style="color: #804040;">au</span> <span style="color: #25BB4D;">FileType</span> php,c,cpp,h,python,javascript <span style="color: #804040;">exe</span> AutoClose<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #804040;">endif</span>
<span style="color: #adadad; font-style: italic;">&quot;Other Setting</span>
<span style="color: #adadad; font-style: italic;">&quot;语法高亮</span>
<span style="color: #804040;">syntax</span> <span style="color: #25BB4D;">on</span>
<span style="color: #adadad; font-style: italic;">&quot; key stock</span>
<span style="color: #adadad; font-style: italic;">
&quot;绑定自动补全的快捷键&lt;c-X&gt;&lt;c-O&gt;到&lt;leader&gt;;</span>
imap <span style="color: #000000;">&lt;</span>leader<span style="color: #000000;">&gt;</span>; <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>X<span style="color: #000000;">&gt;&lt;</span>c<span style="color: #000000;">-</span>O<span style="color: #000000;">&gt;</span>
<span style="color: #adadad; font-style: italic;">
&quot;ca日记h</span>
<span style="color: #804040;">map</span> ca <span style="color: #000000;">:</span>Calendar<span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
<span style="color: #adadad; font-style: italic;">&quot;设定开关Taglist插件的快捷键为F4，可以在VIM的左侧栏列出函数列表等</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>f4<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span>Tlist<span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
<span style="color: #adadad; font-style: italic;">
&quot;设置程序的编译运行和调试的快捷键F5，F6，Ctrl-F5</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>f5<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span><span style="color: #804040;">call</span> CompileRun<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;cr&gt;</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>f7<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span><span style="color: #804040;">call</span> Debug<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;cr&gt;</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>f6<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span><span style="color: #804040;">call</span> Run<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #668080;">&lt;cr&gt;</span>
<span style="color: #adadad; font-style: italic;">
&quot;设置代码格式化快捷键F3</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>f2<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span>s<span style="color: #000000;">/^////</span><span style="color: #668080;">&lt;cr&gt;</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>f3<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span>s<span style="color: #000000;">/^////</span><span style="color: #668080;">&lt;cr&gt;</span>
<span style="color: #adadad; font-style: italic;">&quot;设置tab操作的快捷键，绑定:tabnew到&lt;leader&gt;t，绑定:tabn, :tabp到&lt;leader&gt;n,</span>
<span style="color: #adadad; font-style: italic;">&quot;&lt;leader&gt;p</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>leader<span style="color: #000000;">&gt;</span>t <span style="color: #000000;">:</span>tabnew<span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>leader<span style="color: #000000;">&gt;</span>n <span style="color: #000000;">:</span>tabn<span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>leader<span style="color: #000000;">&gt;</span>p <span style="color: #000000;">:</span>tabp<span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
<span style="color: #adadad; font-style: italic;">
&nbsp;
&quot;使用&lt;leader&gt;e打开当前文件同目录中的文件</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;unix&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #804040;">map</span> ,e <span style="color: #000000;">:</span>e <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>R<span style="color: #000000;">&gt;</span>=<span style="color: #25BB4D;">expand</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;%:p:h&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">.</span> <span style="color: #C5A22D;">&quot;/&quot;</span> <span style="color: #668080;">&lt;cr&gt;</span>
<span style="color: #804040;">else</span>
<span style="color: #804040;">map</span> ,e <span style="color: #000000;">:</span>e <span style="color: #000000;">&lt;</span>c<span style="color: #000000;">-</span>R<span style="color: #000000;">&gt;</span>=<span style="color: #25BB4D;">expand</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;%:p:h&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">.</span> <span style="color: #C5A22D;">&quot;&quot;</span> <span style="color: #668080;">&lt;cr&gt;</span>
<span style="color: #804040;">endif</span>
<span style="color: #adadad; font-style: italic;">
&quot;定义CompileRun函数，用来调用进行编译和运行</span>
<span style="color: #804040;">func</span> CompileRun<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;w&quot;</span>
<span style="color: #adadad; font-style: italic;">&quot;C程序</span>
<span style="color: #804040;">if</span> <span style="color: #000000;">&amp;</span>filetype == <span style="color: #C5A22D;">'c'</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!del %&lt;.exe&quot;</span>
<span style="color: #804040;">else</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!rm %&lt;.exe&quot;</span>
<span style="color: #804040;">endif</span>
<span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!gcc % -o %&lt;.exe&quot;</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!%&lt;.exe&quot;</span>
<span style="color: #804040;">else</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!./%&lt;.exe&quot;</span>
<span style="color: #804040;">endif</span>
<span style="color: #804040;">else</span>
<span style="color: #804040;">if</span>    <span style="color: #000000;">&amp;</span>filetype == <span style="color: #C5A22D;">'cpp'</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!del %&lt;.exe&quot;</span>
<span style="color: #804040;">else</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!rm %&lt;.exe&quot;</span>
<span style="color: #804040;">endif</span>
<span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!g++ % -o %&lt;.exe&quot;</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!%&lt;.exe&quot;</span>
<span style="color: #804040;">else</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!./%&lt;.exe&quot;</span>
<span style="color: #804040;">endif</span>
<span style="color: #804040;">endif</span>
<span style="color: #804040;">endif</span>
endfunc
<span style="color: #adadad; font-style: italic;">&quot;结束定义CompileRun</span>
<span style="color: #adadad; font-style: italic;">
&quot;定义Run函数，用来调用进行编译和运行</span>
<span style="color: #804040;">func</span> Run<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;w&quot;</span>
<span style="color: #adadad; font-style: italic;">&quot;C程序</span>
<span style="color: #adadad; font-style: italic;">&quot;</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!%&lt;.exe&quot;</span>
<span style="color: #804040;">else</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!./%&lt;.exe&quot;</span>
<span style="color: #804040;">endif</span>
endfunc
<span style="color: #adadad; font-style: italic;">&quot;结束定义Run</span>
<span style="color: #adadad; font-style: italic;">
&nbsp;
&quot;定义Debug函数，用来调试程序</span>
<span style="color: #804040;">func</span> Debug<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;w&quot;</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;win32&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!del %&lt;.exe&quot;</span>
<span style="color: #804040;">else</span>
    <span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!rm %&lt;.exe&quot;</span>
<span style="color: #804040;">endif</span>
<span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!g++ % -g -o %&lt;.exe&quot;</span>
<span style="color: #804040;">exec</span> <span style="color: #C5A22D;">&quot;!gdb %&lt;.exe&quot;</span>
endfunc
<span style="color: #adadad; font-style: italic;">&quot;结束定义Debug</span></pre></td></tr></table></div>

<p>2.3 下载TC，以及TC设置文件</p>
]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/179/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VHCS install @ CentOS 4.2</title>
		<link>http://www.9wy.net/archives/61</link>
		<comments>http://www.9wy.net/archives/61#comments</comments>
		<pubDate>Mon, 10 Dec 2007 20:16:54 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CMD]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Proftpd]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.csbde.cn/archives/69.html</guid>
		<description><![CDATA[?View Code BASH空闲的时间安装VHCS，这个是用来做虚拟主机管理的，和CPANEL相比，VHCS是开源的，阿建用得着。 &#160; 根据VHCS的安装文档重写如下，以方便安装 &#160; 1. 安装OS &#160; choose &#34;server&#34; option during install firewall: open ssh/http/https/ftp/smtp ports selinux: disable &#40;warn still generates errors in VHCS&#41; select minimum install &#160; 安装类型选“自定义” 手动分区&#40;4G虚拟硬盘&#41; / ext3 2000M  swap 2*mem /var ext3 剩余空间&#40;用户数据在此分区上&#41; eth0 关闭DHCP,10.10.10.180/255.255.255.0 hostname: srv180.capno.com gateway: 10.10.10.1 dns: 202.106.0.20/202.106.196.115 Enable firewall,默认的四个服务全允许&#40;SSH/HTTP,HTTPS/FTP/SMTP&#41; SELinux: Disable 安装包选择：Minimal最小化安装&#40;676M&#41; &#160; 2. 基本配置 # useradd admin;passwd admin(以下操作凡未说明的都以root身份执行) [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p61code4'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p614"><td class="code" id="p61code4"><pre class="bash" style="font-family:monospace;">空闲的时间安装VHCS，这个是用来做虚拟主机管理的，和CPANEL相比，VHCS是开源的，阿建用得着。
&nbsp;
根据VHCS的安装文档重写如下，以方便安装
&nbsp;
<span style="color: #000000;">1</span>. 安装OS
&nbsp;
choose <span style="color: #ff0000;">&quot;server&quot;</span> option during <span style="color: #c20cb9; font-weight: bold;">install</span>
firewall: open ssh<span style="color: #000000; font-weight: bold;">/</span>http<span style="color: #000000; font-weight: bold;">/</span>https<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>smtp ports
selinux: disable <span style="color: #7a0874; font-weight: bold;">&#40;</span>warn still generates errors <span style="color: #000000; font-weight: bold;">in</span> VHCS<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">select</span> minimum <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
安装类型选“自定义”
手动分区<span style="color: #7a0874; font-weight: bold;">&#40;</span>4G虚拟硬盘<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">/</span> ext3 2000M
 swap <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">*</span>mem
<span style="color: #000000; font-weight: bold;">/</span>var ext3 剩余空间<span style="color: #7a0874; font-weight: bold;">&#40;</span>用户数据在此分区上<span style="color: #7a0874; font-weight: bold;">&#41;</span>
eth0 关闭DHCP,10.10.10.180<span style="color: #000000; font-weight: bold;">/</span>255.255.255.0
<span style="color: #c20cb9; font-weight: bold;">hostname</span>: srv180.capno.com
gateway: 10.10.10.1
dns: 202.106.0.20<span style="color: #000000; font-weight: bold;">/</span>202.106.196.115
Enable firewall,默认的四个服务全允许<span style="color: #7a0874; font-weight: bold;">&#40;</span>SSH<span style="color: #000000; font-weight: bold;">/</span>HTTP,HTTPS<span style="color: #000000; font-weight: bold;">/</span>FTP<span style="color: #000000; font-weight: bold;">/</span>SMTP<span style="color: #7a0874; font-weight: bold;">&#41;</span>
SELinux: Disable
安装包选择：Minimal最小化安装<span style="color: #7a0874; font-weight: bold;">&#40;</span>676M<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000;">2</span>. 基本配置
<span style="color: #666666; font-style: italic;"># useradd admin;passwd admin(以下操作凡未说明的都以root身份执行)</span>
使用<span style="color: #c20cb9; font-weight: bold;">ssh</span>客户端连接server
<span style="color: #666666; font-style: italic;"># vi /etc/fstab</span>
<span style="color: #007800;">LABEL</span>=<span style="color: #000000; font-weight: bold;">/</span>var              <span style="color: #000000; font-weight: bold;">/</span>var                    ext3    defaults,usrquota        <span style="color: #000000;">1</span> <span style="color: #000000;">2</span>
<span style="color: #666666; font-style: italic;"># touch /var/aquota.user;</span>
  <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>aquota.user;
  <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> remount <span style="color: #000000; font-weight: bold;">/</span>var;
  quotacheck <span style="color: #660033;">-avugm</span>
<span style="color: #666666; font-style: italic;"># server iptables stop;</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>rc3.d<span style="color: #000000; font-weight: bold;">/</span>S08iptables <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>rc3.d<span style="color: #000000; font-weight: bold;">/</span>K08iptables
<span style="color: #666666; font-style: italic;"># vi /etc/grub.conf timeout=1</span>
&nbsp;
删除以下无用的软件包<span style="color: #7a0874; font-weight: bold;">&#40;</span>iiimf-server,iiimf-csconv,iiimf-docs,iiimf-libs,xorg-x11-xfs并未安装<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;"># yum remove apmd autofs bluez-utils cups irda-utils</span>
isdn4k-utils pcmcia-cs <span style="color: #c20cb9; font-weight: bold;">sendmail</span>
ypbind xinetd
&nbsp;
上传需要的软件包VHCS至<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">/</span>
包含vhcs安装包，yum安装和升级包<span style="color: #7a0874; font-weight: bold;">&#40;</span>节约yum升级时间<span style="color: #7a0874; font-weight: bold;">&#41;</span>，编译好的包<span style="color: #7a0874; font-weight: bold;">&#40;</span>节约编译时间，第一次需要按官方文档自行编译<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;"># cd /home/admin/VHCS/;</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-p</span> yum_base<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>yum<span style="color: #000000; font-weight: bold;">/</span>base<span style="color: #000000; font-weight: bold;">/</span>packages<span style="color: #000000; font-weight: bold;">/</span>;
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-p</span> yum_update<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>yum<span style="color: #000000; font-weight: bold;">/</span>update<span style="color: #000000; font-weight: bold;">/</span>packages<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># rpm --import &lt;a href=&quot;http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt&quot;&gt;http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt&lt;/a&gt;</span>
<span style="color: #666666; font-style: italic;"># vi /etc/yum.repos.d/CentOS-Base.repo的[base]和[update]项，设置为较快的镜象，如：</span>
&nbsp;
<span style="color: #007800;">baseurl</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.secuidc.com<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$releasever</span><span style="color: #000000; font-weight: bold;">/</span>os<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">baseurl</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.secuidc.com<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$releasever</span><span style="color: #000000; font-weight: bold;">/</span>update<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/yum.repos.d/dag.repo</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>dag<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=Dag RPM Repository <span style="color: #000000; font-weight: bold;">for</span> Red Hat Enterprise Linux
<span style="color: #007800;">baseurl</span>=http:<span style="color: #000000; font-weight: bold;">//</span>apt.sw.be<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>el<span style="color: #007800;">$releasever</span><span style="color: #000000; font-weight: bold;">/</span>en<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>dag
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">enabled</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">exclude</span>=proftpd<span style="color: #000000; font-weight: bold;">*</span>
EOF
&nbsp;
<span style="color: #666666; font-style: italic;"># yum install perl-libwww-perl perl-HTML-Parser perl-HTML-Tagset perl-URI</span>
perl-Crypt-Blowfish perl-Crypt-CBC perl-Date-Calc perl-MIME-tools
perl-Convert-BinHex perl-IO-stringy perl-MailTools perl-TimeDate
&nbsp;
<span style="color: #666666; font-style: italic;"># yum install rpm-build bind</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># rpm -Uvh cpan2rpm-2.028-1.noarch.rpm</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># tar vxfz Crypt-PasswdMD5-1.3.tgz; cd Crypt-PasswdMD5-1.3;</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> Makefile.PL; <span style="color: #c20cb9; font-weight: bold;">make</span>; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>; <span style="color: #7a0874; font-weight: bold;">cd</span> ..
&nbsp;
<span style="color: #666666; font-style: italic;"># tar vxfz Term-ReadPassword-0.07.tgz; cd Term-ReadPassword-0.07;</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> Makefile.PL; <span style="color: #c20cb9; font-weight: bold;">make</span>; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>; <span style="color: #7a0874; font-weight: bold;">cd</span> ..
&nbsp;
<span style="color: #666666; font-style: italic;"># rpm --import &lt;a href=&quot;http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4&quot;&gt;http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4&lt;/a&gt;</span>
<span style="color: #666666; font-style: italic;"># yum install</span>
<span style="color: #c20cb9; font-weight: bold;">bison</span> bzip2-devel cyrus-sasl cyrus-sasl-plain
expect fam-devel <span style="color: #c20cb9; font-weight: bold;">flex</span> freetype-devel
<span style="color: #c20cb9; font-weight: bold;">gcc</span> gcc-c++ gdbm-devel httpd httpd-devel
iptables libc-client-devel libjpeg-devel
libmcrypt libmcrypt-devel libpng-devel libtool
libxslt-devel <span style="color: #c20cb9; font-weight: bold;">make</span> mod_ssl
mysql mysql-devel mysql-server
ncurses-devel net-snmp-devel
openssl openssl-devel openssl-perl
pam-devel php php-imap php-gd
php-mysql php-pgsql php-snmp
pkgconfig postgresql-devel zlib-devel
（删掉了mysql-admin这个包，不存在。）
<span style="color: #666666; font-style: italic;"># ln -s /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so /lib/</span>
<span style="color: #666666; font-style: italic;"># rpm -Uvh proftpd-1.2.10-8_mysql.dag.i386.rpm;</span>
rpm <span style="color: #660033;">-Uvh</span> postfix-2.2.5-<span style="color: #000000;">1</span>.mysql.sasl2.vda.rhel4.i386.rpm;
rpm <span style="color: #660033;">-Uvh</span> courier-authlib-<span style="color: #000000; font-weight: bold;">*</span>.rpm;
rpm <span style="color: #660033;">-Uvh</span> courier-mysql-<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">*</span>.rpm courier-<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">*</span>.rpm courier-imapd-<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">*</span>.rpm courier-pop3d-<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">*</span>.rpm;
rpm <span style="color: #660033;">-Uvh</span> php-mcrypt-4.3.9-3.1.1.i386.rpm
<span style="color: #666666; font-style: italic;"># vi /etc/postfix/main.cf</span>
myhostname = srv180.capno.com
<span style="color: #666666; font-style: italic;"># vi /etc/httpd/conf/httpd.conf</span>
ServerName srv180.capno.com:<span style="color: #000000;">80</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># chkconfig --add courier;</span>
service courier start;
chkconfig proftpd on;
service proftpd start;
service mysqld start;
service httpd start;
service named start
&nbsp;
<span style="color: #666666; font-style: italic;"># mysql</span>
mysql<span style="color: #000000; font-weight: bold;">&amp;</span>gt; create database vhcs2;use mysql;
mysql<span style="color: #000000; font-weight: bold;">&amp;</span>gt; update user <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">password</span>=password<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'DB_PASSWORD'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> where <span style="color: #007800;">User</span>=<span style="color: #ff0000;">'root'</span>;
mysql<span style="color: #000000; font-weight: bold;">&amp;</span>gt; flush privileges;
&nbsp;
<span style="color: #666666; font-style: italic;"># cd /home/admin/VHCS/;</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xjpvf</span> vhcs2-2.4.7.1.tar.bz2;
<span style="color: #7a0874; font-weight: bold;">cd</span> vhcs2-2.4.7.1<span style="color: #000000; font-weight: bold;">/</span>configs<span style="color: #000000; font-weight: bold;">/</span>vhcs2.conf
&nbsp;
SERVER_HOSTNAME = srv180
BASE_SERVER_IP = 10.10.10.180
MR_LOCK_FILE = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>vhcs2.lock
DATABASE_NAME = vhcs2
DATABASE_PASSWORD = <span style="color: #000000; font-weight: bold;">****</span>
BIND_CONF_FILE = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>named.conf
BIND_DB_DIR = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>named<span style="color: #000000; font-weight: bold;">/</span>chroot<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>named
APACHE_CMD = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>httpd
APACHE_NAME = httpd
APACHE_LOG_DIR = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>httpd
APACHE_USERS_LOG_DIR = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">users</span>
APACHE_BACKUP_LOG_DIR = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>backup
APACHE_CONF_FILE = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>vhcs2.conf
APACHE_USER = apache
APACHE_GROUP = apache
MTA_SASLDB_FILE = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sasldb2
CMD_NAMED = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>named
CMD_HTTPD = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>httpd
CMD_AUTHD = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>courier-authlib
CMD_IMAP = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>courier
CMD_POP = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>courier
CMD_VHCS2D = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>vhcs2
MAIL_TRAFF_LOG = maillog
&nbsp;
<span style="color: #666666; font-style: italic;"># sed -i &quot;s#/usr/lib/postfix#/usr/libexec/postfix#g&quot; /home/admin/VHCS/vhcs2-2.4.7.1/configs/postfix/main.cf</span>
<span style="color: #666666; font-style: italic;"># cd /home/admin/VHCS/vhcs2-2.4.7.1; make install</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># mkdir /var/named/chroot;</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>named<span style="color: #000000; font-weight: bold;">/</span>chroot<span style="color: #000000; font-weight: bold;">/</span>var;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>named<span style="color: #000000; font-weight: bold;">/</span>chroot<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>named;
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> named:named <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>named<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chroot</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># cp --reply=yes -R /tmp/vhcs-2.4.7.1/* /;</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-pR</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>vhcs-2.4.7.1<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>;
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-pR</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>vhcs-2.4.7.1<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>vhcs2_<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>;
<span style="color: #c20cb9; font-weight: bold;">rmdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>courier<span style="color: #000000; font-weight: bold;">/</span>userdb;
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>courier<span style="color: #000000; font-weight: bold;">/</span>userdb;<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>courier<span style="color: #000000; font-weight: bold;">/</span>userdb;
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>courier<span style="color: #000000; font-weight: bold;">/</span>userdb <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authlib<span style="color: #000000; font-weight: bold;">/</span>userdb
makeuserdb
&nbsp;
<span style="color: #666666; font-style: italic;"># cd /var/www/vhcs2/engine/setup/</span>
<span style="color: #666666; font-style: italic;"># ./vhcs2-setup</span>
<span style="color: #c20cb9; font-weight: bold;">hostname</span>: srv180
system network address: 10.10.10.180
SQL server host: localhost
SQL database: vhcs2
SQL user: root
SQL password: <span style="color: #000000; font-weight: bold;">*******</span>
VHCS <span style="color: #c20cb9; font-weight: bold;">ftp</span> SQL user: vftp
admin name: admin
admin password: <span style="color: #000000; font-weight: bold;">*******</span>
admin e-mail: <span style="color: #000000; font-weight: bold;">&lt;</span>a <span style="color: #007800;">href</span>=<span style="color: #ff0000;">&quot;mailto:webmaster@capno.com&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>webmaster<span style="color: #000000; font-weight: bold;">@</span>capno.com<span style="color: #000000; font-weight: bold;">&lt;/</span>a<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sed -i &quot;s/nogroup/nobody/&quot; /etc/proftpd.conf</span>
<span style="color: #666666; font-style: italic;"># chmod u+w -R /var/www/vhcs2/gui/tools/webmail/</span>
<span style="color: #666666; font-style: italic;"># cd /etc/vhcs2/bind/parts/</span>
<span style="color: #666666; font-style: italic;"># cp -p cfg_entry.tpl cfg_entry.tpl.bak</span>
<span style="color: #666666; font-style: italic;"># vi cfg_entry.tpl</span>
original line: <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;{DB_DIR}/{DMN_NAME}.db&quot;</span>;
replacement line: <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;{DMN_NAME}.db&quot;</span>;
<span style="color: #666666; font-style: italic;"># sed -i &quot;s/0700/0755/&quot; /var/www/vhcs2/engine/vhcs2-*</span>
<span style="color: #666666; font-style: italic;"># touch /etc/sasldb2</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">test</span> with <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>sasldblistusers2<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># vi /etc/init.d/vhcs2</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># vhcs2           Start or stop the vhcs2 daemon</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># chkconfig: - 95 5</span>
<span style="color: #666666; font-style: italic;"># processname: vhcs2</span>
<span style="color: #666666; font-style: italic;"># description: Start or stop the vhcs2 daemon</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #007800;">name</span>=<span style="color: #ff0000;">'vhcs2'</span>
<span style="color: #007800;">lockfile</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span>vhcs2
<span style="color: #007800;">confFile</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vhcs2<span style="color: #000000; font-weight: bold;">/</span>vhcs2.conf
<span style="color: #007800;">pidFile</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>vhcs2<span style="color: #000000; font-weight: bold;">/</span>vhcs2.pid
<span style="color: #007800;">daemon</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>vhcs2<span style="color: #000000; font-weight: bold;">/</span>daemon<span style="color: #000000; font-weight: bold;">/</span>vhcs2_daemon
<span style="color: #007800;">name</span>=vhcs2_daemon
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    <span style="color: #ff0000;">'start'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #007800;">$daemon</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
    <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$RETVAL</span>&quot;</span> = <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #007800;">$lockfile</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">'stop'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">pidfile</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^pidfile=&quot;</span> <span style="color: #007800;">$confFile</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/pidfile=//g'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$pidfile</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$RETVAL</span>&quot;</span> = <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$lockfile</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">'status'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">pidfile</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^pidfile=&quot;</span> <span style="color: #007800;">$confFile</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/pidfile=//g'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$pidfile</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">pidfile</span>=<span style="color: #007800;">$pidFile</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$pidfile</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">pid</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$pidfile</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-0</span> <span style="color: #007800;">$pid</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$?&quot;</span> = <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$name</span> (pid <span style="color: #007800;">$pid</span>) is running&quot;</span>
        <span style="color: #007800;">RETVAL</span>=<span style="color: #000000;">0</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$name</span> is stopped&quot;</span>
        <span style="color: #007800;">RETVAL</span>=<span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$name</span> is stopped&quot;</span>
    <span style="color: #007800;">RETVAL</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">'restart'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">$stop</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #007800;">$start</span>
<span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 { start | stop | restart }&quot;</span>
<span style="color: #007800;">RETVAL</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$RETVAL</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># chmod +x /etc/init.d/vhcs2</span>
<span style="color: #666666; font-style: italic;"># chkconfig --add vhcs2</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># cd /etc/rc.d/rc3.d</span>
<span style="color: #666666; font-style: italic;"># mv S35courier K35courier;</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> S13portmap K13portmap;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S14nfslock K14nfslock;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S18rpcidmapd K18rpcidmapd;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S19rpcgssd K19rpcgssd;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S25netfs K25netfs;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S40smartd K40smartd;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S44acpid K44acpid;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S80proftpd K80proftpd;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S85gpm K85gpm;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S95anacron K95anacron;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S95atd K95atd;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S97messagebus K97messagebus;
<span style="color: #c20cb9; font-weight: bold;">mv</span> S98haldaemon K98haldaemon
&nbsp;
<span style="color: #666666; font-style: italic;"># service httpd stop;</span>
service mysqld stop;
service proftpd stop;
service courier stop;
service named stop;
&nbsp;
<span style="color: #666666; font-style: italic;"># service named start;</span>
service courier start;
service proftpd start;
service mysqld start;
service httpd start;
service vhcs2 start
&nbsp;
访问<span style="color: #000000; font-weight: bold;">&lt;</span>a <span style="color: #007800;">href</span>=<span style="color: #ff0000;">&quot;http://10.10.10.180/vhcs2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>http:<span style="color: #000000; font-weight: bold;">//</span>10.10.10.180<span style="color: #000000; font-weight: bold;">/</span>vhcs2<span style="color: #000000; font-weight: bold;">&lt;/</span>a<span style="color: #000000; font-weight: bold;">&gt;</span> admin登录后修改默认语言
Genaral -<span style="color: #000000; font-weight: bold;">&amp;</span>gt; Muiltlanguage -<span style="color: #000000; font-weight: bold;">&amp;</span>gt; Chinese, Save
修改<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini, defaultcharset = <span style="color: #ff0000;">&quot;gb2312&quot;</span>, 重启httpd</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.9wy.net/archives/61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
