使用环境:<因为是主要针对公司的某一产品写的,所以贴在这里备忘.具体使用只需要做少许修改即可!
>
![](/neweditor/editor/p_w_picpaths/smiley/42.gif)
1、安装了squid并且使用了认证功能
2、要求安装了httpd
- #!/bin/bash
- #made by cheng
- #version:1
- #last_time:2011/08/28
- echo "##############version Info#################"
- echo "This script only used for squid proxy mode"
- echo "create by cheng"
- echo "create time: 2011/08/29"
- echo "mail:baoch8@163.com"
- echo "version: 1"
- echo "###########################################"
- tar -xzf admuser-2.3.2.tar.gz -C /usr/src
- cd /usr/src/admuser-2.3.2/
- ./configure --prefix=/usr/local/admuser --enable-cgidir=/var/www/cgi-bin/ > /dev/null
- make > /dev/null
- make install > /dev/null
- #modify ssl 443
- sed -i 's/Listen 443/#Listen 443/g' /etc/httpd/conf.d/ssl.conf
- #start http
- chkconfig httpd on
- service httpd start > /dev/null
- #where is passwd
- squidpasswd=`grep ncsa_auth /etc/squid/squid.conf | cut -d " " -f 5`
- #touch file
- chmod 777 $squidpasswd
- touch /usr/local/admuser/passwd_files
- echo "$squidpasswd;test" > /usr/local/admuser/passwd_files
- #modify admuser.conf
- sed -i '12c\password_file /usr/local/admuser/passwd_files' /usr/local/admuser/admuser.conf
- #disable selinux
- sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
- setenforce 0
- echo "Good lock! http://`hostname`/cgi-bin/admuser.cgi"
- sleep 5
- exit 1