⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1508.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
  以下是编译Squid的一般指令。你可能还要做其它的事以编译Squid到你的系统上。通常你可以运行一个配置脚本文件,它指明了你的系统设置和你机器上的标题文件。这样,在解压和解包文件后。cd 到/usr/local/squid/src/squid-version/下并输入: <br>
./configure <br>
<br>
  这里假定你准备安装Squid到/usr/local/squid下。你也可以用下面的方法修改你的安装目录: <br>
./configure -prefix=/some/other/directory <br>
<br>
  然后你可能要敲入:make 以及 如果编译一切正常时,输入make install。这将生成在后面将要描述的目录并安装文件到目录下。 <br>
<br>
三、Squid的基本配置 <br>
<br>
  1. 目录结构 <br>
<br>
   Squid通常创建几个目录。它们一般如下: <br>
/usr/local/squid <br>
/bin <br>
/cache <br>
/etc <br>
/logs/ <br>
/src (这是我们早些时候创建的) <br>
/bin包括Squid本身的程序,以及其它程序如ftpget,它可以被Squid用来执行各种功能。 <br>
/cache/目录是实际缓冲数据的存放区。你可能要考虑把剩余缓冲放到不同分区去,或甚至是不同的磁盘。它包含的目录如以下行的形式:/00/ /01/ /02/ 和/03/ 这些又包括更多的子目录,最终是缓冲的实际数据。存储数据在多个目录下意味着从大的缓冲区取数据仍然很快,因为你的操作系统要读一个包含10000个文件的目录会需要很长的时间。 <br>
/etc/包含squid.conf文件,它是唯一的Squid配置文件。 <br>
/logs/目录可能会很大,特别是如果你包含同属时,它们会查询你每一次连接,这可以使你的log文件双倍增加。注意在cache目录下也有一个/log/文件,但是你不能删除或移动它。它是上面讨论的/usr/local/squid/cache/目录的一个索引。(这与IE的cache有些相似。) <br>
/src/一般包括你运行Squid版本的源文件。 <br>
<br>
  2. 基本配置 <br>
<br>
  所有的Squid配置集中到一个文件----squid.conf。下面将详细讨论仅作为一个缓冲代理服务器的Squid的配置,而不是把它作为一个http加速器。 <br>
<br>
  以下是一个最基本的配置文件: <br>
#squid.conf - a very basic config file for squid <br>
<br>
#Turn logging to its lowest level <br>
debug_options ALL,1 <br>
<br>
#defines a group (or Access Control List) that includes all IP <br>
#addresses <br>
acl all src 0.0.0.0/0.0.0.0 <br>
<br>
#allow all sites to use connect to us via HTTP <br>
http_access allow all <br>
<br>
#allow all sites to use us as a sibling <br>
icp_access allow all <br>
<br>
#test the following sites to check that we are connected <br>
dns_testnames internic.net usc.edu cs.colorado.edu mit.edu yale.edu <br>
<br>
#run as the squid user <br>
cache_effective_user squid squid <br>
#otherwise, you can uncomment the below line and comment the one out. <br>
# this will run as use "nobody" with the group "nogrtoup" <br>
cache_effective_user nobody nogroup <br>
<br>
  这个配置允许所有的人访问缓冲区,并创建一个100M的缓冲区,使用8M的内存,保持最小型的logs,而且存储所有文件到默认区域,这一般指的是所有文件将以Squid用户,Squid组的名义存储到“/usr/local/squid/cache”中。所有客户请求将来自于3128端口,并且所有“内部缓冲(inter-cache)”流量将走UDP端口3130。注意这个配置文件允许所有人访问你的缓冲机器,这可能不是你所希望的,但是至少它可以正常工作。 <br>
<br>
  3. 运行Squid <br>
<br>
  Squid由一个脚本正常运行,这个脚本在它的进程死掉后重启Squid。这里有脚本的两种版本:/usr/local/squid/bin/RunCache 和 /usr/local/squid/bin/RunAccel 。 <br>
RunCache脚本一般在前台运行,所以启动Squid,输入以下内容: <br>
% /usr/local/squid/bin/RunCache& % <br>
然后用以下命令查看主Squid log文件/usr/local/squid/logs/cache.log <br>
% more /usr/local/squid/logs/cache.log <br>
<br>
  你将看到Squid启动的相关信息,如下行所示: <br>
97/02/24 19:34:52| Starting Squid Cache version 1.1.10 for i586-pc-linux-gnu... <br>
97/02/24 19:34:52| With 256 file descriptors available <br>
97/02/24 19:34:52| Initializing IP Cache... <br>
如果你没有看见任何关于FATAL错误的信息,Squid现在就可以很高兴地在你的机器上运行了。 <br>
<br>
  下面将配置你的浏览器,你可以好好地试一下哦! <br>
<br>
  4. 客户端软件的基本配置 <br>
<br>
   以下是针对浏览器的基本配置: <br>
<br>
   Netscape(4.5以上版本): <br>
从Edit菜单项中选择Preferences项。在Advanced中Proxies页,点击按钮进入Proxy配置手册,然后再点击View按钮。对每项你的Squid服务器支持的协议项(默认有HTTP,FTP和gopher等)中填入Squid服务器的主机名或IP地址,同时在Port栏中填入Squid服务器的HTTP端口号(默认为3128)。对你的Squid不支持的协议,可以让这些栏空着。 <br>
<br>
  IE(5.0以上中文版本): <br>
在工具菜单项中选择Internet选项,然后点击连接页,再按局域网设置按钮选择使用代理服务器选项,进入高级项目编辑。然后可以看到与Netscape代理服务器设置类似的界面,按照前面所述的方法分别填入相应项即可。 <br>
<br>
  一般Unix下配置: <br>
<br>
  如果你使用可以允许你访问web的Unix程序(包括wget,lynx和mosaic等),你可以设置shell变量,通过这些变量可以配置好代理。 <br>
<br>
  如果你使用的shell是tcsh或csh,命令如下: <br>
% setenv http_proxy http://mycache.example.com:3128/ <br>
% setenv gopher_proxy http://mycache.example.com:3128/ <br>
% setenv ftp_proxy http://mycache.example.com:3128/ <br>
<br>
  现在你就可以使用你的浏览器与缓冲连接以下载页面了。为了检查通过缓冲是否工作正常,可以查看/usr/local/squid/logs/access.log文件的内容,使用命令如下:more /usr/local/squid/logs/access.log。你可以看到所有你进行的访问信息都显示在该文件中。 <br>
 <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>版权所有 &copy; 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 + -