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

📄 1500.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<br>
  作为一种免费的网络操作系统,linux越来越受到广大网络爱好者的欢迎了,目前因特网(Internet)上运行的主机有相当一部分采用的就是linux操作系统,而且中国已经把linux操作系统作为政府上网年的指定网络操作系统,种种迹象表明,linux操作系统正在逐渐走向成熟。今天,我给大家介绍一种能在Linux系统下使用的比较优秀的代理服务器软件的安装和调试方法。<br>
  众所周知,当今因特网发展速度极其迅猛,IP地址资源非常紧张。而如果您想访问因特网,共享因特网的丰富资源,您的机器必须拥有一个标准的IP地址。在因特网上,IP地址是识别您的机器的唯一标志。目前,有两种方式可以让您的机器拥有标准的IP地址:一种是局域网通过专线接入因特网,您的机器可以拥有静态的IP地址。所谓静态IP地址,就是对使用者来说,是固定不变的IP地址,这个IP地址给您使用后,其他人就不能再用了。一种是通过电话线拨号或ISDN拨号等方式接入因特网,您的机器可以在您拨号上网的在线期间从ISP的访问服务器的IP地址池中获得一个临时的标准IP地址,这个IP地址在您下线后就不归您使用了,而您下次拨号再上网,很可能分配给您的机器的是另外一个临时的IP地址了。这种临时分配的IP地址,称为动态IP地址。无论是静态地址还是动态地址,在您的机器访问因特网时,使用起来没有什么区别。<br>
  现在因特网发展速度这么快,而IP地址资源又这么紧张,这不能不说是一个尖锐的矛盾。虽说Ipv6正在开发中,但远水不解近渴,好多的企业、公司内部的Intranet现在就想接入因特网这个浩瀚的资源海洋,但又苦于没有充足的IP地址资源,怎么办?还好,有代理服务这个好东西。代理服务是指由一台拥有标准IP地址的机器代替若干没有标准IP地址(以下称内部地址)的机器和因特网上的其他主机打交道,提供代理服务的这台机器称为代理服务器。拥有内部地址的机器想到因特网上查找资料时,先把这个请求发给拥有标准IP地址的代理服务器,由代理服务器把这个请求通过它的标准IP地址发到请求的目标地址。然后目标地址的服务器把返回的结果发回给代理服务器,代理服务器再原封不动的把资料发给最初那台拥有内部IP地址的机器。这样就完成了一次内部机器访问因特网的一个过程。若干拥有内部地址的机器就组成了内部网,代理服务器的作用就是勾通内部网和因特网,解决内部网访问因特网的问题。而且这种代理是不可逆的,因特网上的主机不能访问任何一台拥有内部地址的机器,这样又可以保障内部资料的安全性。<br>
能够完成这种代理功能的服务器软件有好多,我给大家推荐一种能在linux下使用的比较优秀的代理服务器软件Squid。之所以说它比较优秀,一方面是因为它可以在代理服务器上作一个很大的缓存,可以把好多常去的网站内容存储到缓存中,这样,内部网的机器再访问那些网站,就可以从缓存里调用了。这样一可以加快内部网浏览因特网的速度,二可以减少专线的数据流量。另一方面,Squid不仅仅支持HTTP协议,而且还支持FTP,GOPHER,SSL和WAIS等协议。下面我将逐步介绍该服务器软件的下载、编译、安装和调试。<br>
一、 准备工作<br>
  最好是为Squid建立专用的运行帐号和用户组。比如建立新帐号test1,把该帐号归为test组,把该帐号的根目录设为/usr/local/squid。以下操作均由这个专用帐号来完成。<br>
二、 下载:<br>
  可以在http://squid.nlanr.net/Squid/ 处下载Squid代理服务器软件。文件名字是 squid-2.2.STABLE3-src.tar.gz。这是一个压缩以后的数据包。假设下载后我们把它放在/usr/local/squid/src目录里。<br>
三、 解压缩数据包<br>
  进入/usr/local/squid/src目录,键入如下命令:<br>
