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

📄 1528.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 2 页
字号:
                        <TABLE cellSpacing=0 cellPadding=3 width="95%" 
                        align=center border=0>
                          <TBODY>
                          <TR>
                            <TD>
                              <TABLE cellSpacing=0 cellPadding=3 width="100%" 
                              border=0>
                                <TBODY>
                                <TR>
                                      <TD vAlign=top> 
<p><FONT class=normalfont><B><font color=blue>RH AS3.0 + SQUID + MYSQL_AUTH</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:llzqq<br>来自:Linux知识宝库<br>联系方式:无名<br><br>
<br>
安装说明:如果你的系统已经安装了SQUID,要先卸载了然后按照本文中的步骤重新安装SQUID。另外如果以前用的是IPTABLES+SQUID做的透明代理,仍然要在浏览器中进行代理服务器设置,否则SQUID不能使用MYSQL认证,关于MYSQL_AUTH的版本是这样的,0.5版的我实验了很久总不能成功,所以我用了0.6beta版的MYSQL_AUTH。<br>
<br>
一、安装SQUID和MYSQL-SERVER<br>
<br>
1.建立用户和组<br>
<br>
[root@home root]# groupadd squid<br>
[root@home root]# adduser -g squid -d /dev/null -s <br>
/sbin/nologin squid<br>
<br>
2. 安装<br>
<br>
[root@home root]# rpm –ivh mysql-server-3.23.58-1.9.i386.rpm<br>
[root@home root]# rpm -ivh  squid-2.5.STABLE3-3.3E.i386.rpm<br>
<br>
设置MYSQL的ROOT管理密码:<br>
[root@home root]# mysqladmin –u root password ******<br>
<br>
设置MSYQL和SQUID开机启动:<br>
[root@home root]# chkconfig mysqld on<br>
[root@home root]# chkconfig squid on<br>
<br>
3.配置SQUID.CONF<br>
--------------------------------------------------------<br>
http_port 3128<br>
cache_mgr llzqq@nero.3322.org<br>
error_directory /usr/share/squid/errors/Simplify_Chinese<br>
dns_nameservers 202.99.160.68 202.99.168.8<br>
visible_hostname nero.3322.org<br>
httpd_accel_uses_host_header on<br>
httpd_accel_host virtual<br>
httpd_accel_with_proxy on<br>
cache_mem 20 MB<br>
maximum_object_size 4096 KB<br>
minimum_object_size 0 KB<br>
maximum_object_size_in_memory 30 KB<br>
minimum_object_size_in_memory 0 KB<br>
cache_dir ufs /tmp 100 16 256<br>
cache_swap_low 85<br>
cache_swap_high 90<br>
httpd_accel_port 80<br>
#http_access deny all<br>
--------------------------------------------------------<br>
4.启动SQUID和MYSQL<br>
<br>
[root@home root]# service mysqld start<br>
[root@home root]# service squid start<br>
<br>
二、   译安装MYSQL_AUTH-0.6<br>
<br>
[root@home root]# tar xzpf mysql_auth-0.6beta.tar.gz<br>
[root@home root]# cd mysql_auth-0.6beta<br>
<br>
修改Makefile中的内容如下:<br>
[root@home mysql_auth-0.6beta]# vi Makefile<br>
<br>
CFLAGS = -I/usr/include/mysql -L/usr/lib/mysql<br>
$(INSTALL) -o squid -g squid -m 755 mysql_auth /usr/bin/mysql_auth<br>
$(INSTALL) -o squid -g squid -m 600 $(CONF) /etc/mysql_auth.conf<br>
$(INSTALL) -o squid -g squid -m 600 $(CONF) /etc/mysql_auth.conf.default<br>
<br>
修改src/define.h中的内容如下:<br>
[root@home mysql_auth-0.6beta]# vi +5 src/define.h<br>
<br>
#define CONFIG_FILE "/etc/mysql_auth.conf"<br>
#define DEF_MYSQLD_SOCKET "/var/lib/mysql/mysql.sock"<br>
<br>
修改src/mysql_auth.conf中的内容如下:<br>
[root@home mysql_auth-0.6beta]# vi src/mysql_auth.conf<br>
<br>
mysqld_socket   /var/lib/mysql/mysql.sock<br>
<br>
[root@home mysql_auth-0.6beta]# make<br>
[root@home mysql_auth-0.6beta]# make install<br>
<br>
创建用户数据库:<br>
[root@home mysql_auth-0.6beta]# cd scripts<br>
[root@home scripts]# mysql -u root –p****** &lt; create_script<br>
<br>
<br>
三、   测试MYSQL_AUTH<br>
<br>
1.添加一个测试用户<br>
<br>
[root@home mysql_auth-0.6beta]# mypasswd test 123456<br>
Password record ADDED succesfully.<br>
<br>
2.验证刚才建立的用户<br>
<br>
[root@home mysql_auth-0.6beta]# mysql_auth test<br>
test 123456<br>
0K<br>
<br>
3.删除一个已经建立的用户用这个命令<br>
<br>
[root@home mysql_auth-0.6beta]# mypasswd –d username<br>
Password record DELETED succesfully.<br>
<br>
四、在SQUID.CONF中增加MYSQL_AUTH认证<br>
<br>
[root@home mysql_auth-0.6beta]# vi /etc/squid/squid.conf<br>
<br>
添加下面的代码到SQUID.CONF中“TAG: acl”一节的后面<br>
<br>
auth_param basic program /usr/bin/mysql_auth<br>
auth_param basic realm Squid caching server<br>
auth_param basic children 5<br>
auth_param basic credentialsttl 2 hours<br>
acl password proxy_auth REQUIRED<br>
http_access allow password<br>
authenticate_ip_ttl 2 hours<br>
http_access deny all<br>
<br>
五、客户端设置<br>
<br>
在你浏览器的代理服务器设置中填写SQUID服务器的IP和端口:<br>
192.168.0.1:3218<br>
<br>
在你下载软件的代理服务器设置中填写SQUID服务器的IP和端口:<br>
192.168.0.1:3218<br>
<br>
六、一个简单的IPTABLES脚本<br>
<br>
eth0:to lan<br>
eth1:to adsl-modem<br>
-------------------------------------------------------------------<br>
#!/bin/bash<br>
<br>
export PATH=/sbin:/usr/sbin:/bin:/usr/bin<br>
<br>
echo 1 &gt;/proc/sys/net/ipv4/ip_forward<br>
iptables -F<br>
iptables -X<br>
iptables -Z<br>
<br>
## Allow forwarding through the internal interface<br>
iptables -A FORWARD -i eth0 -j ACCEPT<br>
iptables -A FORWARD -o eth0 -j ACCEPT<br>
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT<br>
<br>
## Do masquerading through ppp0<br>
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE<br>
<br>
## SQUID<br>
iptables -t nat -A PREROUTING -i eth0 -p tcp -s 0/0 --dport 80 -j REDIRECT --to-ports 3128<br>
<br>
## HTTP<br>
iptables -A INPUT -i ppp0 -p tcp -s 0/0 --sport 80 -m state --state ESTABLISHED,RELATED -j ACCEPT<br>
iptables -A INPUT -i ppp0 -p tcp -s 0/0 --sport 443 -m state --state ESTABLISHED,RELATED -j ACCEPT<br>
iptables -A INPUT -i ppp0 -p tcp -d 0/0 --dport 80 -j ACCEPT<br>
iptables -A INPUT -i ppp0 -p tcp -d 0/0 --dport 443 -j ACCEPT<br>
<br>
## DNS<br>
iptables -A INPUT -i ppp0 -p udp -s 0/0 --sport 53 -m state --state ESTABLISHED -j ACCEPT<br>
iptables -A INPUT -i ppp0 -p udp -d 0/0 --dport 53 -j ACCEPT<br>
<br>
## Anything else not allowed<br>
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<br>
iptables -A INPUT -i ppp0 -j DROP 
</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 + -