<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[狼啸之都]]></title> 
<link>http://www.wolfcity.net/index.php</link> 
<description><![CDATA[蓝狼生活中的点点滴滴……]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[狼啸之都]]></copyright>
<item>
<link>http://www.wolfcity.net/read.php?120</link>
<title><![CDATA[FreeBSD 7.3 安装php与libpng的问题以及解决方法]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Thu, 22 Apr 2010 00:48:31 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?120</guid> 
<description>
<![CDATA[ 
	　　安装FreeBSD 7.3，然后将port cvsup到最新，然后依次安装了php所需要的相关组件，诸如：freetype/gd/jpeg/png/libxml/iconv等，但是都OK了之后，到php了，php用的是自己编译的方法，配置方法如下：<br /><br />./configure --enable-fastcgi --with-mysql=/usr/local/mysql --with-ttf --with-libxml-dir=/usr/local/lib/ --with-gd --with-zlib --with-freetype-dir=/usr/local/lib/ --with-jpeg-dir=/usr/local/lib/ --enable-force-cgi-redirect --enable-mbstring --with-iconv=/usr/local --enable-sockets --enable-exif --enable-ftp<br /><br />配置一切都OK，但是到了make的时候出问题了，提示libpng出问题了&hellip;&hellip;无法编译完成，最后从网上查找资料后发现，是因为libpng里的一个函数的问题，于是修改源代码解决问题，方法如下：<br /><br />vi&nbsp;php-5.2.13/ext/gd/libgd/gd_png.c<br /><br />查找<br /><br />if (!png_check_sig (sig, 8)) <br /><br />更改为<br /><br />if (png_sig_cmp (sig, 0, 8))<br /><br />保存退出，回到php-5.2.13下，然后重新make，一切OK，问题解决。
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?88</link>
<title><![CDATA[吼吼，我自己的NTP 时间服务器……]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Tue, 20 Mar 2007 09:48:50 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?88</guid> 
<description>
<![CDATA[ 
	吼吼，做了NTP SERVER，以后家里可以通过这个服务器来进行自动教时咯！！！<br /><br /><br /><img src="attachment/200703/1174384057_0.jpg" border="0" width="404" height="332" /><br /><br /><br /><br />按照上图进行设置就OK了哦！！！<br /><br /><br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=freebsd%25E7%25BB%258F%25E9%25AA%258C" rel="tag">freebsd经验</a>
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?18</link>
<title><![CDATA[使用IPMI远程控制管理DELL2850服务器]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Fri, 21 Jul 2006 00:25:04 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?18</guid> 
<description>
<![CDATA[ 
	 &nbsp;&nbsp;　　Dell™ PowerEdge™ 2850 系统底板管理控制器 (BMC) 通过与主机板上的不同传感器通信来监视系统是否有严重事件，并在某些参数超出其预置阈值时发出警报和日志事件。 BMC 支持工业标准的 Intelligent Platform Management Interface (IPMI) 规范，可以实现远程配置、监测和恢复系统。 BMC 提供以下功能：<br/><br/><br/><div class="code">通过系统的串行端口和集成 NIC 进行访问<br/>故障日志记录和 SNMP 警报发送<br/>访问系统事件日志 (SEL) 和传感器状况<br/>控制包括开机和关机在内的系统功能<br/>独立于系统电源或工作状态的支持<br/>用于系统设置、基于文本公用程序和操作系统控制台的文本控制台重定向<br/>使用 LAN 上串行 (SOL) 访问 Red Hat® Enterprise Linux 串行控制台界面</div><br/><br/>　　看到了吧，以上是DELL官方对IPMI功能的描述，这些功能非常强大哦，据我所知，现在一般大厂的服务器都支持ipmi功能，比如DELL，HP，IBM。今天我们以DELL的2850为例，给大家简单介绍一下IPMI的基本使用。<br/><br/><br/>1.配置系统启用IPMI，启动服务器，在启动过程中，看提示，按Ctrl+E 进入IPMI管理界面<br/><br/>2.设置IPMI Over LAN为On，默认为Off，意思为启用通过LAN方式的IPMI。<br/><br/> <a href="http://www.wolfcity.net/attachment/1153412378.jpg" target="_blank"><img src="http://www.wolfcity.net/attachment/1153412378.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>3.设置IPMI的地址，这里的地址可以跟你服务器的ip地址一样，不会有冲突，放心设置，MAC地址不用设置。VLAN不用设置。<br/><br/> <a href="http://www.wolfcity.net/attachment/1153412402.jpg" target="_blank"><img src="http://www.wolfcity.net/attachment/1153412402.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>4.这里是设置访问的用户名和密码，远程访问IPMI是需要验证的。<br/><br/> <a href="http://www.wolfcity.net/attachment/1153412417.jpg" target="_blank"><img src="http://www.wolfcity.net/attachment/1153412417.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>　　好了设置完毕，重启机器，基本上现在服务器就已经能通过远程访问ipmi了。<br/><br/><br/>　　我们先在另外一台机器装上ipmiltool，一个管理IPMI的开源工具，可以在任何机器安装，安装的机器本身主板可以没有IPMI。<br/><br/>　　装完以后，我们试验一下能不能访问，运行以下命令<br/><br/><br/><div class="code">ipmitool –I lan –H host -U user -a channel info</div><br/><br/><strong>host：填写你的服务器的IP地址<br/>user：填写你之前设置的用户名，我们这里是root</strong><br/><br/>　　正常的话，会提示你输入密码，就是图3我们设置的密码。<br/><br/>以下是显示的信息：<br/><br/> <a href="http://www.wolfcity.net/attachment/1153412448.jpg" target="_blank"><img src="http://www.wolfcity.net/attachment/1153412448.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>　　说明远程服务器，我们刚才设置的服务器已经启用IPMI。<br/><br/>　　那怎么在本地访问IPMI呢，如果你直接用ipmitool访问是访问不了的，会提示以下错误：<br/><br/><br/><div class="code">Error: Unable to establish LAN session<br/>Unable to Get Channel Info</div><br/><br/>　　这里我们得安装OpenIPMI，装完这个，系统就能认出IPMI，这样我们才能通过ipmitool访问，当然前提是你的内核编译支持IPMI了。<br/><br/>　　装完OpenIPMI后，启用IPMI服务 /etc/rc.d/init.d/ipmi start 一般如果内核支持的话，能正常启动，用lsmod看看加载的模块<br/><br/> <a href="http://www.wolfcity.net/attachment/1153412459.jpg" target="_blank"><img src="http://www.wolfcity.net/attachment/1153412459.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/><br/>　　这时我们可以本地访问IPMI，还是刚才那个命令，参看channel信息，不过本地访问命令有所不同，改为<br/><br/> <a href="http://www.wolfcity.net/attachment/1153412473.jpg" target="_blank"><img src="http://www.wolfcity.net/attachment/1153412473.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>　　下面我们介绍一些远程控制IPMI的用法<br/><br/>　　获取远程服务器的电源状态<br/><br/><br/><div class="code">Ipmitool -I lan –H host –U root –a chassis power status</div><br/><br/>　　远程软关机，相当于按下reset，这个在服务器死机的时候用到,一般windows服务器建议用这个命令<br/><br/><br/><div class="code">Ipmitool -vI lan –H host –U root –a chassis power soft</div><br/><br/>　　类似的命令我们也可以用来远程开机，关机，获取服务器运行的信息等。<br/><br/><br/><div class="code">ipmitool -vI lan –H host –U root –a chassis power on 远程开机<br/>ipmitool -vI lan –H host –U root –a chassis power off 远程冷关机，断电</div><br/><br/><br/>参考文档：<br/><a href="http://www-900.ibm.com/developerWorks/cn/linux/l-ipmi/index.shtml" target="_blank">使用ipmitool 实现Linux 系统下对服务器的ipmi 管理</a><br/><a href="http://buttersideup.com/docs/howto/IPMI_on_Debian.html" target="_blank">IPMI HOWTO for Debian GNU/Linux on the Intel SR2300</a> <br/><br/>著作信息：张微波 2006.7.16 北京<br/><br/>原文地址:<a href="http://blog.5ilinux.com/archives/2006/07/ipmidell2850.html" target="_blank">http://blog.5ilinux.com/archives/2006/07/ipmidell2850.html </a>转载请注明出处 <br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=%25E8%25BF%259C%25E7%25A8%258B%25E6%258E%25A7%25E5%2588%25B6" rel="tag">远程控制</a> , <a href="http://www.wolfcity.net/tag.php?tag=ipmi" rel="tag">ipmi</a>
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?15</link>
<title><![CDATA[给单网卡绑定两个IP地址]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Tue, 11 Jul 2006 17:16:18 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?15</guid> 
<description>
<![CDATA[ 
	 &nbsp;&nbsp;　　如果要给以太网卡指定多个IP地址，并不存在什么限制。新的TCP/IP连接会耕具自己的IP地址来查找主机，询问拥有该IP地址的MAC地址。但是并不能反过来，<span style="color: #FF0000;"><strong>一个MAC地址可以对应多个不同的IP地址，但是一个IP地址不能对应多个MAC地址，否则就会出现传说中的“IP地址冲突”现象！</strong></span><br/><br/>　　给单个网卡指定多个IP地址的方法叫做IP别名。和route命令一样，不同的系统实现的方法不一样，各系统之间的差异造成了语法多种多样，在FreeBSD中，ifconfig的关键字为alias，该关键字跟在地址还有其他参数之后。<br/><br/><br/><div class="code">ifconfig fxp1 192.168.0.254 netmask 255.255.255.255 alias</div><br/><br/> &nbsp; &nbsp;这里网络掩码设置为255.255.255.255。如果别名IP地址和接口卡的原IP地址在同一个子网上，就需要这样设置，如果位于不同的子网，那么就直接使用相应子网的正常网络掩码。<br/><br/><strong>　　从TCP/IP的角度来说说原因吧。网络掩码的所有位都是1，就会保证TCP/IP这样来看待数据包：只要包的目的地址匹配所有位，就把该包看成本地子网上的包，它实际上是创建了一个只有一个地址的“子网”。所有发送给该地址的包以及该地址接收的包都会发送给路由器，而不会发送到LAN上。如果多个别名使用了同一个网络掩码，这些别名的广播地址也应该相同，而这样就导致了TCP/IP栈的混乱。使用全1的网络掩码，我们才能骗过ifconfig，让该命令允许单个接卡上有多个IP地址。</strong><br/><br/>　　要在/etc/rc.conf中设置IP别名，应该使用ifconfig_xxx#_alias#关键字，该关键字的使用形式上类似于ifconfig_xxx#。下边给出/etc/rc.conf中的一组别名：<br/><br/><br/><div class="code">ifconfig_fxp0=&quot;inet 192.168.0.254 netmask 255.255.255.0&quot;<br/>ifconfig_fxp0_alias0=&quot;inet 192.168.0.253 netmask 255.255.255.255&quot;<br/>ifconfig_fxp0_alias1=&quot;inet 192.168.0.252 netmask 255.255.255.255&quot;<br/>ifconfig_fxp0_alias2=&quot;inet 192.168.254.254 netmask 255.255.255.0&quot;<br/>ifconfig_fxp0_alias3=&quot;inet 192.168.254.253 netmask 255.255.255.255&quot;<br/>ifconfig_fxp0_alias4=&quot;inet 192.168.254.252 netmask 255.255.255.255&quot;</div><br/><br/><br/>　　请大家仔细看上边的例子就知道如何进行多IP绑定了。 <br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=alias" rel="tag">alias</a> , <a href="http://www.wolfcity.net/tag.php?tag=freebsd%25E7%25BB%258F%25E9%25AA%258C" rel="tag">freebsd经验</a>
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?9</link>
<title><![CDATA[我的策略DNS配置笔记]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Tue, 27 Jun 2006 16:42:52 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?9</guid> 
<description>
<![CDATA[ 
	 &nbsp;&nbsp;系统采用的是FreeBSD 5.4，由于BSD5.4本身内带的就是bind9.3.1了，所以不用ports安装，直接可以使用。我们先来看看bind的版本。<br/># named -v<br/><br/><div class="code">BIND 9.3.1</div><br/><br/>如上，果然是bind9.3.1，OK，现在就可以开始开工了。首先确定一个关键，bind的配置文件的存放位置是/etc/namedb，虽然这是一个ln，但是这个位置比较好记，所以大家可以直接通过这个ln来访问他的实际存放位置/var/named/etc/namedb。<br/># cd /etc/namedb<br/># chmod +x make-localhost<br/># ./make-localhost<br/>会在当前目录生成一个localhost.rev和localhost-v6.rev。分别用于IPv4以及IPv6生成rndc的key，以后rndc才能控制bind9工作。<br/># /usr/local/sbin/rndc-confgen >rndc.conf<br/>打开rndc.conf，把<br/><br/><br/><div class="code"># Use with the following in named.conf, adjusting the allow list as needed:<br/>……<br/># End of named.conf</div><br/><br/><br/>之间的内容，去掉注释#，添加到named.conf最后.<br/><br/>编辑named.conf<br/><br/><div class="code"><br/>// $FreeBSD: src/etc/namedb/named.conf,v 1.15.2.3 2005/03/23 17:35:58 dougb Exp $<br/><br/>options &#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp;directory &nbsp; &nbsp; &nbsp; &quot;/etc/namedb&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;pid-file &nbsp; &nbsp; &nbsp; &nbsp;&quot;/var/run/named/pid&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;dump-file &nbsp; &nbsp; &nbsp; &quot;/var/dump/named_dump.db&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;statistics-file &quot;/var/stats/named.stats&quot;;<br/><br/>&#125;;<br/><br/>key &quot;rndc-key&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;algorithm hmac-md5;<br/> &nbsp; &nbsp; &nbsp;secret &quot;/hnxmLJvodzFpnj5YL+FyQ==&quot;;<br/>&#125;;<br/><br/>controls &#123;<br/> &nbsp; &nbsp; &nbsp;inet 127.0.0.1 port 953<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;allow &#123; 127.0.0.1; &#125; keys &#123; &quot;rndc-key&quot;; &#125;;<br/>&#125;;<br/><br/><br/>//include Cernet &amp; CNC Acl<br/>include &quot;acl.conf&quot;;<br/>//<br/><br/>/////////DNS-View For Cernet &amp; CNC User////////////////////////<br/>view &quot;view_cnc&quot;<br/>&#123;<br/>match-clients &#123; CNC; &#125;;<br/>recursion yes;<br/><br/>forwarders &nbsp; &nbsp; &nbsp;&#123; 202.112.14.151; 61.139.2.69; 128.9.0.107; &#125;;<br/><br/>zone &quot;.&quot;<br/>&#123;<br/>type hint;<br/>file &quot;named.root&quot;;<br/>&#125;;<br/><br/>zone &quot;0.0.127.IN-ADDR.ARPA&quot;<br/>&#123;<br/>type master;<br/>file &quot;master/localhost.rev&quot;;<br/>&#125;;<br/><br/>zone &quot;scetc.edu.cn&quot;<br/>&#123;<br/>type master;<br/>file &quot;master/scetc.edu.cn.EDU&quot;;<br/>&#125;;<br/><br/>zone &quot;108.197.222.IN-ADDR.ARPA&quot;<br/>&#123;<br/>type master;<br/>file &quot;master/108.197.222.rev&quot;;<br/>&#125;;<br/><br/>&#125;;<br/><br/>///////////DNS-View For Others User//////////////////////<br/><br/>view &quot;view_any&quot;<br/>&#123;<br/>match-clients &#123; any; &#125;;<br/>recursion yes;<br/><br/>forwarders &nbsp; &nbsp; &nbsp;&#123; 61.139.2.69; 202.112.14.151; 128.9.0.107; &#125;;<br/><br/>zone &quot;.&quot;<br/>&#123;<br/>type hint;<br/>file &quot;named.root&quot;;<br/>&#125;;<br/><br/>zone &quot;0.0.127.IN-ADDR.ARPA&quot;<br/>&#123;<br/>type master;<br/>file &quot;master/localhost.rev&quot;;<br/>&#125;;<br/><br/>zone &quot;scetc.edu.cn&quot;<br/>&#123;<br/>type master;<br/>file &quot;master/scetc.edu.cn.TEL&quot;;<br/>&#125;;<br/><br/>zone &quot;108.197.222.IN-ADDR.ARPA&quot;<br/>&#123;<br/>type master;<br/>file &quot;master/108.197.222.rev&quot;;<br/>&#125;;<br/><br/>&#125;;<br/></div><br/><br/>附带acl.conf<br/><br/>建立好域名解析文件以及相应目录。<br/>#mkdir /etc/namedb/master<br/>#touch /etc/namedb/master/scetc.edu.cn.EDU<br/>#touch /etc/namedb/master/scetc.edu.cn.TEL<br/>#touch /etc/namedb/master/108.197.222.rev<br/><br/>用以下命令进行测试bind工作情况，如果出现的提示中没有出现错误，那么恭喜你，你的bind已经可以正常工作的。<br/># /usr/local/sbin/named -gc /etc/namedb/named.conf<br/><br/>按一下键盘的ctrl+c，先把BIND 9停掉。进行域名解析文件的编写。<br/><br/>dns1# cat scetc.edu.cn.EDU<br/><div class="code"><br/>$ORIGIN .<br/>$TTL &nbsp; &nbsp;3600<br/>scetc.edu.cn &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;SOA &nbsp; &nbsp; dns1.scetc.edu.cn. root.dns1.scetc.edu.cn. &nbsp;(<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20060623 &nbsp; &nbsp; &nbsp; &nbsp;; Serial<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600 &nbsp; &nbsp;; Refresh<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;900 &nbsp; &nbsp; ; Retry<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600000 ; Expire<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600 ) &nbsp;; Minimum<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;dns1.scetc.edu.cn.<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;dns2.scetc.edu.cn.<br/><br/>$ORIGIN &nbsp;scetc.edu.cn.<br/>dns1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 222.197.108.1<br/>dns2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 222.197.108.2<br/>www &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A &nbsp; &nbsp; &nbsp; 222.197.108.8<br/></div><br/><br/>dns1# cat scetc.edu.cn.TEL<br/><div class="code"><br/>$ORIGIN .<br/>$TTL &nbsp; &nbsp;3600<br/>scetc.edu.cn &nbsp; &nbsp;IN &nbsp; &nbsp; &nbsp;SOA &nbsp; &nbsp; dns1.scetc.edu.cn. root.dns1.scetc.edu.cn. &nbsp;(<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20060624 &nbsp; &nbsp; &nbsp; &nbsp;; Serial<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600 &nbsp; &nbsp;; Refresh<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;900 &nbsp; &nbsp; ; Retry<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600000 ; Expire<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600 ) &nbsp;; Minimum<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;dns1.scetc.edu.cn.<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;dns2.scetc.edu.cn.<br/><br/>$ORIGIN &nbsp;scetc.edu.cn.<br/>dns1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 222.197.108.1<br/>dns2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 222.197.108.2<br/>www &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A &nbsp; &nbsp; &nbsp; 218.6.165.8<br/></div><br/><br/>dns1# cat 108.197.222.rev<br/><div class="code"><br/>$TTL &nbsp; &nbsp;3600<br/><br/>@ &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;SOA &nbsp; &nbsp; dns1.scetc.edu.cn. root.dns1.scetc.edu.cn. &nbsp;(<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20060623 &nbsp; &nbsp; &nbsp; &nbsp;; Serial<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600 &nbsp; &nbsp;; Refresh<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;900 &nbsp; &nbsp; ; Retry<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600000 ; Expire<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3600 ) &nbsp;; Minimum<br/> &nbsp; &nbsp; &nbsp; &nbsp;IN &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;dns1.scetc.edu.cn.<br/> &nbsp; &nbsp; &nbsp; &nbsp;IN &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;dns2.scetc.edu.cn.<br/><br/>1 &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;PTR &nbsp; &nbsp; dns1.scetc.edu.cn.<br/>2 &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;PTR &nbsp; &nbsp; dns2.scetc.edu.cn.<br/>8 &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;PTR &nbsp; &nbsp; www.scetc.edu.cn.<br/></div><br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=dns" rel="tag">dns</a> , <a href="http://www.wolfcity.net/tag.php?tag=freebsd%25E7%25BB%258F%25E9%25AA%258C" rel="tag">freebsd经验</a>
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?7</link>
<title><![CDATA[FreeBSD VPN Server 架设(poptop)]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Mon, 26 Jun 2006 20:24:50 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?7</guid> 
<description>
<![CDATA[ 
	 &nbsp;&nbsp;内部ip 地址: 192.168.0.0/24<br/>服务器内部ip: 192.168.0.254<br/>分配vpn client ip: 192.168.0.250-192.168.0.253<br/><br/>检查内核配置文件确定有下面一行<br/>device tun<br/><br/>安装pptpd<br/># cd /usr/ports/net/poptop<br/># make install clean<br/><br/>配置 pptpd.conf<br/># vi /usr/local/etc/pptpd.conf<br/><br/><br/><div class="code">speed 115200 <br/>pidfile /var/run/pptpd.pid<br/><br/># debug<br/>nobsdcomp<br/>proxyarp<br/>refuse-pap<br/>refuse-chap<br/>refuse-mschap<br/>require-mschap-v2<br/>require-mppe-128<br/>lock<br/>name pptp<br/>auth<br/><br/>localip 192.168.0.254<br/>remoteip 192.168.0.250-253 </div><br/><br/>配置ppp.conf，注意下面除开第一行，其他行前面的是'tab'，不是空格<br/># vi /etc/ppp/ppp.conf<br/><br/><br/><div class="code">pptp:<br/> &nbsp; &nbsp; &nbsp; &nbsp;set timeout 0<br/> &nbsp; &nbsp; &nbsp; &nbsp;load loop<br/> &nbsp; &nbsp; &nbsp; &nbsp;enable proxy<br/> &nbsp; &nbsp; &nbsp; &nbsp;accept dns<br/> &nbsp; &nbsp; &nbsp; &nbsp;enable MSChapV2<br/> &nbsp; &nbsp; &nbsp; &nbsp;enable mppe<br/> &nbsp; &nbsp; &nbsp; &nbsp;disable pap<br/> &nbsp; &nbsp; &nbsp; &nbsp;disable chap<br/> &nbsp; &nbsp; &nbsp; &nbsp;disable mschap<br/> &nbsp; &nbsp; &nbsp; &nbsp;set mppe * stateless<br/> &nbsp; &nbsp; &nbsp; &nbsp;set dns 192.168.0.254<br/> &nbsp; &nbsp; &nbsp; &nbsp;set ifaddr 192.168.0.254 192.168.0.250-192.168.0.253 255.255.255.255 </div><br/><br/>配置用户验证<br/>#vi /etc/ppp/ppp.secret<br/><br/><br/><div class="code">usernameA passwordA<br/>usernameB passwordB<br/>usernameC passwordC</div><br/><br/>配置rc.conf 确保存在<br/><br/><div class="code">gateway_enable=&quot;YES&quot;<br/>arpproxy_all=&quot;YES&quot;</div><br/><br/>配置sysctl 启用icmp 转发(可以写到 /etc/sysctl.conf)<br/><br/><div class="code">sysctl net.inet.ip.forwarding=1</div><br/><br/>如果上面配置好，可以启动pptpd (如果有必要，请先重启)<br/>/usr/local/etc/rc.d/pptpd.sh start<br/><br/><br/>本教程 只允许MSChapV2验证，加密链接的client登录 <br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=vpn" rel="tag">vpn</a> , <a href="http://www.wolfcity.net/tag.php?tag=poptop" rel="tag">poptop</a> , <a href="http://www.wolfcity.net/tag.php?tag=freebsd%25E7%25BB%258F%25E9%25AA%258C" rel="tag">freebsd经验</a>
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?6</link>
<title><![CDATA[FreeBSD下安装MRTG监控流量!]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Mon, 26 Jun 2006 20:21:59 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?6</guid> 
<description>
<![CDATA[ 
	 &nbsp;&nbsp;我的安装步骤:<br/><br/>1、首先安装net-snmpd<br/><br/>cd /usr/ports/net/net-snmp ; make install ; rehash<br/><br/>2、然后修改snmpd的配置<br/><br/>ee /etc/rc.conf<br/><br/><br/>加入以下设置内容<br/><br/><br/><br/><div class="code">snmpd_enable=&quot;YES&quot;<br/>snmpd_flags=&quot;-p /var/run/snmpd.pid&quot;</div><br/><br/><br/>ee /etc/hosts.allow<br/><br/>加入以下内容<br/><br/><br/><br/><div class="code">snmpd : localhost : allow</div><br/><br/><br/>ee /usr/local/share/snmp/snmpd.conf<br/><br/>加入以下内容<br/><br/><br/><br/><br/><div class="code">rocommunity mrtgmgr<br/>syslocation FreeBSD<br/>syscontact Bluewolf<br/>sysname localhost </div><br/><br/><br/><br/>3、然后启动snmpd<br/><br/><br/>/usr/local/sbin/snmpd -P /var/run/snmpd.pid<br/><br/><br/>4、安装MRTG<br/><br/>cd /usr/ports/net/mrtg ; make install ; rehash<br/><br/><br/>5、建立MRTG的WEB目录<br/><br/>mkdir /usr/local/apache/htdocs/mrtg<br/><br/><br/>6、生成配置文件<br/><br/>cfgmaker &#92;<br/>--global 'WorkDir: /usr/local/apache/htdocs/mrtg' &#92;<br/>--global 'Options[_]: growright, bits' &#92;<br/>--global 'Language: chinese' &#92;<br/>mrtgmgr@localhost &#92;<br/>> /usr/local/etc/mrtg/mrtg.cfg <br/><br/><br/>7、生成网页文件<br/><br/><br/>indexmaker &#92;<br/>--title 'MRTG - bluewolf's FTP Avarage Load' &#92;<br/>--addhead='<meta http-equiv="Content-Type" content="text/html; charset=gb2312">' &#92;<br/>--output /usr/local/apache/htdocs/mrtg/index.html &#92;<br/>--columns=1 &#92;<br/>--nolegend &#92;<br/>/usr/local/etc/mrtg/mrtg.cfg <br/><br/><br/>8、运行MRTG<br/><br/>/usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg<br/><br/>运行的时候会提示出错，不理会，连续运行3次，系统不再提示出错。<br/><br/><br/>9、设置自动5分钟运行一次MRTG<br/><br/>crontab -e<br/><br/>然后输入以下内容<br/><br/><br/><br/><div class="code">0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg --logging /var/log/snmp/smthome.log</div><br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=mrtg" rel="tag">mrtg</a> , <a href="http://www.wolfcity.net/tag.php?tag=freebsd%25E7%25BB%258F%25E9%25AA%258C" rel="tag">freebsd经验</a>
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?5</link>
<title><![CDATA[FreeBSD 5.3 下面用 GEOM 来做Raid]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Mon, 26 Jun 2006 20:12:10 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?5</guid> 
<description>
<![CDATA[ 
	 &nbsp;&nbsp;从FreeBSD5.3开始引进了对geom的支持<br/><br/>FreeBSD 5.3下面用geom来创建raid是很方便的<br/>除开可以用geom这个程序来创建，还提供了个单独的程序，例如<br/>gconcat, gmirror, graid3, gstripe. 另外还有个尚未完成的gvinum(即将代替vinum)<br/><br/><span style="color: #FF0000;"><strong>CONCAT版RAID</strong></span><br/><br/>concat其实并不算是raid，因为没有性能上的提升，也没有数据保护作用。只是简单的将各磁盘串起来利用磁盘空间。<br/><br/>下面例子将对ipsd1,ipsd2这两个磁盘系统进行concat<br/><br/>首先重置这两个磁盘<br/>bsdlabel -r -w ipsd1 auto<br/>bsdlabel -r -w ipsd2 auto<br/><br/>使用gconcat连接两个磁盘，并且命名为data<br/>gconcat label -v data /dev/ipsd1 /dev/ipsd2<br/><br/>使用gconcat以后，将会在/dev/concat下面多出一个设备名叫data，对应早先命令的data名字<br/>ls /dev/concat<br/><br/>格式化，如果你需要关闭Soft-Update,只需要去掉-U<br/>newfs -U /dev/concat/data<br/><br/>创建mount point<br/>mkdir /data<br/><br/>挂上新建的concat<br/>mount /dev/concat/data /data<br/><br/>修改fstab让系统重启后自动mount<br/>vi /etc/fstab<br/>内容<br/>/dev/concat/data /data ufs rw 2 2<br/><br/>增加开机自动装载geom_concat.ko这个模块<br/>vi /boot/loader.conf<br/>内容<br/>geom_concat_load="YES"<br/><br/><br/>很简单的concat已经做好了<br/><br/><span style="color: #FF0000;"><strong>mirror raid (raid1)</strong></span><br/><br/>创建一个mirror raid (也就是俗称的RAID1)<br/>RAID1具有最高的安全性，具有快速的读操作，不提高磁盘的写性能<br/><br/><br/>下面例子将对da0 da1这两个磁盘系统进行mirror<br/><br/>首先重置这两个磁盘<br/>bsdlabel -r -w da0 auto<br/>bsdlabel -r -w da1 auto<br/><br/>使用gmirror连接两个磁盘，并且命名为data<br/>gmirror label -v -b split -s 2048 data da0 da1<br/>稍微解释一下上面的命令，详细的查询man gmirror<br/>-b split: 告诉gmiiror创建的mirror，在读取的时候将读操作分开到各磁盘上面，这样能够提高读取性能<br/>-s 2048: 告诉mirror只分开读取大于2k 的文件<br/>除开spilit，还有其他平衡形式.split比较适合大众 <br/>round-robin : 在各磁盘轮流读取数据<br/>prefer: 更高优先权的读取数据<br/>load: 更低负荷的读取数据<br/><br/>使用gmirror以后，将会在/dev/concat下面多出一个设备名叫data，对应早先命令的data名字<br/>ls /dev/concat<br/><br/>格式化，如果你需要关闭Soft-Update,只需要去掉-U<br/>newfs -U /dev/concat/data<br/><br/>创建mount point<br/>mkdir /data<br/><br/>挂上新建的concat<br/>mount /dev/concat/data /data<br/><br/>修改fstab让系统重启后自动mount<br/>vi /etc/fstab<br/>内容<br/>/dev/concat/data /data ufs rw 2 2<br/><br/>增加开机自动装载geom_mirror.ko这个模块<br/>vi /boot/loader.conf<br/>内容<br/>geom_mirror_load="YES"<br/><br/>mirror raid已经做好了<br/><br/><br/>创建一个当前磁盘的mirror:<br/>gmirror label -v -b round-robin data da0<br/>gmirror insert data da1<br/><br/><br/><span style="color: #FF0000;">stripe raid (RAID0)</span><br/><br/>创建一个stripe raid (RAID0)<br/>RAID0具有最高性能，也是最差安全性的<br/><br/>......<br/><br/>使用gmirror连接两个磁盘，并且命名为data<br/>gstripe label -v -s 4096 data /dev/da1 /dev/da2<br/>-s 4096: 是分开在每个磁盘的块大小为4k<br/><br/>......<br/><br/>增加开机自动装载geom_mirror.ko这个模块<br/>vi /boot/loader.conf<br/>内容<br/>geom_stripe_load="YES"<br/><br/>其他的步骤和前面两个帖子的一样,不在重复说了<br/>在这里说说raid0的一些参数设置,sysctl<br/><br/>kern.geom.stripe.fast<br/>设置是否使用fast模式.gstripe有两个模式,一个是fast,一个是economic.<br/>fast模式消耗更多的内存,但是速度更快.当内存不足的时候会自动切换到economic模式.<br/><br/>kern.geom.stripe.maxmem<br/>设置fast模式下面最大使用内存数,该选项是只读.只能在启动时候才能设置.因此如果需要更改该选项,需放在 /boot/loeader.conf<br/><br/>kern.geom.stripe.fast_failed<br/>记录了fast模式失败次数,如果次数很大,你就要调大kern.geom.stripe.maxmem的数值<br/><br/>除开上面,geom还提供了raid3的制作<br/>graid3 label -v -r data da0 da1 da2<br/><br/><br/>上面贴子说的gconcat,gmirror,gstripe都可以用geom一个来搞定<br/>例如<br/>geom stripe label -v -s 4096 data /dev/da0 /dev/da1 /dev/da2<br/>等于<br/>gstripe label -v -s 4096 data /dev/da0 /dev/da1 /dev/da2 <br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=geom" rel="tag">geom</a> , <a href="http://www.wolfcity.net/tag.php?tag=raid" rel="tag">raid</a> , <a href="http://www.wolfcity.net/tag.php?tag=freebsd%25E7%25BB%258F%25E9%25AA%258C" rel="tag">freebsd经验</a>
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?4</link>
<title><![CDATA[zeus+mysql+php高性能web server傻瓜教程]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Mon, 26 Jun 2006 20:07:17 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?4</guid> 
<description>
<![CDATA[ 
	 &nbsp;&nbsp;www# alias ls ls -GF<br/>www# setenv PAGER less<br/>www# set nobeep<br/>www# set prompt = '%n@%/%# '<br/>www# set autolist<br/><br/>www# pkg_add -r cvsup<br/>www# rehash<br/>www# ee /root/ports<br/>输入以下的内容，然后保存退出。<br/><br/><div class="code">*default host=cvsup.freebsdchina.org<br/>*default base=/usr<br/>*default prefix=/usr<br/>*default tag=.<br/>*default release=cvs delete use-rel-suffix compress<br/><br/>ports-all</div><br/><br/><br/>www# ee /root/src<br/>输入以下的内容，然后保存退出。<br/><br/><div class="code">*default host=cvsup.freebsdchina.org<br/>*default base=/usr<br/>*default prefix=/usr<br/>*default release=cvs<br/>*default delete use-rel-suffix<br/><br/>*default tag=RELENG_5_3<br/>src-all<br/></div><br/><br/>www# cvsup ports<br/>www# cvsup src<br/>www# cd /usr/ports/devel/libtool13<br/>www# make install clean<br/>www# mkdir /home/src<br/><br/>　　中间省略下载mysql的tar.gz以及php的tar.gz的步骤，我靠，你自己下行不行，这里是傻瓜教程，又不是白痴教程……<br/><br/>www# tar xvzf mysql-4.1.8.tar.gz<br/>www# cd mysql-4.1.8<br/><br/>www# ./configure --prefix=/usr/local/mysql --without-libedit --without-readline --without-debug --without-bench --enable-thread-safe-client --enable-assembler --with-extra-charsets=complex --with-named-thread-libs='-lpthread -D_THREAD_SAFE' CFLAGS='-pipe -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse -fno-omit-frame-pointer -O3 -D_THREAD_SAFE -fno-gcse' CXXFLAGS='-pipe -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse -fno-omit-frame-pointer -O3 -felide-constructors -fno-rtti -fno-exceptions -D_THREAD_SAFE -fno-gcse' <br/><br/>www# make<br/>www# make install<br/>www# ./scripts/mysql_install_db<br/>www# chown -R root /usr/local/mysql<br/>www# chown -R root /usr/local/mysql/bin<br/>www# chown -R root /usr/local/mysql/var<br/>www# chown -R root /usr/local/mysql/var/mysql<br/>www# chown -R root /usr/local/mysql/var/mysql/*<br/>www# chmod 770 /usr/local/mysql/var<br/>www# chmod 770 /usr/local/mysql/var/mysql<br/>www# chmod 770 /usr/local/mysql/var/mysql/*<br/>www# chmod 770 /usr/local/mysql/lib/mysql/libmysqlclient.a<br/>www# cd /usr/local/mysql<br/>www# ./bin/mysqld_safe --user=root &<br/>www# ./bin/mysqladmin -u root -p password 'mysql的root密码'<br/>www# ln -s /usr/local/mysql/share/mysql/mysql.server /usr/local/etc/rc.d/mysql.sh<br/>www# tar xvzf php-4.3.10.tar.gz<br/>www# cd php-4.3.10<br/>www# ./configure --enable-fastcgi --with-mysql=/usr/local/mysql --with-ttf --with-xml --with-gd --with-zlib --with-freetype --with-jpeg-dir=/usr/local/lib/ --enable-force-cgi-redirect --enable-mbstring --with-iconv --enable-sockets --with-curlwrappers<br/>www# make<br/>www# make install<br/>www# cp ./php.ini-dist /usr/local/lib/php.ini<br/>www# ee /usr/local/lib/php.ini<br/>用“Ctrl+Y”查找global=off，改为global=on<br/>www# cd /usr/ports/www/turck-mmcache<br/>www# make install clean<br/>www# ee /usr/local/lib/php.ini<br/>把下边这些东西复制进去，就复制到最后就可以了……<br/><br/><div class="code">&#91;mmcache&#93;<br/>zend_extension=&quot;/usr/local/lib/php/20020429/mmcache.so&quot;<br/>mmcache.shm_size=&quot;16&quot;<br/>mmcache.cache_dir=&quot;/tmp&quot;<br/>mmcache.enable=&quot;1&quot;<br/>mmcache.optimizer=&quot;1&quot;<br/>mmcache.check_mtime=&quot;1&quot;<br/>mmcache.debug=&quot;0&quot;<br/>mmcache.filter=&quot;&quot;<br/>mmcache.shm_max=&quot;0&quot;<br/>mmcache.shm_ttl=&quot;0&quot;<br/>mmcache.shm_prune_period=&quot;0&quot;<br/>mmcache.shm_only=&quot;0&quot;<br/>mmcache.compress=&quot;1&quot;<br/>mmcache.keys=&quot;shm_and_disk&quot;<br/>mmcache.sessions=&quot;shm_and_disk&quot;<br/>mmcache.content=&quot;shm_and_disk&quot;</div><br/><br/><br/>本来想省略掉安装zeus的步骤，因为zeus的安装很复杂，超级难，需要你在键盘上输入……算了，还是继续写吧……怎么下载zeus我就不说了，自己去找。<br/><br/>www# tar xvzf Zeus.Web.Server.v4.3.FreeBSD4-FUTURiTY.tgz<br/>www# cd Zeus.Web.Server.v4.3.FreeBSD4-FUTURiTY<br/>www# ./zinstall<br/><br/>OK，然后经过几个简单的问题就可以安装完成了。<br/><br/>然后配置，让zeus能够解释php——很快很强的那种哦——在这里祝福real jj万寿无疆……<br/><br/>-_________________-!!!<br/><br/>www# cd /usr/local/zeus/rc.d<br/>www# ee S05php<br/>把以下东西贴进去……我知道你看不懂……你要能看懂了就8会看偶的这个教程了嘛……B4<br/><br/><br/><div class="code">#!/bin/sh<br/><br/># Script to start and stop the persistent PHP runner for FastCGI.<br/># Please check paths before use. <br/><br/># FastCGI PHP binary<br/>FPHPBIN=/usr/local/bin/php<br/><br/># Location to place semaphore<br/>SEMFILE=/tmp/php.pid<br/>PHP_FCGI_CHILDREN=100<br/>PHP_FCGI_MAX_REQUESTS=1000<br/>export PHP_FCGI_CHILDREN<br/>export PHP_FCGI_MAX_REQUESTS<br/><br/># This is Linux - use /proc to increase the local (ephemeral) port range<br/>#echo 1024 65000 &gt; /proc/sys/net/ipv4/ip_local_port_range<br/><br/>if &#91; -z &quot;$ZEUSHOME&quot; &#93;<br/>then<br/>cd `dirname $0`/..<br/>ZEUSHOME=`pwd`<br/>export ZEUSHOME<br/>fi<br/><br/>case &quot;$1&quot; in<br/>&#039;start&#039;)<br/><br/>if &#91; -e $SEMFILE &#93;<br/>then<br/>echo FastCGI PHP error: already running.Restart FastCGI PHP now<br/>kill `cat $SEMFILE`<br/>sleep 5<br/>fi<br/><br/>if &#91; ! -x $FPHPBIN &#93;<br/>then<br/>echo FastCGI PHP error: please check that $FPHPBIN is executable and exists.<br/>exit 1<br/>fi<br/><br/>echo Starting FastCGI PHP.<br/>$ZEUSHOME/web/bin/fcgirunner --user=65534 --group=65534 --pidfile=$SEMFILE 8002 $FPHPBIN<br/>;;<br/><br/>&#039;stop&#039;)<br/>if &#91; -e $SEMFILE &#93;<br/>then<br/>echo Stopping FastCGI PHP.<br/>kill `cat $SEMFILE`<br/>rm $SEMFILE<br/>exit 0<br/>fi<br/>;;<br/>&#039;restart&#039;)<br/>if &#91; -e $SEMFILE &#93;<br/>then<br/>echo Stopping FastCGI PHP.<br/>kill `cat $SEMFILE`<br/>sleep 5<br/>fi<br/>echo Starting FastCGI PHP.<br/>$ZEUSHOME/web/bin/fcgirunner --user=65534 --group=65534 --pidfile=$SEMFILE 8002 $FPHPBIN<br/>;;<br/>*)<br/>echo &quot;usage: $0 &#123;start&#124;stop&#124;restart&#125;&quot;<br/>;;<br/><br/>esac<br/>exit 1</div><br/><br/><br/><br/>www# chmod +x /usr/local/zeus/rc.d/S05php<br/><br/>使用zeus的webadmin（用IE访问webadmin端口，一般来说默认的为9090）http://xxx.xxx.xxx.xxx:9090<br/>登陆后做以下工作，选中你希望能够解释php的虚拟机，然后进行修改。<br/>在API Support->FastCGI里，找到<br/>Configuring FastCGI Remote Responders<br/>Adding a FastCGI Remote Responder<br/>进行以下设置：<br/>Directory name: /usr/local/bin/php<br/>Location: Machine name: localhost<br/>Port: 8002<br/>Additional methods supported?: none<br/><br/>然后<br/><br/>在URL Handling->Handlers->Adding a Handler这里进行以下设置：<br/><br/>File Extension: *.php<br/>Specify the path and filename of the handler, relative to the document root: /usr/local/bin/php<br/>HTTP 404 errors are handled by: The handler <br/><br/>OK，这样就设置好了，最后需要commit这些设置哦，表忘了……<br/><br/><br/>设置好了之后建议restart一下zeus就OK了。 <br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=zeus" rel="tag">zeus</a> , <a href="http://www.wolfcity.net/tag.php?tag=php" rel="tag">php</a> , <a href="http://www.wolfcity.net/tag.php?tag=mysql" rel="tag">mysql</a> , <a href="http://www.wolfcity.net/tag.php?tag=freebsd%25E7%25BB%258F%25E9%25AA%258C" rel="tag">freebsd经验</a>
]]>
</description>
</item><item>
<link>http://www.wolfcity.net/read.php?3</link>
<title><![CDATA[socks5 服务器的安装配置]]></title> 
<author>蓝狼 &lt;bluewolf@gmail.com&gt;</author>
<category><![CDATA[xNIX知识]]></category>
<pubDate>Mon, 26 Jun 2006 20:03:11 +0000</pubDate> 
<guid>http://www.wolfcity.net/read.php?3</guid> 
<description>
<![CDATA[ 
	 &nbsp;&nbsp;　　socks5服务器加双网卡，配合sockscap32 ,可以作为vpn服务器使用，而且比专用的vpn更好用，我在外网通过socks5可以点播我内网的电影。<br/><br/>1．解压缩软件包<br/>#tar xvfz socks5-v1.0r11.tar.gz <br/><br/>2.开始编译<br/>#cd socks5-v1.0r11 <br/>#./configure --with-threads　（FreeBSD下不能使用“--with-threads”参数）<br/>#make <br/>#make install <br/><br/>3.建立/etc/socks5.conf,其实在软件包里已经有现成的<br/><br/><div class="code">auth - - u<br/>permit u - - - - - -</div><br/><br/>4、使socks5使用用户验证机制,首先要建立/etc/socks5.pwsswd文件<br/>内容为：（userA代表用户名。passwdA代表用户userA的密码）<br/>#/etc/socks5.passwd <br/><br/><div class="code">userA passwdA<br/>userB passwdB<br/>userC passwdC</div><br/><br/>5.ok 运行 socks5 -t 启动socks5服务，记住默认端口是1080<br/><br/>6.如果要停止socks5，只要运行stopsocks -KILL就行，socks5就会停止！<br/><br/>如果想限制只是某个IP段(192.168.0.0/255.255.255.0)可以访问，可以改成<br/>permit - - 192.168.0. - - -<br/>或者只允许某个IP(192.168.0.10)可以访问使用，可以改成<br/>permit - - 192.168.0.10 - - -<br/><br/>7.使用非默认端口：如果你想让socks5服务启动的时候不启动默认监听端口1080，比如为1234，我们可以运行如下命令<br/>socks5 -b 1234 -t 当然你关掉这个服务，就必须用下面的命令 stopsocks -p 1234 -KILL <br/><br/>8.我们来深入配置一下socks5.conf,使socks5使用用户验证机制<br/>要使用用户验证，首先要建立/etc/socks5.pwsswd文件<br/>内容为：（userA代表用户名。passwdA代表用户userA的密码）<br/>#/etc/socks5.passwd <br/><br/><div class="code">userA passwdA <br/>userB passwdB <br/>userC passwdC</div><br/><br/>然后修改/etc/socks5.conf<br/>添加下列语句<br/><br/><div class="code">auth - - u</div><br/><br/>或者把：<br/><br/><div class="code">auth - - -</div><br/><br/>改成<br/><br/><div class="code">auth - - u</div><br/><br/>添加：<br/>把默认<br/><br/><br/><div class="code">permit - - - - - -</div><br/><br/>改成<br/><br/><br/><div class="code">permit u - 192.168.0. - - - </div><br/><br/>即允许来自192.168.0.0/255.255.255.0网段的任何经过用户认证的连接 <br/><br/>如果你不想把密码文件存在默认的/etc/socks5.passwd里。想存在自定义的文件，比如/etc/qq.passwd<br/>那就得修改/etc/socks5.conf.添加一项参数<br/>set SOCKS5_PWDFILE /etc/qq.passwd <br/><br/>ok！重启一下服务，这时如果不输入正确的用户名和密码是使用不了socks5代理服务器的，输入正确的用户名和密码便可使用。<br/>以上说的参数，大家可以结合使用，比如限制某个IP段使用socks5服务，而且要使用用户名验证<br/>另外针对/etc/socks5.conf还有一些参数，大家就自己去研究吧<br/>set SOCKS5_BINDINFC 192.168.0.8:1080 <br/>忽略ident请求。当客户机没有运行identd时，使用SOCKS5_NOIDENT将降低超时值 <br/>set SOCKS5_NOIDENT <br/>指定连接停顿最长时间。超过最大值后，socks5断开连接 <br/>set SOCKS5_TIMEOUT 15 <br/>socks5将接受SOCKS V4 协议的请求,默认不接受 <br/>set SOCKS5_V4SUPPORT <br/>指定同时存在的最大子进程数,Socks5预设为64 <br/>set SOCKS5_MAXCHILD 4 <br/>Tags - <a href="http://www.wolfcity.net/tag.php?tag=socks" rel="tag">socks</a> , <a href="http://www.wolfcity.net/tag.php?tag=freebsd%25E7%25BB%258F%25E9%25AA%258C" rel="tag">freebsd经验</a>
]]>
</description>
</item>
</channel>
</rss>