gzip –dc squid-2.2.STABLE3-src.tar.gz | tar –xvf –<br>
这个命令将该数据包解开,建立一个目录叫作squid-2.2.STABLE3,并且把所有的文件放在这个目录里面。<br>
四、 编译源程序<br>
  首先运行配置脚本,以便生成适合您的机器的编译脚本。命令格式是:<br>
./configure<br>
这种方式产生的编译脚本编译后默认安装路径是/usr/local/squid。<br>
如果想改变安装路径,需要用以下格式:<br>
./configure –prefix=/some/other/directory<br>
这种方法编译后安装到/some/other/directory里面。<br>
生成编译脚本后,可以正式开始编译了。命令为:<br>
make<br>
五、 安装Squid代理服务器<br>
  编译无误,安装显得更加简单了。命令为:<br>
make install<br>
安装完成后,会在您指定的安装路径里产生一个squid目录,squid目录下有三个目录:etc、bin、logs。其中etc里面是配置文件,bin里面是执行文件,logs里面是日志文件。<br>
六、 调试代理服务器<br>
  安装结束后就是调试服务器,使其按照您的要求工作。Squid的配置文件只有一个,在etc目录里,名字是squid.conf,所有的配置选项都在这个文件里面。而且每个配置项目都有注释说明。我们就不一一介绍所有的配置项目了,只介绍几个常用的项目。<br>
  首先,在squid文件里面找到下列配置项:<br>
<br>
cache_mem<br>
<br>
  这里可以添上您准备给squid作为高速缓存使用的内存大小。注意,如果您的机器有N兆内存,那么,推荐您在这里添的数字是N/3。<br>
<br>
cache_dir /usr/local/squid/cache 100 16 256<br>
<br>
  这里的第一个数字100是您准备给squid作为cache使用的硬盘空间大小,单位是兆。如果您想划100M空间当作cache,那么这里就写100。<br>
acl, http_access, icp_access<br>
<br>
用您的网络地址(比如:192.168.10.0)和子网掩码(比如:255.255.255.0)填写“allowed host”ACL访问控制列表。这是很重要的一项,它可以防止未经您授权的人窃取您的网络资源。<br>
acl manager proto cache_object<br>
acl localhost src 127.0.0.1/255.255.255.255<br>
acl all src 0.0.0.0/0.0.0.0<br>
acl allowed_hosts src 192.168.10.0/255.255.255.0<br>
<br>
http_access deny manager all<br>
http_access allow allowed_hosts<br>
http_access deny all<br>
<br>
icp_access allow allowed_hosts<br>
icp_access deny all<br>
<br>
<br>
cache_mgr<br>
<br>
  这里填写cache管理员的Email地址,系统出错会自动提醒cache管理员。<br>
<br>
  修改完配置文件,在正式运行squid代理服务器之前,先进行初始化。命令如下:<br>
% /usr/local/squid/bin/squid -z<br>
% /usr/local/squid/bin/squid<br>
  检查cache.log文件确保所有部分运行正常。如果有出错信息,系统不能正常启动,一般情况是由于目录和文件的存取权限导致的,请仔细检查各目录和文件的权限设置。<br>
  如果一切正常,那么就可以投入使用了。系统默认的服务端口是3128。<br>
<br>
七、 使用代理服务器<br>
  在调试完成之后,就可以试试代理服务器了。将您的某台终端机设置成内部地址,将该终端的DNS服务器设置为代理服务器的DNS服务,在内部地址和标准地址之间作一个路由,这样,您应该在终端上可以ping通代理服务器的标准地址了。在您的浏览器里设置代理服务器地址为squid代理服务器的地址,端口号为3128,试试浏览外面的网站,怎么样?成功了!!!<br>
<br>
  代理服务器的安装调试结束了,您可以根据您的网络出口带宽,随时调整访问控制列表,决定代理多少台终端访问因特网。您还可以调整squid.conf的其他配置使其更能适应您的需要。<br>
最后说明一点,squid不仅可以用在linux系统上,经过测试,它还可以用在以下系统上:AIX, Digital Unix, FreeBSD, HP-UX, Irix, NetBSD, Nextstep, SCO, Solaris等等。您还在等什么?赶快动手试试吧!<br>
<br>
<br>
<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 + -