科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网服务器频道建立一个带用户认证功能的SQUID代理服务器

建立一个带用户认证功能的SQUID代理服务器

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

本文介绍了建立一个带用户认证功能的SQUID代理服务器的步骤。

2004年6月28日

关键字: SQUID 代理服务器

  • 评论
  • 分享微博
  • 分享邮件

在本页阅读全文(共2页)

    ZDNetChina服务器站 x86服务器技巧

    SQUID和MYSQL的安装采用了SUN发布的二进制安装包,它在software_companion_x86 CD中可以找到;MYSQL_AUTH用GOOGLE搜索就可以找到。

    一、安装配置SQUID+MYSQL

    1.建立用户和组

# groupadd squid
# useradd -g squid -d /dev/null -s /bin/false squid

# groupadd mysql
# useradd -g mysql -s /bin/false mysql

    2. 安装MYSQL

# mount –F hsfs –o ro /dev/dsk/c1t0d0p0 /cdrom
# cd /cdrom/components/i386/Packages
# pkgadd -d ./ -s /var/spool/pkg SFWmysql SFWgcmn
# pkgadd SFWgcmn SFWmysql

# chown -R root /opt/sfw/mysql
# chgrp -R mysql /opt/sfw/mysql
# chown -R mysql /opt/sfw/mysql/var
# /opt/sfw/mysql/bin/mysql_install_db
# /opt/sfw/mysql/bin/mysqld_safe &

# cp /opt/sfw/mysql/share/mysql/my-medium.cnf /etc/my.cnf
# vi /etc/my.cnf

bind-address = 127.0.0.1

    设置启动脚本:

# cp /opt/sfw/mysql/share/mysql/mysql.server /etc/init.d/mysql.server
# ln /etc/init.d/mysql.server /etc/rc3.d/S79mysql
# ln /etc/init.d/mysql.server /etc/rc0.d/K00mysql
# ln /etc/init.d/mysql.server /etc/rc1.d/K00mysql
# ln /etc/init.d/mysql.server /etc/rc2.d/K00mysql
# ln /etc/init.d/mysql.server /etc/rcS.d/K00mysql
# chown root:sys /etc/init.d/mysql.server /etc/rc3.d/S79mysql
# chmod 0744 /etc/init.d/mysql.server /etc/rc3.d/S79mysql

    设置ROOT密码:

# mysqladmin -u root password llzqq

    3.安装SQUID

# pkgadd -d ./ -s /var/spool/pkg SFWsquid
# pkgadd SFWsquid
# cd /opt/sfw/squid/etc
# cp squid.conf.default squid.conf
# cp mime.conf.default mime.conf

    4.配置SQUID.CONF

http_port 192.168.0.1:3128
cache_mgr llzqq@nero.3322.org
error_directory /opt/sfw/squid/share/errors/Simplify_Chinese
dns_nameservers 202.99.160.68 202.99.168.8
visible_hostname nero.3322.org
httpd_accel_uses_host_header on
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
cache_mem 20 MB
maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 30 KB
minimum_object_size_in_memory 0 KB
cache_swap_low 85
cache_swap_high 90
cache_dir ufs /opt/sfw/squid/var/cache
cache_effective_user squid
cache_effective_group squid

#http_access allow manager localhost
#http_access allow localhost
#http_access deny manager
#http_access deny !Safe_ports
#http_access deny CONNECT !SSL_ports
#http_access deny all
http_reply_access allow all
icp_access allow all
miss_access allow all

# chown –R squid:squid /opt/sfw/squid/var
# /opt/sfw/squid/sbin/squid -z

    5. SQUID启动脚本

# vi /etc/rc3.d/S78squid
====================== S78squid =====================
#!/sbin/sh
#
# Copyright (c) 2004 by llzqq, Inc
# llzqq@126.com
# All rights reserved.
#
#ident  "@(#)squid    1.1     04/05/24 SMI"

case "$1" in
start)
        /opt/sfw/squid/sbin/squid -s
        ;;
stop)
        /opt/sfw/squid/sbin/squid -k shutdown
        pkill squid
        ;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac
exit 0
====================== S78squid =====================
# chown root:sys /etc/rc3.d/S78squid
# chmod 744 /etc/rc3.d/S78squid
# ln -s /etc/rc3.d/S78squid /etc/rc2.d/K78squid

    • 评论
    • 分享微博
    • 分享邮件
    邮件订阅

    如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。

    重磅专题
    往期文章
    最新文章