📄 1518.html
字号:
request_body_max_size 1 MB<br>
设置了Http请求的包头和数据大小。<br>
<br>
request_body_max_size 0<br>
这里,请求所返回的数据大小为0,意义为没有任何限制。<br>
<br>
connect_timeout 180 seconds<br>
read_timeout 15 minutes<br>
request_timeout 20 seconds<br>
上面几项是代理服务几个超时设置,这里使用配置文件默认值。<br>
<br>
下面是访问控制列表一些配置,这里对访问的IP地址,域名,访问类型极其访问代理的权限做的限制:<br>
acl acldomain dstdomain .ynst.net.cn<br>
acl acceleratedport port 80<br>
acl acceleratedhost dst 202.98.187.17/255.255.255.255<br>
acl aclprotocol proto HTTP FTP<br>
acl aclmethod method GET POST<br>
<br>
acl aclauth proxy_auth required <br>
(注:这里使用required表示任何passwd文件中存在的合法用户才授予访问权限。)<br>
<br>
acl aclsnmp snmp_community secrect<br>
MRTG可以使用snmp协议检测此代理服务运行状态。<br>
<br>
acl aclconn maxconn 20<br>
可并行连接的最大数量。<br>
<br>
启用定义的访问控制列表<br>
http_access allow manager localhost<br>
http_access deny manager<br>
http_access allow aclauth <br>
http_access allow acceleratedport acceleratedhost <br>
http_access deny all<br>
<br>
下面为缓存管理设置<br>
cache_mgr admin@ynst.net.cn<br>
设置缓存管理者的接受邮件地址。<br>
<br>
cache_effective_user squidusr<br>
cache_effective_group squidgrp<br>
设置执行Squid的用户和用户组。<br>
{注:设置用户和用户组及其权限修改方法如下:<br>
#groupadd squidgrp<br>
#useradd –g squidgrp –d /home/squidusr squidusr<br>
修改log日志权限属性,使squidusr有写权限。<br>
#chown squidusr /var/log/squid<br>
#chgrp squidgrp /var/log/squid<br>
#chown squidusr /var/log/squid/*.log<br>
#chown squidgrp /var/log/squid/*.log<br>
}<br>
<br>
下面配置Http服务加速代理<br>
httpd_accel_host 202.98.187.17<br>
httpd_accel_port 80<br>
httpd_accel_with_proxy on <br>
(注:如果配置代理和加速服务,必须httpd_accel_with_proxy选项打开。如果需要配置多个加速,可以使用虚拟的概念。)<br>
<br>
snmp_port 3401<br>
此标记设置snmp_port端口为3401,可以使MRTG监测服务运行状态。<br>
<br>
snmp_access allow aclsnmp localhost<br>
snmp_access deny all<br>
snmp_incoming_address 0.0.0.0<br>
snmp_outgoing_address 0.0.0.0<br>
<br>
以上选项用于配置和MRTG交互信息的Snmp设置。<br>
<br>
digest_generation on<br>
digest_rebuild period 1 hour<br>
digest_rewrite_period 1 hour<br>
digest_swapout_chunk_size 4096 bytes<br>
digest_rebuild_chunk_percentage 10<br>
产生缓存摘要,并设置摘要重构所需要的时间及其相关设置,这里采用系统默认设置。缓存摘要使的庞大的缓存内容形成一个微型检索,提高代理性能。<br>
<br>
最后我们进行延迟队列池进行配置<br>
延迟队列池可以基于一定规则对特定请求数据的进行限制,这样可以防止恶意用户发送非正规数据串攻击服务器。<br>
以下选项只在必要处进行说明,配置如下:<br>
delay_pools 1 #定义一个池<br>
delay_class 1 1 #池为1类型<br>
delay_access 1 allow all #允许类型1的所有请求访问<br>
delay_parameters 1 128000/128000 #限制访问的128k/s<br>
delay_initial_bucket_level 50 #Squid启动时,初始化池所用的带宽数量。<br>
<br>
运行Squid代理服务:<br>
#squid –z /*创建Squid所使用的缓存目录结构<br>
如果想在前台运行<br>
#squid –NCdl<br>
如果想在后台运行<br>
#squid<br>
检查Squid是否运行<br>
#squid –k check<br>
<br>
<br>
<br>
<br>
lMRTG配置:<br>
首先测试SNMP服务是否启动:<br>
#snmpwalk -p 3401 hostname communitystring .1.3.6.1.4.1.3495.1.1<br>
如果看到如下输出:<br>
enterprises.nlanr.squid.cacheSystem.cacheSysVMsize = 7970816<br>
enterprises.nlanr.squid.cacheSystem.cacheSysStorage = 2796142<br>
enterprises.nlanr.squid.cacheSystem.cacheUptime = Timeticks: (766299) 2:07:42.99<br>
则说明SNMP正常工作。<br>
按照mrtg.hdl.com的文档,使用cfgmaker和indexmaker就可以生成MRTG所需要的Web发布文件。使用cfgmaker可以创建配置MRTG所需要的配置文件,而Indexmaker则是检索MRTG生成的Web文件,制作一个Index.html。这里,我提供一种更为简洁的办法:<br>
(感谢Chris提供的mrtg-squid.cfg文件和index.html,可到http://www.psychofx.com/chris/unix/mrtg/ 下载这两个文件。)<br>
修改mrtg-squid.cfg文件选项如下:<br>
修改 WorkDir 和 LoadMIBs 路径设置<br>
修改所有出现在文件中的"hostname" 为你实际服务器名字<br>
修改所有 "chris"字段为你需要的名字和地址<br>
修改community 字串属性<br>
这里配置如下:<br>
WorkDir: /home/www/mrtg/squid<br>
LoadMIBs: /usr/local/squid/etc/mib.txt<br>
所有public@hostname修改secrect@proxysvr<br>
<br>
创建/home/www/mrtg/squid这样一个目录。<br>
#mkdir /home/www/mrtg/squid<br>
#cd /home/www/mrtg/squid<br>
#cp /opt/mrtg-squid.cfg .<br>
#mrtg mrtg-squid.cfg<br>
#cp /opt/index.html .<br>
<br>
修改/etc/httpd/conf/httpd.conf如下几个选项<br>
Listen 8000<br>
Port 8000<br>
Documentroot /home/www/mrtg/squid<br>
<br>
由于mrtg读取文件需要资源,因为合理设置读取间隔,这里我设置为5分钟:<br>
crontab –e<br>
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /home/www/mrtg/squid/mrtg-squid.cfg<br>
<br>
这样,我们就建立了一个完善的代理加速访问服务器,通过mrtg的强大监控,可以统计服务器运行时设备运行状态。由于以上软件遵从GNU,因此一种强大而有经济的建站手段。通过认证控制,允许特定用户使用代理服务。而Web加速服务器则成为服务器镜像的方便手段。<br>
</FONT><br>
</TD>
</TR>
<TR>
<TD colSpan=2><FONT
class=middlefont></FONT><BR>
<FONT
class=normalfont>全文结束</FONT> </TD>
</TR>
<TR>
<TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2
height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width="20%"
background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2>
<DIV align=center>
<table class=tableoutline cellspacing=1 cellpadding=4
width="100%" align=center border=0>
<tr class=firstalt>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
<font class=normalfont><b>所有分类</b></font></td>
</tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td> </tr> </table></td></tr> </table>
</DIV></TD></TR>
<TR vAlign=top>
<TD width="80%">
<DIV align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee
border=0><TBODY>
<TR>
<TD width="50%">
<P><FONT class=middlefont>版权所有 © 2004 <A
href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
违者必究. </FONT></P>
</TD>
<TD width="50%">
<DIV align=right><FONT class=middlefont>Powered by: <A
href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
</TD></TR></TBODY></TABLE>
<CENTER></CENTER></TD></TR>
</TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -