<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[鑫的方向]]></title> 
<link>http://www.xinlogs.com/index.php</link> 
<description><![CDATA[记录自己走过的轨迹]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[鑫的方向]]></copyright>
<item>
<link>http://www.xinlogs.com/vps-dropbox-install/</link>
<title><![CDATA[一款Linux下同步备份文件的好软件DROPBOX]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Mon, 05 Apr 2010 03:07:21 +0000</pubDate> 
<guid>http://www.xinlogs.com/vps-dropbox-install/</guid> 
<description>
<![CDATA[ 
	<p>原来一直用tar、sync等软件实现备份。需要些脚本还要找一台其他服务器进行同步。现在有了DROPBOX这个网站提供的服务，一切都变容易了。</p>
<p><strong>DROPBOX网站：</strong></p>
<p><a href="http://www.dropbox.com/">www.dropbox.com</a></p>
<p><strong>DROP功能：</strong></p>
<p>偷懒直接把官方介绍帖过来了。主要就是免费提供2G的同步空间，可以自动同步文件并保留文件的历史版本</p>
<h1>Dropbox Features</h1>
<h2 id="sync">File Sync</h2>
<p>Dropbox allows you to sync your files online and across your computers automatically.</p>
<ul class="blue-bullets">
    <li>2GB of online storage for free, with up to 100GB available to paying customers.</li>
    <li>Sync files of any size or type.</li>
    <li>Sync Windows, Mac and Linux computers.</li>
    <li>Automatically syncs when new files or changes are detected.</li>
    <li>Work on files in your Dropbox even if you're offline. Your changes sync once your computer has an Internet connection again.</li>
    <li>Dropbox transfers will correctly resume where they left off if the connection drops.</li>
    <li>Efficient sync - only the pieces of a file that changed (not the whole file) are synced. This saves you time.</li>
    <li>Doesn't hog your Internet connection. You can manually set bandwidth limits. </li>
</ul>
<h2 id="sharing">File Sharing</h2>
<p>Sharing files is simple and can be done with only a few clicks.</p>
<ul class="blue-bullets">
    <li>Shared folders allow several people to collaborate on a set of files.</li>
    <li>You can see other people's changes instantly.</li>
    <li>A &quot;Public&quot; folder that lets you link directly to files in your Dropbox.</li>
    <li>Control who is able to access shared folders (including ability to kick people out and remove the shared files from their computers).</li>
    <li>Automatically create shareable online photo galleries from folders of photos in your Dropbox.</li>
</ul>
<h2 id="backup">Online Backup</h2>
<p>Dropbox backs up your files online without you having to think about it.</p>
<ul class="blue-bullets">
    <li>Automatic backup of your files.</li>
    <li>Undelete files and folders.</li>
    <li>Restore previous versions of your files.</li>
    <li>30 days of undo history, with unlimited undo available as a paid option.</li>
</ul>
<h2 id="web">Web Access</h2>
<p>A copy of your files are stored on Dropbox's secure servers. This lets you access them from any computer or mobile device.</p>
<ul class="blue-bullets">
    <li>Manipulate files as you would on your desktop - add, edit, delete, rename etc.</li>
    <li>Search your entire Dropbox for files.</li>
    <li>A &quot;Recent Events&quot; feed that shows you a summary of activity in your Dropbox.</li>
    <li>Create shared folders and invite people to them.</li>
    <li>Recover previous versions of any file or undelete deleted files.</li>
    <li>View photo galleries created automatically from photos in your Dropbox.</li>
</ul>
<h2 id="security">Security &amp; Privacy</h2>
<p>Dropbox takes the security and privacy of your files very seriously.</p>
<ul class="blue-bullets">
    <li>Shared folders are viewable only by people you invite.</li>
    <li>All transmission of file data and metadata occurs over an encrypted channel (SSL).</li>
    <li>All files stored on Dropbox servers are encrypted (AES-256) and are inaccessible without your account password.</li>
    <li>Dropbox website and client software have been hardened against attacks from hackers.</li>
    <li>Dropbox employees are not able to view any user's files.</li>
    <li>Online access to your files requires your username and password.</li>
    <li>Public files are only viewable by people who have a link to the file(s). Public folders are not browsable or searchable.</li>
</ul>
<h2 id="mobile">Mobile Device Access</h2>
<p>The free <a href="http://www.xinlogs.com/iphoneapp">Dropbox iPhone app</a> lets you:</p>
<ul class="blue-bullets">
    <li>Access your Dropbox on the go.</li>
    <li>View your files on your iPhone or iPod Touch.</li>
    <li>Download files for offline viewing.</li>
    <li>Take photos and videos and sync them to your Dropbox.</li>
    <li>Share links to files in your Dropbox.</li>
    <li>View interactive photo galleries.</li>
    <li>Sync downloaded files so they're up-to-date.</li>
</ul>
<p>&nbsp;</p>
<p>A mobile-optimized version of the website is available for owners of Blackberry phones and other Internet-capable mobile devices.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Linux下安装</strong></p>
<p>如果你的Linux服务器安装了Xserver和桌面，完全可以安装官方的指南来安装。但是因为一般的VPS都内存小得可怜，不会奢侈到安装桌面，所以下面主要介绍在没有安装桌面系统的命令行Linux下安装步骤。</p>
<p>关于安装方法的内容转帖自<a href="http://lazyhack.net/install-dropbox-in-vps/">http://lazyhack.net/install-dropbox-in-vps/</a></p>
<p><strong>1、登陆进VPS或者是服务器，进入用户目录</strong></p>
<div class="codeText">
<div id="code_6795">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>cd </span></span>
    <link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></li>
</ol>
</div>
</div>
<p><strong>2、下载dropbox的客户端，要For linux那个而非For Nautilus的</strong></p>
<p>这里我是在<a href="http://lazyhack.net/install-dropbox-in-vps/">http://lazyhack.net/install-dropbox-in-vps/</a>文档中找到的地址，官方网站找了半天都是Nautilus的版本</p>
<p>32位下载地址 <a href="http://www.dropbox.com/download?plat=lnx.x86">http://www.dropbox.com/download?plat=lnx.x86</a></p>
<p>64位下载地址 <a href="http://www.dropbox.com/download?plat=lnx.x86_64">http://www.dropbox.com/download?plat=lnx.x86_64</a></p>
<p>我这里用的32位系统，所以下载32位客户端</p>
<div class="codeText">
<div id="code_2958">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>wget http://www.dropbox.com/download?</span><span class="attribute">plat</span><span>=</span><span class="attribute-value">lnx</span><span>.x86 </span></span>
    <link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></li>
</ol>
</div>
</div>
<p><strong>3、解压</strong></p>
<div class="codeText">
<div id="code_2090">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>tar zxvf dropbox-lnx.x86-0.7.110.tar.gz </span></span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p><strong>4、下载dbmakefilelib.py并运行</strong></p>
<div class="codeText">
<div id="code_3236">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>wget http://dl.dropbox.com/u/637552/Dropbox/dbmakefilelib.py </span></span></li>
    <li><span>python dbmakefilelib.py </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>如果出现以下信息，说明它运行正常</p>
<p>dropboxd ran for 15 seconds without quitting - success?</p>
<p>看到它的提示了吗，<a target="_blank" href="http://www.vpser.net/go/dropbox">Dropbox</a>已经启动了，让你运行15秒后再退出，这个过程就是dropbox生成机器信息并保存到db文件的，其实对于国外的<a title="查看 vps 的全部文章" target="_blank" href="http://lazyhack.net/tag/vps/">vps</a>来说几秒时间就够了，我们ctrl－c将其退出，完成接下来的步骤<br />
&nbsp;</p>
<p><strong>5、进入</strong><a target="_blank" href="http://www.vpser.net/go/dropbox"><strong>Dropbox</strong></a><strong>的dot目录导出机器信息</strong></p>
<div class="codeText">
<div id="code_7591">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>cd .~/.dropbox </span></span></li>
    <li><span>$ sqlite3 dropbox.db </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>SQLite version 3.6.22 </span></li>
    <li class="alt"><span>Enter &quot;.help&quot; for instructions </span></li>
    <li><span>Enter SQL statements terminated with a &quot;;&quot; </span></li>
    <li class="alt"><span>sqlite</span><span class="tag">&gt;</span><span> .dump config </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>我们会在导出的信息中看到如下的一串字符</p>
<div>
<div>
<pre>
INSERT INTO &quot;config&quot; VALUES(4,'host_id','VmQ0NWFlMTdmYmQ3OGYzMzgyOTM0NWMzN2Q1MGFkOTIzCnAxCi4=
');</pre>
</div>
</div>
<p>这个host_id就是机器的唯一标识，我们需要用它来跟自己的账户进行匹配，不过在这之前还有个工作需要做，因为上面的那长串字符很明显可以看出 是用base64编码后的结果，我们得先把它解码再说，注意这里<a target="_blank" href="http://www.vpser.net/go/dropbox">Dropbox</a>耍了个小花招，这串字符串前面的那个&rdquo;V&ldquo;，是无用的，我们在解码后的把它 忽略掉<br />
&nbsp;</p>
<p><strong>6、将base64字符串解码</strong>
<p>&nbsp;</p>
</p>
<p><strong>
<div class="codeText">
<p class="alt"><span><span>$ echo </span><span class="attribute">mQ0NWFlMTdmYmQ3OGYzMzgyOTM0NWMzN2Q1MGFkOTIzCnAxCi4</span><span>= ｜ base64 -d </span></span></p>
<div>
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li><span>Vd45ae17fbd78f33829345c37d50ad923 </span></li>
    <li><span>p1 </span>
    <link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></li>
</ol>
</div>
</div>
<pre>
我的结果是Vd45ae17fbd78f33829345c37d50ad923，忽略掉&rdquo;V&ldquo;，就是d45ae17fbd78f33829345c37d50ad923</pre>
</strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>7、将账户信息与机器信息绑定</strong><br />
这步很简单，只需要访问以下网址，并登陆<br />
HOSTID替换成你刚才解码出来的那串字符就行了</p>
<pre><code>https://www.dropbox.com/cli_link?host_id=HOSTID</code></pre>
<p><strong>8、建立dropbox的同步目录</strong><br />
dropbox的同步目录默认的是~/Dropbox</p>
<pre><code>$ mkdir ~/Dropbox</code></pre>
<p><strong>9、运行，开始你的同步</strong></p>
<p><code>$ ~/.dropbox-dist/dropboxd &amp;</code></p>
<p>到这里dropbox就可以正常运行并同步了，文章标题说的是备份网站数据，那么我们就来使我们的网站数据能够同步到dropbox服务器上<br />
其实很简单，就是建立符号连接而已，windows之前是没有这个功能的<br />
比如要备份/var/www这个目录</p>
<pre><code>cd ~/Dropbox
$ ln -s /var/www web_backup</code></pre>
<p>这就可以了,或者要备份/e<a title="tc" target="_blank" href="http://wiki.lazyhack.net/tc">tc</a>目录</p>
<pre><code>$ cd ~/Dropbox
$ ln -s /etc etc_backup</code></pre>
<p>ok.发挥你的想象尽情的使用吧。<br />
&nbsp;</p>
<p><strong>推广</strong></p>
<p>如果你看过这篇文章后，打算也使用dropbox。那么你可以使用我下面的链接注册</p>
<p><a href="https://www.dropbox.com/referrals/NTU4NDMyNzI5">https://www.dropbox.com/referrals/NTU4NDMyNzI5</a></p>
<p>采用这个链接注册，你会增加250M空间。注册后是2G，然后会给你再发封邮件告诉你已经提升到2.25G。而我也会增加250M空间。</p><br/>Tags - <a href="http://www.xinlogs.com/tags/dropbox/" rel="tag">dropbox</a> , <a href="http://www.xinlogs.com/tags/%25E5%25A4%2587%25E4%25BB%25BD/" rel="tag">备份</a> , <a href="http://www.xinlogs.com/tags/%25E5%2590%258C%25E6%25AD%25A5/" rel="tag">同步</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/OpenVPN-Install/</link>
<title><![CDATA[CentOS 5.3下OpenVPN安装和Win7下OpenVPN GUI安装]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Mon, 15 Mar 2010 05:27:55 +0000</pubDate> 
<guid>http://www.xinlogs.com/OpenVPN-Install/</guid> 
<description>
<![CDATA[ 
	<p>本来我是在美国的VPS服务器上安装的pptp vpn，这个vpn可以用windows自带的拨号连接，配置也很方便。刚配置好的时候很好用，可以开youtube也可以访问一些被封闭的站点。但是后来家里的歌华有线好像调整了一些路由配置，导致我在家里就不能连接vpn了。单位也不能连接。我用老婆家里的adsl尝试连接正常，用联通3G连接也正常。。。。这个既然是网络的问题，估计个人也解决不了了</p>
<p>最近单位也开始搞起来封锁了，开心、verycd等都被封。。。又不能用pptpd vpn了。。。看来该想想其他办法了。代理尝试了，不管用，看来不是基于域名的限制。</p>
<p>于是就开始尝试采用openvpn了。</p>
<p>参考了</p>
<p><a href="http://www.throx.net/2008/04/13/openvpn-and-centos-5-installation-and-configuration-guide/">http://www.throx.net/2008/04/13/openvpn-and-centos-5-installation-and-configuration-guide/</a></p>
<p><a href="http://www.xiaohui.com/dev/server/20070514-install-openvpn.htm">http://www.xiaohui.com/dev/server/20070514-install-openvpn.htm</a></p>
<p><strong>整体方案</strong></p>
<p>采用位于美国的CentOS 5.3 Linux服务器搭建openvpn服务器，并通过iptables的nat功能使openvpn服务器当做客户端网关。</p>
<p>客户端安装OpenVPN GUI程序连接服务器</p>
<p><strong>服务器</strong></p>
<p>服务器采用位于美国的vps</p>
<p>系统CentOS 5.3</p>
<p>安装openvpn作为vpn服务器软件</p>
<p><strong>OpenVPN服务器安装</strong></p>
<p>kernel 需要<strong>支持 tun 设备</strong>, 需要加载 iptables 模块. <br />
检查 tun 是否安装:</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_8743');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_8743">
<ol class="dp-xml">
    <li class="alt"><span><span>modinfo tun </span></span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>或者 </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>find / -name tun.o -print </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>安装需要的相关软件</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_5504');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_5504">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>yum install rpm-build </span></span></li>
    <li><span>yum install autoconf.noarch </span></li>
    <li class="alt"><span>yum install zlib-devel </span></li>
    <li><span>yum install pam-devel </span></li>
    <li class="alt"><span>yum install openssl-devel </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>安装环境准备好后，我们下载需要安装的软件。一共需要下载两个软件openvpn 2.0.9和lzo-1.08-4</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_2756');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_2756">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>wget http://openvpn.net/release/openvpn-2.0.9.tar.gz </span></span></li>
    <li><span>wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>安装lzo</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_2338');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_2338">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>rpmbuild --rebuild lzo-1.08-4.rf.src.rpm </span></span></li>
    <li><span>rpm -Uvh /usr/src/redhat/RPMS/i386/lzo-*.rpm</span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>安装openvpn</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_6883');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_6883">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>rpmbuild -tb openvpn-2.0.9.tar.gz </span></span></li>
    <li><span>rpm -Uvh /usr/src/redhat/RPMS/i386/openvpn-2.0.9-1.i386.rpm </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>安装后，复制配置文件</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_3327');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_3327">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>cp -r /usr/share/doc/openvpn-2.0.9/easy-rsa/ /etc/openvpn/ </span></span></li>
    <li><span>cp /usr/share/doc/openvpn-2.0.9/sample-config-files/server.conf /etc/openvpn/ </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>配置生成CA脚本需要的配置文件vars</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_1803');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_1803">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>vi /etc/openvpn/easy-rsa/</span></span><span>vars</span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>打开vars后，找到文件最后的如下内容</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_2532');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_2532">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>export </span><span class="attribute">KEY_COUNTRY</span><span>=</span><span class="attribute-value">KG</span><span> </span></span></li>
    <li><span>export </span><span class="attribute">KEY_PROVINCE</span><span>=</span><span class="attribute-value">NA</span><span> </span></li>
    <li class="alt"><span>export </span><span class="attribute">KEY_CITY</span><span>=</span><span class="attribute-value">BISHKEK</span><span> </span></li>
    <li><span>export </span><span class="attribute">KEY_ORG</span><span>=</span><span class="attribute-value">&quot;OpenVPN-TEST&quot;</span><span> </span></li>
    <li class="alt"><span>export </span><span class="attribute">KEY_EMAIL</span><span>=</span><span class="attribute-value">&quot;me@myhost.mydomain&quot;</span><span> </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>根据自己信息修改上面内容,下面是具体含义</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_1636');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_1636">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>export </span><span class="attribute">KEY_COUNTRY</span><span>=</span><span class="attribute-value">KG</span><span> 设置国家 </span></span></li>
    <li><span>export </span><span class="attribute">KEY_PROVINCE</span><span>=</span><span class="attribute-value">NA</span><span> 设置省份 </span></li>
    <li class="alt"><span>export </span><span class="attribute">KEY_CITY</span><span>=</span><span class="attribute-value">BISHKEK</span><span> 设置城市 </span></li>
    <li><span>export </span><span class="attribute">KEY_ORG</span><span>=</span><span class="attribute-value">&quot;OpenVPN-TEST&quot;</span><span> 设置组织 </span></li>
    <li class="alt"><span>export </span><span class="attribute">KEY_EMAIL</span><span>=</span><span class="attribute-value">&quot;me@myhost.mydomain&quot;</span><span> 设置邮件 </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>设置好后，执行如下命令</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_6937');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_6937">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>cd /etc/openvpn/easy-rsa/ </span></span></li>
    <li><span>. ./vars </span></li>
    <li class="alt"><span>./clean-all </span></li>
    <li><span>注意上面的. ./vars两个点之间有一个空格 </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>建立CA证书</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_5043');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_5043">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>./build-ca </span></span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>生成后，ls keys 可以看到ca.crt ca.key文件</p>
<p>建立服务器密钥</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_1625');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_1625">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>./build-key-server xinlogs </span></span></li>
    <li><span>注意这里的xinlogs是我给密钥起的名字，可以根据个人情况修改 </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>生成Diffie-Hellman文件</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_8054');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_8054">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>./build-dh </span></span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>以上文件都正确生成后，拷贝文件到正确目录</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_3008');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_3008">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>cd /etc/openvpn/easy-rsa/ </span></span></li>
    <li><span>cp keys/ca.crt ../ </span></li>
    <li class="alt"><span>cp keys/dh1024.pem ../ </span></li>
    <li><span>cp keys/xinlogs.key ../ </span></li>
    <li class="alt"><span>cp keys/xinlogs.crt ../ </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>生成客户端密钥</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_2881');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_2881">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>./build-key client-1 </span></span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>这里client-1是客户端密钥的文件名，如果需要创建多个客户端密钥，就修改client-1名字多次生成即可。</p>
<p>修改/etc/openvpn/server.conf配置</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_7600');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_7600">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>local 204.74.212.217 </span></span></li>
    <li><span>#修改local后面ip为服务器地址 </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>dev tap </span></li>
    <li class="alt"><span>;dev tun </span></li>
    <li><span>#默认是dev tun修改为dev tap,tap是可以路由模式 tun 是以太网隧道模式。具体区别我也不太清楚 </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>ca ca.crt </span></li>
    <li class="alt"><span>cert xinlogs.crt </span></li>
    <li><span>key xinlogs.key </span></li>
    <li class="alt"><span>#cert后面修改为生成的服务器crt文件xinlogs.crt </span></li>
    <li><span>#key后面修改为生成的服务器key文件xinlogs.key </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>dh dh1024.pem </span></li>
    <li class="alt"><span>#dh后面修改问生成的dh1024.pem </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>server 10.8.0.0 255.255.255.0 </span></li>
    <li><span>#server后面基本就用默认的10.8.0.0 255.255.255.0即可 </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>ifconfig-pool-persist ipp.txt </span></li>
    <li class="alt"><span>#这个默认的ipp.txt就可以 </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>push &quot;route 10.8.0.0 255.255.255.0&quot; </span></li>
    <li><span>#添加客户端路由 </span></li>
    <li class="alt"><span>push &quot;redirect-gateway&quot; </span></li>
    <li><span>#修改客户端默认路由 </span></li>
    <li class="alt"><span>push &quot;dhcp-option DNS 8.8.8.8&quot; </span></li>
    <li><span>#修改客户端默认dns </span></li>
    <li class="alt"><span>client-to-client </span></li>
    <li><span>#允许连接到vpn的客户端可以互相访问 </span></li>
    <li class="alt"><span>duplicate-cn </span></li>
    <li><span>keepalive 10 120 </span></li>
    <li class="alt"><span>comp-lzo </span></li>
    <li><span>#启用lzo压缩 </span></li>
    <li class="alt"><span>user nobody </span></li>
    <li><span>group nobody </span></li>
    <li class="alt"><span>persist-key </span></li>
    <li><span>persist-tun </span></li>
    <li class="alt"><span>status /var/log/openvpn-status.log </span></li>
    <li><span>log /var/log/openvpn.log </span></li>
    <li class="alt"><span>log-append /var/log/openvpn.log </span></li>
    <li><span>verb 3 </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p><strong>启动停止openvpn</strong></p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_1149');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_1149">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>service openvpn start </span></span></li>
    <li><span>#启动openvpn服务 </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>service openvpn stop </span></li>
    <li class="alt"><span>#停止openvpn服务 </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>配置iptables</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_7010');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_7010">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source 214.174.212.217 </span></span></li>
    <li><span>#上面命令最后的214.174.212.217是服务器的公网地址，需要根据自己情况修改 </span></li>
    <li class="alt"><span>service iptables save </span></li>
</ol>
</div>
</div>
<p>确认net.ipv4.ip_forward = 1后，服务器就全部配置完成。</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_3930');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_3930">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>cat /etc/sysctl.conf &#124;grep forward </span></span></li>
    <li><span># Controls IP packet forwarding </span></li>
    <li class="alt"><span class="attribute">net.ipv4.ip_forward</span><span> = </span><span class="attribute-value">1</span><span> </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>#如果不是1，请用vi修改/etc/sysctl.conf文件 </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p><strong>Win7下Openvpn GUI安装</strong></p>
<p>从 <a target="_blank" href="http://openvpn.se/">http://openvpn.se</a>下载安装文件</p>
<p class="text-without-space">Latest stable release: <strong>1.0.3</strong> with OpenVPN 2.0.9 (2006-10-17)</p>
<p class="text-without-space">我们直接下载<a href="http://openvpn.se/files/install_packages/openvpn-2.0.9-gui-1.0.3-install.exe">http://openvpn.se/files/install_packages/openvpn-2.0.9-gui-1.0.3-install.exe</a></p>
<p class="text-without-space"><strong>注意：下载后，别着急双击安装。先右键属性，设置兼容模式为windosxp sp3 并用管理员身份运行。</strong></p>
<p class="text-without-space"><img alt="" src="attachment.php?fid=79" /></p>
<p class="text-without-space">然后再运行安装。</p>
<p class="text-without-space"><strong>客户端配置</strong></p>
<p class="text-without-space">安装后，将服务器/etc/openvpn/easy-rsa/keys/目录下的ca.crt、client-1.crt和client-1.key三个文件拷贝到C:Program FilesOpenVPNconfig目录下</p>
<p class="text-without-space">再将C:Program FilesOpenVPNsample-config目录下的client.ovpn文件拷贝到C:Program FilesOpenVPNconfig目录下。</p>
<p class="text-without-space">在开始-&gt;所有程序里找到openvpn，进入里面右键点击OpenVPN GUI属性，同样修改兼容模式为windows xp sp3 以管理员运行</p>
<p class="text-without-space">修改后，运行openvpn gui程序</p>
<p class="text-without-space">正确运行后，电脑的右下角会出现openvpn的图标，右键点击选择Edit Config来修改客户端配置文件</p>
<p class="text-without-space">下面是我全部客户端配置文件</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_9401');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_9401">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>############################################## </span></span></li>
    <li><span># Sample client-side OpenVPN 2.0 config file # </span></li>
    <li class="alt"><span># for connecting to multi-client server. # </span></li>
    <li><span># # </span></li>
    <li class="alt"><span># This configuration can be used by multiple # </span></li>
    <li><span># clients, however each client should have # </span></li>
    <li class="alt"><span># its own cert and key files. # </span></li>
    <li><span># # </span></li>
    <li class="alt"><span># On Windows, you might want to rename this # </span></li>
    <li><span># file so it has a .ovpn extension # </span></li>
    <li class="alt"><span>############################################## </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># Specify that we are a client and that we </span></li>
    <li><span># will be pulling certain config file directives </span></li>
    <li class="alt"><span># from the server. </span></li>
    <li><span>client </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Use the same setting as you are using on </span></li>
    <li class="alt"><span># the server. </span></li>
    <li><span># On most systems, the VPN will not function </span></li>
    <li class="alt"><span># unless you partially or fully disable </span></li>
    <li><span># the firewall for the TUN/TAP interface. </span></li>
    <li class="alt"><span>dev tap </span></li>
    <li><span>;dev tun </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Windows needs the TAP-Win32 adapter name </span></li>
    <li class="alt"><span># from the Network Connections panel </span></li>
    <li><span># if you have more than one. On XP SP2, </span></li>
    <li class="alt"><span># you may need to disable the firewall </span></li>
    <li><span># for the TAP adapter. </span></li>
    <li class="alt"><span>;dev-node MyTap </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># Are we connecting to a TCP or </span></li>
    <li><span># UDP server? Use the same setting as </span></li>
    <li class="alt"><span># on the server. </span></li>
    <li><span>;proto tcp </span></li>
    <li class="alt"><span>proto udp </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># The hostname/IP and port of the server. </span></li>
    <li><span># You can have multiple remote entries </span></li>
    <li class="alt"><span># to load balance between the servers. </span></li>
    <li><span>remote 214.174.212.217 1194 </span></li>
    <li class="alt"><span>;remote my-server-2 1194 </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># Choose a random host from the remote </span></li>
    <li><span># list for load-balancing. Otherwise </span></li>
    <li class="alt"><span># try hosts in the order specified. </span></li>
    <li><span>;remote-random </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Keep trying indefinitely to resolve the </span></li>
    <li class="alt"><span># host name of the OpenVPN server. Very useful </span></li>
    <li><span># on machines which are not permanently connected </span></li>
    <li class="alt"><span># to the internet such as laptops. </span></li>
    <li><span>resolv-retry infinite </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Most clients don't need to bind to </span></li>
    <li class="alt"><span># a specific local port number. </span></li>
    <li><span>nobind </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Downgrade privileges after initialization (non-Windows only) </span></li>
    <li class="alt"><span>;user nobody </span></li>
    <li><span>;group nobody </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Try to preserve some state across restarts. </span></li>
    <li class="alt"><span>persist-key </span></li>
    <li><span>persist-tun </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># If you are connecting through an </span></li>
    <li class="alt"><span># HTTP proxy to reach the actual OpenVPN </span></li>
    <li><span># server, put the proxy server/IP and </span></li>
    <li class="alt"><span># port number here. See the man page </span></li>
    <li><span># if your proxy server requires </span></li>
    <li class="alt"><span># authentication. </span></li>
    <li><span>;http-proxy-retry # retry on connection failures </span></li>
    <li class="alt"><span>;http-proxy [proxy server] [proxy port #] </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># Wireless networks often produce a lot </span></li>
    <li><span># of duplicate packets. Set this flag </span></li>
    <li class="alt"><span># to silence duplicate packet warnings. </span></li>
    <li><span>;mute-replay-warnings </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># SSL/TLS parms. </span></li>
    <li class="alt"><span># See the server config file for more </span></li>
    <li><span># description. It's best to use </span></li>
    <li class="alt"><span># a separate .crt/.key file pair </span></li>
    <li><span># for each client. A single ca </span></li>
    <li class="alt"><span># file can be used for all clients. </span></li>
    <li><span>ca ca.crt </span></li>
    <li class="alt"><span>cert client-1.crt </span></li>
    <li><span>key client-1.key </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Verify server certificate by checking </span></li>
    <li class="alt"><span># that the certicate has the nsCertType </span></li>
    <li><span># field set to &quot;server&quot;. This is an </span></li>
    <li class="alt"><span># important precaution to protect against </span></li>
    <li><span># a potential attack discussed here: </span></li>
    <li class="alt"><span># http://openvpn.net/howto.html#mitm </span></li>
    <li><span># </span></li>
    <li class="alt"><span># To use this feature, you will need to generate </span></li>
    <li><span># your server certificates with the nsCertType </span></li>
    <li class="alt"><span># field set to &quot;server&quot;. The build-key-server </span></li>
    <li><span># script in the easy-rsa folder will do this. </span></li>
    <li class="alt"><span>;ns-cert-type server </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># If a tls-auth key is used on the server </span></li>
    <li><span># then every client must also have the key. </span></li>
    <li class="alt"><span>;tls-auth ta.key 1 </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># Select a cryptographic cipher. </span></li>
    <li><span># If the cipher option is used on the server </span></li>
    <li class="alt"><span># then you must also specify it here. </span></li>
    <li><span>;cipher x </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Enable compression on the VPN link. </span></li>
    <li class="alt"><span># Don't enable this unless it is also </span></li>
    <li><span># enabled in the server config file. </span></li>
    <li class="alt"><span>comp-lzo </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># Set log file verbosity. </span></li>
    <li><span>verb 3 </span></li>
    <li class="alt">&nbsp;</li>
    <li><span># Silence repeating messages </span></li>
    <li class="alt"><span>;mute 20 </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>route-method exe </span></li>
    <li><span>route-delay 2 </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p class="text-without-space">其实主要修改的就是如下地方</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_9227');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_9227">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>client </span></span></li>
    <li><span>#说明这个是客户端配置文件 </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>dev tap </span></li>
    <li class="alt"><span>;dev tun </span></li>
    <li><span>#这个和服务器一样就可以 </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>remote 214.174.212.217 1194 </span></li>
    <li class="alt"><span>#这个ip要修改为服务器的公网ip地址 </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>resolv-retry infinite </span></li>
    <li><span>nobind </span></li>
    <li class="alt"><span>persist-key </span></li>
    <li><span>persist-tun </span></li>
    <li class="alt">&nbsp;</li>
    <li>&nbsp;</li>
    <li class="alt"><span>ca ca.crt </span></li>
    <li><span>cert client-1.crt </span></li>
    <li class="alt"><span>key client-1.key </span></li>
    <li><span>#上面三行一定要根据自己生成的密钥配合 </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>comp-lzo </span></li>
    <li class="alt"><span>#启用lzo压缩 </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span># Set log file verbosity. </span></li>
    <li><span>verb 3 </span></li>
    <li class="alt">&nbsp;</li>
    <li>&nbsp;</li>
    <li class="alt"><span>route-method exe </span></li>
    <li><span>route-delay 2 </span></li>
    <li class="alt"><span>#最后这两行win7如果不加上，就不能启动修改路由，导致拨vpn成功，但是不能通过远程服务器做网关上网 </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>这些配置完成后，右键点openvpn gui在桌面右下角图标选择Connect连接</p>
<p>我正确连接后的日志如下</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_3077');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_3077">
<ol class="dp-xml" style="border-bottom: 0px; border-left: 0px; list-style-type: none; margin-left: 5px; border-top: 0px; border-right: 0px">
    <li class="alt"><span><span>Mon Mar 15 13:03:14 2010 OpenVPN 2.0.9 Win32-MinGW [SSL] [LZO] built on Oct 1 2006 </span></span></li>
    <li><span>Mon Mar 15 13:03:14 2010 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earlier used 5000 as the default port. </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:14 2010 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info. </span></li>
    <li><span>Mon Mar 15 13:03:14 2010 LZO compression initialized </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:14 2010 Control Channel MTU parms [ L:1574 D:138 EF:38 EB:0 ET:0 EL:0 ] </span></li>
    <li><span>Mon Mar 15 13:03:14 2010 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ] </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:14 2010 Local Options hash (</span><span class="attribute">VER</span><span>=</span><span class="attribute-value">V4</span><span>): 'd79ca330' </span></li>
    <li><span>Mon Mar 15 13:03:14 2010 Expected Remote Options hash (</span><span class="attribute">VER</span><span>=</span><span class="attribute-value">V4</span><span>): 'f7df56b8' </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:14 2010 UDPv4 link local: [undef] </span></li>
    <li><span>Mon Mar 15 13:03:14 2010 UDPv4 link remote: 204.74.212.217:1194 </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:16 2010 TLS: Initial packet from 204.74.212.217:1194, </span><span class="attribute">sid</span><span>=</span><span class="attribute-value">3d4cf00a</span><span> 84deb309 </span></li>
    <li><span>Mon Mar 15 13:03:18 2010 VERIFY OK: </span><span class="attribute">depth</span><span>=</span><span class="attribute-value">1</span><span>, /</span><span class="attribute">C</span><span>=</span><span class="attribute-value">US</span><span>/</span><span class="attribute">ST</span><span>=</span><span class="attribute-value">Beijing</span><span>/</span><span class="attribute">L</span><span>=</span><span class="attribute-value">BEIJING</span><span>/</span><span class="attribute">O</span><span>=</span><span class="attribute-value">xinlogs</span><span>.com/</span><span class="attribute">CN</span><span>=</span><span class="attribute-value">babodx</span><span>/</span><span class="attribute">emailAddress</span><span>=</span><span class="attribute-value">babodx</span><span>@gmail.com </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:18 2010 VERIFY OK: </span><span class="attribute">depth</span><span>=</span><span class="attribute-value">0</span><span>, /</span><span class="attribute">C</span><span>=</span><span class="attribute-value">US</span><span>/</span><span class="attribute">ST</span><span>=</span><span class="attribute-value">Beijing</span><span>/</span><span class="attribute">O</span><span>=</span><span class="attribute-value">xinlogs</span><span>.com/</span><span class="attribute">CN</span><span>=</span><span class="attribute-value">babodx</span><span>/</span><span class="attribute">emailAddress</span><span>=</span><span class="attribute-value">babodx</span><span>@gmail.com </span></li>
    <li><span>Mon Mar 15 13:03:20 2010 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:20 2010 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication </span></li>
    <li><span>Mon Mar 15 13:03:20 2010 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:20 2010 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication </span></li>
    <li><span>Mon Mar 15 13:03:20 2010 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:20 2010 [babodx] Peer Connection Initiated with 214.174.212.217:1194 </span></li>
    <li><span>Mon Mar 15 13:03:21 2010 SENT CONTROL [babodx]: 'PUSH_REQUEST' (</span><span class="attribute">status</span><span>=</span><span class="attribute-value">1</span><span>) </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:21 2010 PUSH: Received control message: 'PUSH_REPLY,route 10.8.0.0 255.255.255.0,redirect-gateway,dhcp-option DNS 8.8.8.8,route-gateway 10.8.0.1,ping 10,ping-restart 120,ifconfig 10.8.0.3 255.255.255.0' </span></li>
    <li><span>Mon Mar 15 13:03:21 2010 OPTIONS IMPORT: timers and/or timeouts modified </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:21 2010 OPTIONS IMPORT: --ifconfig/up options modified </span></li>
    <li><span>Mon Mar 15 13:03:21 2010 OPTIONS IMPORT: route options modified </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:21 2010 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified </span></li>
    <li><span>Mon Mar 15 13:03:21 2010 TAP-WIN32 device [本地连接 3] opened: .Global{A958F4F2-14AF-49E6-9FBF-4FC25B8D8786}.tap </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:21 2010 TAP-Win32 Driver Version 8.4 </span></li>
    <li><span>Mon Mar 15 13:03:21 2010 TAP-Win32 </span><span class="attribute">MTU</span><span>=</span><span class="attribute-value">1500</span><span> </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:21 2010 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.8.0.3/255.255.255.0 on interface {A958F4F2-14AF-49E6-9FBF-4FC25B8D8786} [DHCP-serv: 10.8.0.0, lease-time: 31536000] </span></li>
    <li><span>Mon Mar 15 13:03:21 2010 Successful ARP Flush on interface [29] {A958F4F2-14AF-49E6-9FBF-4FC25B8D8786} </span></li>
    <li class="alt"><span>Mon Mar 15 13:03:23 2010 TEST ROUTES: 2/2 succeeded </span><span class="attribute">len</span><span>=</span><span class="attribute-value">1</span><span> </span><span class="attribute">ret</span><span>=</span><span class="attribute-value">1</span><span> </span><span class="attribute">a</span><span>=</span><span class="attribute-value">0</span><span> u/</span><span class="attribute">d</span><span>=</span><span class="attribute-value">up</span><span> </span></li>
    <li><span>Mon Mar 15 13:03:23 2010 route ADD 214.174.212.217 MASK 255.255.255.255 192.168.2.1 </span></li>
    <li class="alt"><span>操作完成! </span></li>
    <li><span>Mon Mar 15 13:03:23 2010 route DELETE 0.0.0.0 MASK 0.0.0.0 192.168.2.1 </span></li>
    <li class="alt"><span>操作完成! </span></li>
    <li><span>Mon Mar 15 13:03:23 2010 route ADD 0.0.0.0 MASK 0.0.0.0 10.8.0.1 </span></li>
    <li class="alt"><span>操作完成! </span></li>
    <li><span>Mon Mar 15 13:03:23 2010 route ADD 10.8.0.0 MASK 255.255.255.0 10.8.0.1 </span></li>
    <li class="alt"><span>操作完成! </span></li>
    <li><span>Mon Mar 15 13:03:23 2010 Initialization Sequence Completed </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>&nbsp;</p><br/>Tags - <a href="http://www.xinlogs.com/tags/vpn/" rel="tag">vpn</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/HP-MSA1000-DL380G5-Centos5/</link>
<title><![CDATA[CentOS 5.4 基于HP Proliant DL380 G5服务器配置Modular Smart Array 1000存储]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Fri, 12 Mar 2010 07:56:08 +0000</pubDate> 
<guid>http://www.xinlogs.com/HP-MSA1000-DL380G5-Centos5/</guid> 
<description>
<![CDATA[ 
	<p>原来单位的存储一直是分两个800G的区，挂在到Windows下。Windows的系统总要担心病毒，所以打算迁移到CentOS Linux下。</p>
<p>参考了<a href="http://blog.s135.com/post/415/">http://blog.s135.com/post/415/</a>这篇文章，但是他的文章里是单控制器，并且没有用到光纤。所以配置上有些不同</p>
<p><strong>硬件配置</strong></p>
<p>一台HP MSA 1000存储设备（包含两个Modular Smart Array 1000控制器）</p>
<p>一台HP Storage SAN 4/8光纤交换机</p>
<p>一台HP Proliant DL380 G5 2U服务器</p>
<p>七块SCSI 300G硬盘</p>
<p>一块HP StorageWorks FC1142SR 4GB PCI-E 光纤卡</p>
<p><img alt="" width="400" height="429" src="attachment.php?fid=74" /></p>
<p>从两个Modular Smart Array 1000的控制器后面连接光纤到光纤交换机。然后将光纤卡安装到服务器上，用光纤连接光纤卡到光纤交换机。</p>
<p><img alt="" width="200" height="214" src="attachment.php?fid=75" /><img alt="" width="200" height="214" src="attachment.php?fid=76" /></p>
<p><strong>软件配置</strong></p>
<p>先对各种硬件的fireware进行下更新。</p>
<p>从惠普网站下载update fireware光盘，下载的文件为firmware-8.60-0.zip，大小463M左右，然后解压刻成光盘</p>
<p>下载地址<a href="ftp://ftp.hp.com/pub/softlib2/software1/cd/p1040529012/v53483/firmware-8.60-0.zip">ftp://ftp.hp.com/pub/softlib2/software1/cd/p1040529012/v53483/firmware-8.60-0.zip</a></p>
<p>用光盘启动服务器，然后安装提示做就可以。它会更新网卡、服务器等设备的fireware。都是自动检测并更新的，很简单</p>
<p>确保各种fireware都更新后，下面需要用到smartstart光盘来对存储进行配置了</p>
<p>从惠普网站下载smartstart光盘，下载的文件smartstart-8.30-0-x86.zip，大小576M左右，也是解压刻录光盘</p>
<p>下载地址<a href="ftp://ftp.hp.com/pub/softlib2/software1/cd/p1040463476/v49882/smartstart-8.30-0-x86.zip">ftp://ftp.hp.com/pub/softlib2/software1/cd/p1040463476/v49882/smartstart-8.30-0-x86.zip</a></p>
<p>然后用光盘启动服务器，按照提示进入后，选择第2项配置存储卡，第一项是用来安装操作系统的，我发现没有Linux的操作系统。。。都是Windows系列。</p>
<p>可以发现服务器自己的raid卡 HP Smart Array E200和MSA 1000存储。</p>
<p>我是先将服务器的3块硬盘组成一个Raid 5，然后再配置MSA 1000的存储，也是将7块盘组成Raid 5。我看了下资料，说raid 6比raid5要损失8%-15%的性能，但是可以保证同时坏2块盘不丢失数据。不过我觉得raid5够用了。</p>
<p>因为是双控制器，我这里的fireware是4.48所以采用的是active/standby模式。如果打算用active/active模式，需要更新fireware到7.0版本</p>
<p>用smartstart光盘做好raid后，就可以给服务器安装系统了。</p>
<p><strong>安装CentOS 5.4 64bit</strong></p>
<p>安装CentOS 5.4 64bit版本前，先将连接到服务器的光纤拔掉，要不系统总是提示/dev/sda不可读取，这里的sda就是我们存储。</p>
<p>一切安装正常安装就可以。</p>
<p>正常安装后，连接好光纤，再启动服务器。</p>
<p>这个时候因为没有安装驱动，服务器在启动过程中会报很多end_request: error</p>
<p>而且我还发现如果不安装驱动，我们可以通过fdisk -l查找到存储设备，但是每次重启或者存储关机再开，存储的设备名都会变，有时候是/dev/sda有时候是/dev/sdb。所以很难在/etc/fstab里写入mount的配置。</p>
<p><strong>安装HBA卡驱动</strong></p>
<p>到HP网站下载驱动</p>
<p><a href="http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&amp;cc=us&amp;prodNameId=1809832&amp;prodTypeId=12169&amp;prodSeriesId=1809835&amp;swLang=8&amp;taskId=135&amp;swEnvOID=4004">http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&amp;cc=us&amp;prodNameId=1809832&amp;prodTypeId=12169&amp;prodSeriesId=1809835&amp;swLang=8&amp;taskId=135&amp;swEnvOID=4004</a></p>
<p>也可以直接下载</p>
<p><a href="ftp://ftp.hp.com/pub/softlib/software10/COL19426/co-74973-1/hp_qla2x00-2009-03-17.tar.gz">ftp://ftp.hp.com/pub/softlib/software10/COL19426/co-74973-1/hp_qla2x00-2009-03-17.tar.gz</a></p>
<p><a href="ftp://ftp.hp.com/pub/softlib/software11/COL28061/co-69719-3/hp-fc-enablement-2009-12-16.tar.gz">ftp://ftp.hp.com/pub/softlib/software11/COL28061/co-69719-3/hp-fc-enablement-2009-12-16.tar.gz</a></p>
<p>上面两个文件，一个是qla2x00的驱动，后面一个是Linux fibre channel enablement kits for QLogic HBAs and mezzanine cards</p>
<p>下载后解压安装</p>
<p>
<table cellspacing="1" cellpadding="0" width="100%">
    <tbody>
        <tr>
            <td>
            <h3 class="title2" style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; font-size: 10pt"><a name="d0e2456"></a>Installation instructions</h3>
            </td>
        </tr>
        <tr>
            <td bgcolor="#0066ff" height="4">&nbsp;</td>
        </tr>
    </tbody>
</table>
</p>
<div class="procedure" style="margin-left: 0pt">
<ol type="1" style="font-family: Arial; color: #000000; margin-left: 20pt; font-size: 10pt">
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Download the appropriate driver kit for your distribution. The driver kit file will be in the format <code class="computeroutput" style="font-size: 10pt">hp_qla2x00-yyyy-mm-dd.tar.gz</code>.</p>
    </li>
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Copy the driver kit to the target system.</p>
    </li>
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Uncompress and untar the driver kit using the following command:</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># tar zxvf hp_qla2x00-yyyy-mm-dd.tar.gz</code></p>
    </li>
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Change directory to the <code class="computeroutput" style="font-size: 10pt">hp_qla2x00-yyyy-mm-dd</code> directory.</p>
    </li>
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Execute the <code class="command" style="font-size: 10pt">INSTALL</code> command.</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">The <code class="command" style="font-size: 10pt">INSTALL</code> command syntax will vary depending on your conﬁguration. If a previous driver kit is installed, you can invoke the <code class="command" style="font-size: 10pt">INSTALL</code> command without any arguments as the script will use the currently loaded conﬁguration:</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># ./INSTALL</code></p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">To force the installation to failover mode, use the <code class="computeroutput" style="font-size: 10pt">-f</code> ﬂag:</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># ./INSTALL -f</code></p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">To force the installation to single-path mode, use the <code class="computeroutput" style="font-size: 10pt">-s</code> ﬂag:</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># ./INSTALL -s</code></p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Use the <code class="command" style="font-size: 10pt">-h</code> option of the <code class="command" style="font-size: 10pt">INSTALL</code> script for a list of all supported arguments. The <code class="command" style="font-size: 10pt">INSTALL</code> script will install the appropriate driver RPM for your conﬁguration, as well as the appropriate ﬁbreutils RPM. Once the <code class="command" style="font-size: 10pt">INSTALL</code> script is ﬁnished, you will either have to reload the QLogic driver modules (qla2xxx, qla2300, qla2400, qla2xxx_conf) or reboot your server.</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">The commands to reload the driver are:</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># /opt/hp/src/hp_qla2x00src/unload.sh</code></p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># modprobe qla2xxx_conf</code></p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># modprobe qla2xxx</code></p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># modprobe qla2300</code></p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># modprobe qla2400</code></p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">The command to reboot the server is:</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># reboot</code></p>
    <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in">
    <table border="0" cellspacing="1" summary="Caution" cellpadding="0">
        <tbody>
            <tr>
                <td>&nbsp;</td>
                <td bgcolor="#555555" height="3">&nbsp;</td>
            </tr>
            <tr>
                <td valign="top" rowspan="2" width="25" align="center">&nbsp;</td>
                <th align="left">&nbsp;</th>
            </tr>
            <tr>
                <td valign="top" align="left">
                <p style="font-family: Arial; color: #000000; font-size: 10pt"><span style="font-weight: bold">CAUTION: </span>If your boot device is a SAN attached device you will have to reboot your server.</p>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td bgcolor="#555555" height="1">&nbsp;</td>
            </tr>
            <tr>
                <td height="10" colspan="2">&nbsp;</td>
            </tr>
        </tbody>
    </table>
    </div>
    </li>
</ol>
</div>
<p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">To verify which RPM versions are installed, use the <code class="command" style="font-size: 10pt">rpm</code> command with the <code class="command" style="font-size: 10pt">-q</code> option.</p>
<p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">For example:</p>
<p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># rpm -q hp_qla2x00src</code></p>
<p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># rpm &ndash;q fibreutils</code></p>
<p>然后在继续安装HP Fibre Channel Enablement Kit</p>
<p>
<table cellspacing="1" cellpadding="0" width="100%">
    <tbody>
        <tr>
            <td>
            <h3 class="title2" style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; font-size: 10pt"><a name="d0e2332"></a>Installing the HP Fibre Channel Enablement Kit</h3>
            </td>
        </tr>
        <tr>
            <td bgcolor="#0066ff" height="4">&nbsp;</td>
        </tr>
    </tbody>
</table>
</p>
<p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">To install the HP Fibre Channel Enablement Kit, do the following:</p>
<div class="orderedlist">
<ol type="1" style="font-family: Arial; color: #000000; margin-left: 20pt; font-size: 10pt">
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Download the <code class="computeroutput" style="font-size: 10pt">hp-fc-enablement-yyyy-mm-dd.tar.gz</code> file for your operating system and copy it to the target server</p>
    </li>
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Untar the enablement kit by executing the command to create the directory, <code class="command" style="font-size: 10pt">hp-fc-enablement-yyyy-mm-dd</code>.</p>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># tar zxvf hp-fc-enablement-yyyy-mm-dd.tar.gz</code></p>
    </li>
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Browse to the directory <code class="command" style="font-size: 10pt">hp-fc-enablement-yyyy-mm-dd</code>.</p>
    </li>
    <li>
    <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">Do one of the following to execute the <code class="command" style="font-size: 10pt">install.sh</code> script.</p>
    <div class="orderedlist">
    <ol type="a" style="font-family: Arial; color: #000000; margin-left: 20pt; font-size: 10pt">
        <li>
        <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">If you are not using Device Mapper multipathing execute the following command:</p>
        <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># ./install.sh -s </code></p>
        </li>
        <li>
        <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">If you are using Device Mapper multipathing execute the following command:</p>
        <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># ./install.sh -m</code></p>
        <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt">The <code class="computeroutput" style="font-size: 10pt">hp-fc-enablement</code> and <code class="computeroutput" style="font-size: 10pt">fibreutils</code> RPMs should be installed once this install completes. To verify the installation, enter the following commands:</p>
        <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># rpm -q hp-fc-enablement </code></p>
        <p style="margin-top: 4pt; font-family: Arial; margin-bottom: 0pt; color: #000000; font-size: 10pt"><code class="command" style="font-size: 10pt"># rpm -q fibreutils </code></p>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in">
        <table border="0" cellspacing="1" summary="Note" cellpadding="0">
            <tbody>
                <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#555555" height="3">&nbsp;</td>
                </tr>
                <tr>
                    <td valign="top" rowspan="2" width="25" align="center">&nbsp;</td>
                    <th align="left">&nbsp;</th>
                </tr>
                <tr>
                    <td valign="top" align="left">
                    <p style="font-family: Arial; color: #000000; font-size: 10pt"><span style="font-weight: bold">NOTE: </span>For use with the driver that comes with the kernel you will need fibreutils 3.x or greater.</p>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#555555" height="1">&nbsp;</td>
                </tr>
                <tr>
                    <td height="10" colspan="2">&nbsp;</td>
                </tr>
            </tbody>
        </table>
        </div>
        </li>
    </ol>
    </div>
    </li>
</ol>
</div>
<p>全部完成后，我们需要查看下/etc/modprobe.conf</p>
<p>如果有下面图中标记的一些信息加入，说明上面的驱动安装正确。</p>
<p><img width="800" height="250" alt="" src="attachment.php?fid=77" /></p>
<p>确实正确后，我们重启下服务器。</p>
<p>当再次进入系统后，我们的存储应该被识别为/dev/sda设备</p>
<p>用fdisk -l /dev/sda查看下，如果没有问题了，就可以使用fdisk /dev/sda进行分区</p>
<p>我是把全部1.6T分成一个区/dev/sda1</p>
<p>然后e2lable /dev/sda1 /data给卷标</p>
<p>在/etc/fstab文件里加入/dev/sda1的挂着位置</p>
<p>这样以后每次启动系统，就自动将存储挂着到系统的/data目录中了。如下图</p>
<p><img width="500" height="300" alt="" src="attachment.php?fid=78" /></p>
<p><strong>总结</strong></p>
<p>本来参考<a href="http://www.s135.com">www.s135.com</a>博主的文章配置的，后来发现因为用了光纤卡，不安装驱动会有问题。还有就是双控制器的active/active和active/standby模式需要通过刷新不同的fireware实现。总得来说这个存储配置起来不难，安装官方文档和网络上一些文档就可以。写这篇文档就是为了记录下自己的配置过程，省的以后再配置还要到处找文档查资料。</p><br/>Tags - <a href="http://www.xinlogs.com/tags/%25E5%25AD%2598%25E5%2582%25A8/" rel="tag">存储</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/postfix-extmail-attachment-bug/</link>
<title><![CDATA[postfix+extmail的附件大小显示和限制问题解决办法]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Sun, 24 Jan 2010 14:03:27 +0000</pubDate> 
<guid>http://www.xinlogs.com/postfix-extmail-attachment-bug/</guid> 
<description>
<![CDATA[ 
	<p>最近在给一个公司部署了postfix+<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=extmail">extmail</span>的<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%E9%82%AE%E4%BB%B6">邮件</span><span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%E7%B3%BB%E7%BB%9F">系统</span>后，遇到了附件大小限制问题。<br />
<br />
ext<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=mail">mail</span>默认设置是5M，但是由于extmail的统计大小方法问题，一般附件限制比设置的小了1/3。也就是你设置了5M，也就能到3M多。<br />
<br />
这里先说下大小限制的配置。<br />
<br />
一、修改extmail的<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=web">web</span>mail.cf文件<br />
<br />
SYS_MESSAGE_SIZE_LIMIT = 5242880 注意：以位为单位为5M字节。 <br />
<br />
SYS_MESSAGE_SIZE_LIMIT = xxx<br />
<br />
二、修改/etc/postfix/main.cf文件，<br />
<br />
message_size_limit = xxx<br />
<br />
<br />
三、重启postfix即可，service postfix restrart 和重启apache，service httpd restart<br />
<br />
<br />
<strong>如何解决附件限制大小和系统文件大小相差1/3呢？</strong></p>
<p>首先是修改/var/www/extsuite/extmail/libs/Ext/App目录下的Compose.pm文件<br />
&nbsp;</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_4811');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_4811">
<ol class="dp-xml">
    <li class="alt"><span><span>sub&nbsp;is_oversize&nbsp;{ &nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$</span><span class="attribute">self</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">shift</span><span>; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$</span><span class="attribute">sys</span><span>&nbsp;=&nbsp;$self-</span><span class="tag">&gt;</span><span>{sysconfig}; &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$</span><span class="attribute">maxsize</span><span>&nbsp;=&nbsp;$sys-</span><span class="tag">&gt;</span><span>{SYS_MESSAGE_SIZE_LIMIT}; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$</span><span class="attribute">tsize</span><span>&nbsp;=&nbsp;</span><span class="attribute-value">shift</span><span>; &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;0&nbsp;unless&nbsp;defined&nbsp;$maxsize&nbsp;and&nbsp;$maxsize&nbsp;</span><span class="tag">&gt;</span><span>&nbsp;0; &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;0&nbsp;unless&nbsp;defined&nbsp;$tsize&nbsp;and&nbsp;$tsize&nbsp;</span><span class="tag">&gt;</span><span>&nbsp;0; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($tsize&nbsp;</span><span class="tag">&gt;</span><span>=&nbsp;$maxsize)&nbsp;{ &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$maxsize; &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;0; &nbsp;&nbsp;</span></li>
    <li><span>} &nbsp;&nbsp;</span></li>
</ol>
</div>
<link href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" type="text/css" rel="stylesheet" />
<script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script>
</div>
<p><br />
注意到上面的if ($tsize &gt;= $maxsize)了吧，修改为if ($tsize &gt;= 1.29*$maxsize)<br />
<br />
这样修改后，基本extmail的附件限制大小就和系统显示的文件大小一样。<br />
<br />
目前还有一个文件，就是我们上传一个1M的内容，显示出来的附件大小大约是1.3M，这个问题需要修改一个human函数解决。<br />
<br />
在/var/www/extsuite/extmail/libs/Ext目录下，打开Utils.pm文件<br />
<br />
找到如下函数<br />
<br />
&nbsp;</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_6657');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_6657">
<ol class="dp-xml">
    <li class="alt"><span><span>sub&nbsp;human_size&nbsp;{ &nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$</span><span class="attribute">s</span><span>&nbsp;=&nbsp;$_[0]; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;if($s</span><span class="tag">&lt;</span><span class="tag-name">1024</span><span>)&nbsp;{ &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;sprintf(&quot;%0.2f&quot;,&nbsp;$s/1024).&quot;K&quot;; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}elsif($s</span><span class="tag">&lt;</span><span class="tag-name">1024</span><span>*1024)&nbsp;{ &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;sprintf(&quot;%0.1f&quot;,&nbsp;$s/1024).&quot;K&quot;; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}else&nbsp;{ &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;sprintf(&quot;%0.1f&quot;,&nbsp;$s/(1024*1024)).&quot;M&quot;; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;</span></li>
    <li><span>} &nbsp;&nbsp;</span></li>
</ol>
</div>
<link href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" type="text/css" rel="stylesheet" />
<script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script>
</div>
<p>将函数修改如下<br />
&nbsp;</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_7785');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_7785">
<ol class="dp-xml">
    <li class="alt"><span><span>sub&nbsp;human_size&nbsp;{ &nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$</span><span class="attribute">s</span><span>&nbsp;=&nbsp;$_[0]; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;if($s</span><span class="tag">&lt;</span><span class="tag-name">1024</span><span>)&nbsp;{ &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;sprintf(&quot;%0.2f&quot;,&nbsp;$s/1024/1.36).&quot;K&quot;; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}elsif($s</span><span class="tag">&lt;</span><span class="tag-name">1024</span><span>*1024)&nbsp;{ &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;sprintf(&quot;%0.1f&quot;,&nbsp;$s/1024/1.36).&quot;K&quot;; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}else&nbsp;{ &nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;sprintf(&quot;%0.1f&quot;,&nbsp;$s/(1024*1024*1.36)).&quot;M&quot;; &nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;</span></li>
    <li><span>} &nbsp;&nbsp;</span></li>
</ol>
</div>
<link href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" type="text/css" rel="stylesheet" />
<script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script>
</div>
<p>这样就解决了extmail的附件大小显示和限制问题。<br />
<br />
目前还有一个遗留问题，就是在folder.htm模板界面里显示的邮件大小还是比系统文件大1/3。这个不知道怎么修改了。找到了对应函数，但是它直接显示的多少M或者多少K，用除1.36会出现问题。。。。这个期待<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%E9%AB%98%E6%89%8B">高手</span>解决了。</p><br/>Tags - <a href="http://www.xinlogs.com/tags/extmail/" rel="tag">extmail</a> , <a href="http://www.xinlogs.com/tags/postfix/" rel="tag">postfix</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/extman/</link>
<title><![CDATA[extman后台登陆问题解决方法]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Tue, 19 Jan 2010 02:16:38 +0000</pubDate> 
<guid>http://www.xinlogs.com/extman/</guid> 
<description>
<![CDATA[ 
	<p>前一阵子给一个公司架设了postfix+mysql+extmail的邮件系统。</p>
<p>用了一段时间后，发现后台管理的extman不能登录了，提示如下</p>
<p>Can't open /tmp/<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=extman">extman</span>//sid_26da75f9aec35f2cbc6b4fa425ab525e, No such file or directory<br />
&nbsp;</p>
<p>后来发现是/tmp目录下的extman目录被系统清除了。。</p>
<p>然后再网络上找了一些解决办法，说是Linux系统在启动的时候，会清理/tmp目录。建议将这个目录设置在/var/tmp目录下。</p>
<p>结果用了一段时间后，发现一样是被清理。。。。</p>
<p>我的系统是CentOS 5.3 64bit</p>
<p>最后我通过修改，/var/www/extsuite/extman/webmail.cf文件里面的配置</p>
<blockquote># sys_sess_dir, the session dir<br />
SYS_SESS_DIR = /tmp/extman/</blockquote>
<p>将SYS_SESS_DIR指定到了/data/extman下面了。估计这次系统不会清除这个目录了吧</p>
<p>还有一种常见错误就是提示</p>
<p>Can't open /tmp/extman//sid_89b33ec5ce0b5903f24035aa4ad76d15, Permission denied</p>
<p>这个是因为extman 那个临时目录的权限不对。</p>
<p>可以设置为777就ok了</p><br/>Tags - <a href="http://www.xinlogs.com/tags/extman/" rel="tag">extman</a> , <a href="http://www.xinlogs.com/tags/%25E7%2599%25BB%25E5%25BD%2595%25E9%2597%25AE%25E9%25A2%2598/" rel="tag">登录问题</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/druapl-url-nginx-rewrite/</link>
<title><![CDATA[drupal在nginx 0.8.15下的简洁URL配置]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Fri, 01 Jan 2010 05:40:55 +0000</pubDate> 
<guid>http://www.xinlogs.com/druapl-url-nginx-rewrite/</guid> 
<description>
<![CDATA[ 
	<p>最近在学习drupal，发现这个程序比xoops、joomla都灵活，对应的学习曲线也高。反正安装后，根本不知道真没设置。呵呵</p>
<p>下面先在nginx上配置了rewrite规则，让drupal支持简洁的URL</p>
<p></p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_6531');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_6531">
<ol class="dp-c">
    <li class="alt"><span><span>server </span></span></li>
    <li><span>{ </span></li>
    <li class="alt"><span>listen 80; </span></li>
    <li><span>server_name drupal.xinlogs.com; </span></li>
    <li class="alt"><span>index index.html index.htm index.php; </span></li>
    <li><span>root /data0/htdocs/drupal; </span></li>
    <li class="alt">&nbsp;</li>
    <li><span><span class="preprocessor">#limit_conn crawler 20; </span></span></li>
    <li class="alt"><span>location = / { </span></li>
    <li><span>index index.php; </span></li>
    <li class="alt"><span>} </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>location / { </span></li>
    <li><span>index index.php index.html; </span></li>
    <li class="alt">&nbsp;</li>
    <li><span class="keyword">if</span><span> (!-f $request_filename) { </span></li>
    <li class="alt"><span>rewrite ^(.*)$ /index.php?q=$1 last; </span></li>
    <li><span class="keyword">break</span><span>; </span></li>
    <li class="alt"><span>} </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span class="keyword">if</span><span> (!-d $request_filename) { </span></li>
    <li><span>rewrite ^(.*)$ /index.php?q=$1 last; </span></li>
    <li class="alt"><span class="keyword">break</span><span>; </span></li>
    <li><span>} </span></li>
    <li class="alt"><span>} </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>location ~ .*.(php&#124;php5)?$ </span></li>
    <li><span>{ </span></li>
    <li class="alt"><span>fastcgi_pass unix:/tmp/php-cgi.sock; </span></li>
    <li><span><span class="preprocessor">#fastcgi_pass 127.0.0.1:9000; </span></span></li>
    <li class="alt"><span>fastcgi_index index.php; </span></li>
    <li><span>include fcgi.conf; </span></li>
    <li class="alt"><span>} </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>location ~ .*.(gif&#124;jpg&#124;jpeg&#124;png&#124;bmp&#124;swf)$ </span></li>
    <li><span>{ </span></li>
    <li class="alt"><span>expires 30d; </span></li>
    <li><span>} </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>location ~ .*.(js&#124;css)?$ </span></li>
    <li class="alt"><span>{ </span></li>
    <li><span>expires 1h; </span></li>
    <li class="alt"><span>} </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>log_format drupal_access </span><span class="string">'$remote_addr - $remote_user [$time_local] &quot;$request&quot; '</span><span> </span></li>
    <li><span class="string">'$status $body_bytes_sent &quot;$http_referer&quot; '</span><span> </span></li>
    <li class="alt"><span class="string">'&quot;$http_user_agent&quot; $http_x_forwarded_for'</span><span>; </span></li>
    <li><span>access_log /data1/logs/drupal_access.log drupal_access; </span></li>
    <li class="alt"><span>} </span></li>
</ol>
</div>
<link href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" type="text/css" rel="stylesheet" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>&nbsp;</p><br/>Tags - <a href="http://www.xinlogs.com/tags/drupal/" rel="tag">drupal</a> , <a href="http://www.xinlogs.com/tags/%25E7%25AE%2580%25E6%25B4%2581url/" rel="tag">简洁url</a> , <a href="http://www.xinlogs.com/tags/nginx/" rel="tag">nginx</a> , <a href="http://www.xinlogs.com/tags/rewrite%25E9%2585%258D%25E7%25BD%25AE/" rel="tag">rewrite配置</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/apache-VirtualHost-Configure/</link>
<title><![CDATA[apache下多虚拟主机的配置与管理]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Wed, 30 Dec 2009 08:57:34 +0000</pubDate> 
<guid>http://www.xinlogs.com/apache-VirtualHost-Configure/</guid> 
<description>
<![CDATA[ 
	<p>当一台服务器想给多个域名提供web服务的时候，我们可以使用apache虚拟主机配置。</p>
<p>apache的配置文件在centos系统下，默认放在/etc/httpd/conf目录下的httpd.conf文件里。</p>
<p>虚拟主机的配置如下</p>
<div class="codeText">
<div class="codeHead"><span class="copyCodeText" onclick="copyIdText('code_8025');" style="cursor: pointer">复制内容到剪贴板</span></div>
<div id="code_8025">
<ol class="dp-cpp">
    <li class="alt"><span><span class="preprocessor">#############TEST VirtualHost </span></span></li>
    <li><span>&lt;VirtualHost *:80&gt; </span></li>
    <li class="alt"><span>ServerAdmin <a href="mailto:babodx@gmail.com">babodx@gmail.com</a></span></li>
    <li><span>DocumentRoot </span><span class="string">&quot;/home/babo&quot;</span><span> </span></li>
    <li class="alt"><span>ServerName <a href="http://www.xinlogs.com">www.xinlogs.com</a> </span></li>
    <li><span>DirectoryIndex index.html </span></li>
    <li class="alt"><span>ErrorLog logs/www.xinlogs.com_error_log </span></li>
    <li><span>CustomLog logs/www.xinlogs.com-access_log common </span></li>
    <li class="alt">&nbsp;</li>
    <li class="alt"><span>&lt;/VirtualHost&gt; </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>如果我们apache给10个或更多的域名提供web服务，这样的话，我们的httpd.conf就会有很多&lt;VirtualHost *:80&gt;这样的配置段落，看起来很长，管理起来也很麻烦。而且一个apache同时给几十个web域名提供虚拟主机，完全没有问题。那该如何写配置文件便于我们管理呢？</p>
<p><strong>解决办法</strong></p>
<p>为了管理方便，配置文件的结构清晰。</p>
<p>我们完全可以将每个虚拟主机的配置文件放在独立文件中，这样apache的主要配置文件httpd.conf看上去很简洁。</p>
<p>只要在最后加入</p>
<div class="codeText"><span class="copyCodeText" onclick="copyIdText('code_3505');" style="cursor: pointer">复制内容到剪贴板</span>
<div id="code_3505">
<ol class="dp-xml">
    <li class="alt"><span><span>Include conf/vhost_*.conf </span></span></li>
</ol>
</div>
</div>
<p>&nbsp;</p>
<p>然后再conf目录里，每个虚拟主机的文件只要以vhost_开头，后面可以用自己的域名加.conf后缀。比如有个test.com的域名要做web。</p>
<p>我们就可以直接在conf目录创建一个vhost_test.com.conf文件，文件里写入虚拟主机配置，比如</p>
<div class="codeText">
<div class="codeHead"><span class="copyCodeText" onclick="copyIdText('code_7220');" style="cursor: pointer">复制内容到剪贴板</span></div>
<div id="code_7220">
<ol class="dp-xml">
    <li class="alt"><span><span>#############TEST VirtualHost </span></span></li>
    <li><span class="tag">&lt;</span><span class="tag-name">VirtualHost</span><span> *:80</span><span class="tag">&gt;</span><span> </span></li>
    <li class="alt"><span>ServerAdmin <a href="mailto:babodx@gmail.com">babodx@gmail.com</a></span></li>
    <li><span>DocumentRoot &quot;/home/test.com&quot; </span></li>
    <li class="alt"><span>ServerName test.com </span></li>
    <li><span>DirectoryIndex index.html </span></li>
    <li class="alt"><span>ErrorLog logs/test.com_error_log </span></li>
    <li><span>CustomLog logs/test.com-access_log common </span></li>
    <li class="alt">&nbsp;</li>
    <li><span class="tag">&lt;/</span><span class="tag-name">VirtualHost</span><span class="tag">&gt;</span><span> </span></li>
</ol>
</div>
<link rel="stylesheet" type="text/css" href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>通过这种配置结构，我们管理再多的虚拟主机也不用怕。只要修改conf目录下对应虚拟主机的配置文件即可。</p><br/>Tags - <a href="http://www.xinlogs.com/tags/apache/" rel="tag">apache</a> , <a href="http://www.xinlogs.com/tags/virtualhost/" rel="tag">virtualhost</a> , <a href="http://www.xinlogs.com/tags/configure/" rel="tag">configure</a> , <a href="http://www.xinlogs.com/tags/admin/" rel="tag">admin</a> , <a href="http://www.xinlogs.com/tags/%25E8%2599%259A%25E6%258B%259F%25E4%25B8%25BB%25E6%259C%25BA%25E9%2585%258D%25E7%25BD%25AE/" rel="tag">虚拟主机配置</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/Tomcat-reboot-problems/</link>
<title><![CDATA[解决Linux下Tomcat不能重启和停止问题]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Mon, 28 Dec 2009 03:12:51 +0000</pubDate> 
<guid>http://www.xinlogs.com/Tomcat-reboot-problems/</guid> 
<description>
<![CDATA[ 
	<p>我的Tomcat 5.5.28安装在CentOS 5.3 64bit系统上<br />
每次重启都停住，只要要等5-10分钟才可以。<br />
系统reboot或者shutdown也都卡在关闭tomcat的过程中<br />
后来发现直接用/usr/local/tomcat/bin/shutdown.sh一样存在问题，但是如果Tomcat什么项目都不加载，却正常。<br />
我怀疑是tomcat加载的lib或者jar文件一多，重启和关闭就会慢的巨慢。。。甚至10分钟以上。<br />
为了解决这个问题，我修改了/etc/init.d/目录下的tomcat文件，让关闭或者重启的时候，直接通过kill命令杀掉tomcat进程。<br />
下面是我/etc/init.d/tomcat文件<br />
<br />
&nbsp;</p>
<div class="codeText">
<div class="codeHead"><span class="lantxt">C/C++ 代码</span><span class="copyCodeText" onclick="copyIdText('code_7437');" style="cursor: pointer">复制内容到剪贴板</span></div>
<div id="code_7437">
<ol class="dp-cpp">
    <li class="alt"><span><span class="preprocessor">#!/bin/bash </span></span></li>
    <li><span class="preprocessor"># </span></li>
    <li class="alt"><span class="preprocessor"># Startup script for the tomcat </span></li>
    <li><span class="preprocessor"># </span></li>
    <li class="alt"><span class="preprocessor"># chkconfig: 345 80 15 </span></li>
    <li><span class="preprocessor"># description: Tomcat is a Servlet+JSP Engine. </span></li>
    <li class="alt">&nbsp;</li>
    <li><span class="preprocessor"># Source function library. </span></li>
    <li class="alt"><span>. /etc/rc.d/init.d/functions </span></li>
    <li>&nbsp;</li>
    <li class="alt">&nbsp;</li>
    <li><span>export JAVA_HOME=/usr/local/jdk1.6.0_16 </span></li>
    <li class="alt"><span>export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar </span></li>
    <li><span>export PATH=$PATH:$JAVA_HOME/bin </span></li>
    <li class="alt">&nbsp;</li>
    <li><span>export CATALINA_BASE=/usr/local/tomcat </span></li>
    <li class="alt"><span>export CATALINA_HOME=/usr/local/tomcat </span></li>
    <li><span>export CATALINA_TMPDIR=/usr/local/tomcat/temp </span></li>
    <li class="alt"><span>export JRE_HOME=/usr/local/jdk1.6.0_16 </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>start(){ </span></li>
    <li><span class="keyword">if</span><span> [ -z $(/sbin/pidof java) ]; then </span></li>
    <li class="alt"><span>echo </span><span class="string">&quot;Starting tomcat&quot;</span><span> </span></li>
    <li><span>/usr/local/tomcat/bin/startup.sh </span></li>
    <li class="alt"><span>touch /var/lock/subsys/tomcat </span></li>
    <li><span class="keyword">else</span><span> </span></li>
    <li class="alt"><span>echo </span><span class="string">&quot;tomcat allready running&quot;</span><span> </span></li>
    <li><span>fi </span></li>
    <li class="alt"><span>} </span></li>
    <li>&nbsp;</li>
    <li class="alt">&nbsp;</li>
    <li><span>stop(){ </span></li>
    <li class="alt"><span class="keyword">if</span><span> [ ! -z $(/sbin/pidof java) ]; then </span></li>
    <li><span>echo </span><span class="string">&quot;Shutting down tomcat&quot;</span><span> </span><span>
    <p><font color="#000000"><span class="preprocessor">#下面就是关闭的核心代码了，用ps获取tomcat进程id，直接kill掉 </span></font></p>
    </span></li>
    <li class="alt"><span>ps aux&#124;grep tomcat&#124;grep startup&#124;awk </span><span class="string">'{print $2}'</span><span>&#124;xargs kill -9 </span></li>
    <li><span class="preprocessor">#/usr/local/tomcat/bin/shutdown.sh </span></li>
    <li class="alt"><span>until [ -z $(/sbin/pidof java) ]; </span><span class="keyword">do</span><span> :; done </span></li>
    <li><span>rm -f /var/lock/subsys/tomcat </span></li>
    <li class="alt"><span class="keyword">else</span><span> </span></li>
    <li><span>echo </span><span class="string">&quot;tomcat not running&quot;</span><span> </span></li>
    <li class="alt"><span>fi </span></li>
    <li><span>} </span></li>
    <li class="alt">&nbsp;</li>
    <li>&nbsp;</li>
    <li class="alt"><span class="keyword">case</span><span> </span><span class="string">&quot;$1&quot;</span><span> in </span></li>
    <li><span>start) </span></li>
    <li class="alt"><span>start </span></li>
    <li><span>;; </span></li>
    <li class="alt"><span>stop) </span></li>
    <li><span>stop </span></li>
    <li class="alt"><span>;; </span></li>
    <li><span>restart) </span></li>
    <li class="alt"><span>stop </span></li>
    <li><span>start </span></li>
    <li class="alt"><span>;; </span></li>
    <li><span>status) </span></li>
    <li class="alt"><span>/usr/local/tomcat/bin/catalina.sh version </span></li>
    <li><span>;; </span></li>
    <li class="alt"><span>*) </span></li>
    <li><span>echo </span><span class="string">&quot;Usage: $0 {start&#124;stop&#124;restart&#124;status}&quot;</span><span> </span></li>
    <li class="alt"><span>esac </span></li>
    <li>&nbsp;</li>
    <li class="alt"><span>exit 0 </span></li>
    <li>&nbsp;</li>
    <li class="alt">&nbsp;</li>
</ol>
</div>
<link href="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/insertcode.css" type="text/css" rel="stylesheet" /><script language="javascript" src="http://www.xinlogs.com/editor/fckeditor/editor/plugins/insertcode/excute.js" type="text/javascript"></script></div>
<p>&nbsp;</p><br/>Tags - <a href="http://www.xinlogs.com/tags/tomcat/" rel="tag">tomcat</a> , <a href="http://www.xinlogs.com/tags/centos/" rel="tag">centos</a> , <a href="http://www.xinlogs.com/tags/linux/" rel="tag">linux</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/nginx-epool-events/</link>
<title><![CDATA[nginx采用epoll的事件模型，为何效率高。]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Thu, 24 Dec 2009 15:22:36 +0000</pubDate> 
<guid>http://www.xinlogs.com/nginx-epool-events/</guid> 
<description>
<![CDATA[ 
	<p>以前就知道在linux下nginx采用epoll事件模型，处理效率高。但是一直不知道具体为什么，今天查看了下文档，了解了原因。<br />首先nginx支持一下这些事件模型（才考nginx的wiki）<br /></p><p>Nginx支持如下处理连接的方法（I/O复用方法），这些方法可以通过<span style="font-family: Courier New">use</span>指令指定。 </p><ul><li><strong>select</strong> - 标准方法。 如果当前平台没有更有效的方法，它是编译时默认的方法。你可以使用配置参数 <span style="font-family: Courier New">--with-select_module</span> 和 <span style="font-family: Courier New">--without-select_module</span> 来启用或禁用这个模块。 </li><li><strong>poll</strong> - 标准方法。 如果当前平台没有更有效的方法，它是编译时默认的方法。你可以使用配置参数 <span style="font-family: Courier New">--with-poll_module</span> 和 <span style="font-family: Courier New">--without-poll_module</span> 来启用或禁用这个模块。 </li><li><strong>kqueue</strong> - 高效的方法，使用于 FreeBSD 4.1+, OpenBSD 2.9+, NetBSD 2.0 和 MacOS X. 使用双处理器的MacOS X系统使用kqueue可能会造成内核崩溃。 </li><li><strong>epoll</strong> - 高效的方法，使用于Linux内核2.6版本及以后的系统。在某些发行版本中，如SuSE 8.2, 有让2.4版本的内核支持epoll的补丁。 </li><li><strong>rtsig</strong> - 可执行的实时信号，使用于Linux内核版本2.2.19以后的系统。默认情况下整个系统中不能出现大于1024个POSIX实时(排队)信号。这种情况对于高负载的服务器来说是低效的；所以有必要通过调节内核参数 <span style="font-family: Courier New">/proc/sys/kernel/rtsig-max</span> 来增加队列的大小。可是从Linux内核版本2.6.6-mm2开始， 这个参数就不再使用了，并且对于每个进程有一个独立的信号队列，这个队列的大小可以用 RLIMIT_SIGPENDING 参数调节。当这个队列过于拥塞，nginx就放弃它并且开始使用 <span style="font-family: Courier New">poll</span> 方法来处理连接直到恢复正常。 </li><li><strong>/dev/poll</strong> - 高效的方法，使用于 Solaris 7 11/99+, HP/UX 11.22+ (eventport), IRIX 6.5.15+ 和 Tru64 UNIX 5.1A+. </li><li><strong>eventport</strong> - 高效的方法，使用于 Solaris 10. 为了防止出现内核崩溃的问题， 有必要安装 <a rel="nofollow" href="http://sunsolve.sun.com/search/document.do?assetkey=1-26-102485-1" title="http://sunsolve.sun.com/search/document.do?assetkey=1-26-102485-1" class="external text">这个</a> 安全补丁。 </li></ul><p>在linux下面，只有epoll是高效的方法。<br /><br />下面再来看看epoll到底是如何高效的<br />Epoll是<a href="http://www.hudong.com/wiki/Linux&aring;&aelig;%20&cedil;" target="_blank" title="Linux内核" class="innerlink">Linux内核</a>为处理大批量句柄而作了改进的<a href="http://www.hudong.com/wiki/poll" target="_blank" title="poll" class="innerlink">poll</a>。要使用epoll只需要这三个系统调用：epoll_create(2)， epoll_ctl(2)， epoll_wait(2)。它是在2.5.44内核中被引进的(epoll(4) is a new API introduced in Linux kernel 2.5.44)，在2.6内核中得到广泛应用。<br /><br />epoll的优点<br /></p><ul><li>支持一个进程打开大数目的<a href="http://www.hudong.com/wiki/socket" target="_blank" title="socket" class="innerlink">socket</a>描述符(FD)</li></ul><p>select 最不能忍受的是一个进程所打开的FD是有一定限制的，由FD_SETSIZE设置，默认值是2048。对于那些需要支持的上万连接数目的IM服务器来说显然太少了。这时候你一是可以选择修改这个宏然后重新编译内核，不过资料也同时指出这样会带来网络效率的下降，二是可以选择多进程的解决方案(传统的Apache方案)，不过虽然linux上面创建进程的代价比较小，但仍旧是不可忽视的，加上进程间数据同步远比不上线程间同步的高效，所以也不是一种完美的方案。不过 epoll则没有这个限制，它所支持的FD上限是最大可以打开文件的数目，这个数字一般远大于2048,举个例子,在1GB内存的机器上大约是10万左右，具体数目可以cat /proc/sys/fs/file-max察看,一般来说这个数目和系统内存关系很大。</p><ul><li>IO效率不随FD数目增加而线性下降</li></ul><p>传统的select/poll另一个致命弱点就是当你拥有一个很大的socket集合，不过由于网络延时，任一时间只有部分的socket是&quot;活跃&quot;的，但是select/poll每次调用都会线性扫描全部的集合，导致效率呈现线性下降。但是epoll不存在这个问题，它只会对&quot;活跃&quot;的socket进行操作---这是因为在内核实现中epoll是根据每个fd上面的callback函数实现的。那么，只有&quot;活跃&quot;的socket才会主动的去调用 callback函数，其他idle状态socket则不会，在这点上，epoll实现了一个&quot;伪&quot;AIO，因为这时候推动力在os内核。在一些 benchmark中，如果所有的socket基本上都是活跃的---比如一个高速LAN环境，epoll并不比select/poll有什么效率，相反，如果过多使用epoll_ctl,效率相比还有稍微的下降。但是一旦使用idle connections模拟<a href="http://www.hudong.com/wiki/WAN" target="_blank" title="WAN" class="innerlink">WAN</a>环境,epoll的效率就远在select/poll之上了。</p><ul><li>使用<a href="http://www.hudong.com/wiki/mmap" title="mmap" class="innerlink">mmap</a>加速内核与用户空间的消息传递。</li></ul><p>这点实际上涉及到epoll的具体实现了。无论是select,poll还是epoll都需要内核把FD消息通知给用户空间，如何避免不必要的内存拷贝就很重要，在这点上，epoll是通过内核于用户空间mmap同一块内存实现的。而如果你想我一样从2.5内核就关注epoll的话，一定不会忘记手工 mmap这一步的。</p><ul><li>内核微调</li></ul><p>这一点其实不算epoll的优点了，而是整个linux平台的优点。也许你可以怀疑linux平台，但是你无法回避linux平台赋予你微调内核的能力。比如，内核<a href="http://www.hudong.com/wiki/TCP/IP" target="_blank" title="TCP/IP" class="innerlink">TCP/IP</a>协议栈使用内存池管理sk_buff结构，那么可以在运行时期动态调整这个内存pool(skb_head_pool)的大小--- 通过echo XXXX&gt;/proc/sys/net/core/hot_list_length完成。再比如listen函数的第2个参数(TCP完成3次握手的数据包队列长度)，也可以根据你平台内存大小动态调整。更甚至在一个数据包面数目巨大但同时每个数据包本身大小却很小的特殊系统上尝试最新的<a href="javascript:linkredwin('NAPI');" title="NAPI" class="link_red">NAPI</a>网卡驱动架构。<br /><br /><strong>以上这些epoll内容，参考epoll_互动百科<br /><br /></strong>在我128M的vps上，我查看了一下，file-max的数量已经达到11945<br />应该说确实比apache的方式要好，而且资源占用也少。</p><br/>Tags - <a href="http://www.xinlogs.com/tags/nginx/" rel="tag">nginx</a> , <a href="http://www.xinlogs.com/tags/epool/" rel="tag">epool</a> , <a href="http://www.xinlogs.com/tags/events/" rel="tag">events</a> , <a href="http://www.xinlogs.com/tags/linux2.6/" rel="tag">linux2.6</a> , <a href="http://www.xinlogs.com/tags/%25E9%25AB%2598%25E6%2595%2588/" rel="tag">高效</a>
]]>
</description>
</item><item>
<link>http://www.xinlogs.com/centos_VPN_Howto/</link>
<title><![CDATA[CentOS 5.3架设VPN和619错误排除]]></title> 
<author>babo &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Mon, 21 Dec 2009 02:54:28 +0000</pubDate> 
<guid>http://www.xinlogs.com/centos_VPN_Howto/</guid> 
<description>
<![CDATA[ 
	我买这个VPS的主机，一个目的是用来做Blog空间，另外一个就是用来跑vpn。<br />先按照<a href="http://rashost.com/blog/centos5-pptpd-vpn">http://rashost.com/blog/centos5-pptpd-vpn</a>这里的文章安装vpn服务。<br /><h2>内核支持</h2><p>pptpd VPN需要内核支持mppe，我们的VPS自带的内核已经把mppe编译进去了，没有把mppe另外当作内核的模块。</p><h2>软件安装</h2><p>要安装pptpd VPN，ppp和iptables这两个软件是必须安装的，安装命令：</p><pre>yum install -y ppp iptables</pre><p>然后到 <a href="http://www.poptop.org/" title="http://www.poptop.org/ ">http://www.poptop.org/ </a>下载pptpd的rpm包并安装，下载的时候要注意下面几点：</p><ol><li>好像只有1.3.3版本有rpm包，其他版本只有源代码 </li><li>没有el5或者centos5的rpm包，用rh4的rpm包可以安装在centos 5上 </li><li>64位的系统要下载64位的rpm包，32位的系统要下载32位的rpm包，别搞错了 </li></ol><p>64位系统安装命令：</p><p><span style="font-family: Courier New">rpm -ivh pptpd-1.3.3-1.rhel4.x86_64.rpm</span></p><p>32位系统安装命令：</p><pre>rpm -ivh pptpd-1.3.3-1.rhel4.i386.rpm</pre><p>编辑配置文件 /etc/ppp/options.pptpd 内容如下：</p><pre>name pptpd refuse-pap refuse-chap refuse-mschap require-mschap-v2 require-mppe-128 proxyarp lock nobsdcomp novj novjccomp nologfd ms-dns 208.67.222.222 ms-dns 208.67.220.220 </pre><p>编辑配置文件 /etc/pptpd.conf 内容如下：</p><pre>option /etc/ppp/options.pptpd logwtmp localip 192.168.92.1 remoteip 192.168.92.11-15</pre><p>编辑配置文件 /etc/ppp/chap-secrets,配置用户名为johndoe，密码为password，内容如下：</p><pre>johndoe pptpd password *</pre><p>修改配置文件/etc/sysctl.conf中的相应内容如下：</p><pre>net.ipv4.ip_forward = 1</pre><p>&lsquo;配置iptables:</p><pre>iptables -t nat -A POSTROUTING -o eth0 -s 192.168.92.0/24 -j MASQUERADE /etc/init.d/iptables save /etc/init.d/iptables restart</pre><p>设置iptables和pptpd开机自动启动：</p><pre>chkconfig pptpd on chkconfig iptables on</pre><p>然后运行reboot重新启动即可<br /><span style="font-size: x-large"><br />错误排除<br /></span><span style="font-size: x-small"><span style="font-size: medium">完成以上配置，通过Windows拨号到VPN，一定提示619错误。<br />引发619错误的原因有很多，比如密码不正确等，都报这个错误。<br />我们可以通过/var/log/messages查看下日志，找到问题原因</span><span style="font-size: medium"><br /></span><br />Dec 20 06:45:12 204-74-212-217 pptpd[18317]: CTRL: Client 221.223.48.186 control connection started<br />Dec 20 06:45:12 204-74-212-217 pptpd[18317]: CTRL: Starting call (launching pppd, opening GRE)<br />Dec 20 06:45:12 204-74-212-217 pppd[18318]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so is for pppd version 2.4.3, this is 2.4.4<br /><span style="color: #ff0000">Dec 20 06:45:12 204-74-212-217 pptpd[18317]: GRE: read(fd=6,buffer=804e5a0,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs<br /></span>Dec 20 06:45:12 204-74-212-217 pptpd[18317]: CTRL: PTY read or GRE write failed (pty,gre)=(6,7)<br />Dec 20 06:45:12 204-74-212-217 pptpd[18317]: CTRL: Client 221.223.48.186 control connection finished<br /><br /><span style="font-size: medium">注意到红色部分了吧，就是这个错误。建议我们查看配置语法。<br />后来有找了一些文档查看，和一条一条屏蔽配置语法<br />发现是logwtmp这个配置选项出现问题。最后编辑/etc/pptpd.conf文件<br />注释掉logwtmp选项，重启pptpd服务，就可以正常登陆了。</span><br /><br /></span></p><br/>Tags - <a href="http://www.xinlogs.com/tags/vps/" rel="tag">vps</a> , <a href="http://www.xinlogs.com/tags/linux/" rel="tag">linux</a> , <a href="http://www.xinlogs.com/tags/vpn/" rel="tag">vpn</a> , <a href="http://www.xinlogs.com/tags/centos/" rel="tag">centos</a>
]]>
</description>
</item>
</channel>
</rss>