自動化安裝admuser的腳本

 使用環境:<由於是主要針對公司的某一產品寫的,因此貼在這裏備忘.具體使用只須要作少量修改便可!>
一、安裝了squid而且使用了認證功能
二、要求安裝了httpd
  
  1. #!/bin/bash 
  2. #made by cheng 
  3. #version:1 
  4. #last_time:2011/08/28 
  5.  
  6. echo "##############version Info#################" 
  7. echo "This script only used for squid proxy mode" 
  8. echo "create by cheng" 
  9. echo "create time: 2011/08/29" 
  10. echo "mail:baoch8@163.com" 
  11. echo "version: 1" 
  12. echo "###########################################" 
  13.  
  14. tar -xzf admuser-2.3.2.tar.gz -C /usr/src 
  15. cd /usr/src/admuser-2.3.2/ 
  16. ./configure --prefix=/usr/local/admuser --enable-cgidir=/var/www/cgi-bin/  > /dev/null 
  17. make > /dev/null 
  18. make install  > /dev/null 
  19.  
  20. #modify ssl 443 
  21. sed  -i 's/Listen 443/#Listen 443/g'  /etc/httpd/conf.d/ssl.conf  
  22.  
  23. #start http 
  24. chkconfig httpd on 
  25. service httpd start > /dev/null 
  26.  
  27. #where is passwd 
  28. squidpasswd=`grep ncsa_auth  /etc/squid/squid.conf | cut -d " " -f 5` 
  29.  
  30. #touch file 
  31. chmod 777 $squidpasswd 
  32. touch /usr/local/admuser/passwd_files 
  33. echo "$squidpasswd;test" > /usr/local/admuser/passwd_files 
  34.  
  35. #modify admuser.conf 
  36. sed -i '12c\password_file /usr/local/admuser/passwd_files' /usr/local/admuser/admuser.conf 
  37.  
  38. #disable selinux 
  39. sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 
  40. setenforce 0 
  41.  
  42. echo "Good lock!  http://`hostname`/cgi-bin/admuser.cgi" 
  43. sleep 5 
  44. exit 1 

 

本文出自 「潛入技術的海洋」 博客,請務必保留此出處http://myhat.blog.51cto.com/391263/652700linux

相關文章
相關標籤/搜索