Surprise Me!

centos 6 - install squid proxy

2016-01-14 5,481 Dailymotion

install squid proxy on centos : <br />1/ yum update -y <br />2/ yum groupinstall "Development Tools" -y <br />3/ yum install libxml2-devel libcap-devel -y <br />4/ yum install kernel-devel kernel-headers -y <br />5/ yum install httpd nano -y <br />6/ yum install squid -y <br />7/ rm -rf /etc/squid/squid.conf <br />8/ touch /etc/squid/squid.conf <br />9/nano /etc/squid/squid.conf <br /> <br />dns_nameservers 8.8.8.8 8.8.4.4 4.2.2.1 4.2.2.6 198.6.1.3 204.117.214.10 207.172.11.73 <br />dns_defnames on <br />dns_retransmit_interval 2 seconds <br />dns_timeout 5 minutes <br />balance_on_multiple_ip on <br />cache_mgr not_to_be_disturbed <br />client_db on <br />detect_broken_pconn on <br />half_closed_clients off <br />httpd_suppress_version_string on <br />ignore_unknown_nameservers on <br />pipeline_prefetch on <br />prefer_direct on <br />query_icmp on <br />range_offset_limit -1 <br />retry_on_error on <br />server_persistent_connections on <br />strip_query_terms off <br />uri_whitespace strip <br /> <br />## untuk password untuk versi 32bit, lokasi file ganti seperti di bawah ini : <br />## /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd <br />auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd <br />auth_param basic children 5 <br />auth_param basic realm Squid proxy-caching web server <br />auth_param basic credentialsttl 2 hour <br /># ACCESS CONTROLS <br />###################### <br />#Recommended minimum configuration: <br />acl manager proto cache_object <br />acl localhost src 127.0.0.1/32 ::1 <br />acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 <br /> <br /># local networks. <br />acl localnet src 10.0.0.0/8 # RFC1918 possible internal network <br />acl localnet src 172.16.0.0/12 # RFC1918 possible internal network <br />acl localnet src 192.168.0.0/16 # RFC1918 possible internal network <br /> <br />acl SSL_ports port 21 22 25 53 109 143 443 554 563 993 21976 <br />acl Safe_ports port 53 80 136 137 182 <br />acl Safe_ports port 22 25 70 210 280 <br />acl Safe_ports port 143 443 554 563 993 <br />acl Safe_ports port 1025-65535 <br />acl Safe_ports port 8000-8090 <br />acl Safe_ports port 67-68 <br />acl Safe_ports port 123 465 488 587 591 777 6667 <br />acl Safe_ports port 9000-9091 <br />acl Safe_ports port 110 119 995 2030 2401 3306 3690 6881 8443 8843 <br />acl ncsa_users proxy_auth REQUIRED <br />acl CONNECT method CONNECT <br /># <br />#Recommended minimum configuration: <br />###################### <br />## Only allow cachemgr access from localhost <br />http_access allow manager localhost <br />http_access deny manager <br />## <br />http_access allow localhost <br />http_access allow ncsa_users <br />http_access deny to_localhost <br />http_access deny !Safe_ports <br />http_access deny CONNECT !SSL_ports <br />## <br />## disable multicast icp <br />miss_access allow all <br />ident_lookup_access deny all <br /> <br /># NETWORK OPTIONS <br />###################### <br />http_port 4901 <br /> <br /># Leave coredumps in the first cache dir <br />access_log /var/log/squid/access.log <br />cache_log /var/log/squid/cache.log <br />cache_access_log none <br />cache_store_log none <br /># <br />hierarchy_stoplist cgi-bin ? <br />acl apache rep_header Server ^Apache <br /> <br />ipcache_size 8192 <br />ipcache_low 90 <br />ipcache_high 95 <br /> <br />#cache_dir null /tmp <br />cache_mem 50 MB <br />cache_dir ufs /var/spool/squid/cache0 1000 16 256 <br />cache_dir ufs /var/spool/squid/cache1 1000 16 256 <br />cache_dir ufs /var/spool/squid/cache2 1000 16 256 <br />cache_dir ufs /var/spool/squid/cache3 1000 16 256 <br />deny_info ::0 all <br /> <br /># Add any of your own refresh_pattern entries above these. <br />refresh_pattern ^ftp: 1440 20% 10080 <br />refresh_pattern ^gopher: 1440 0% 1440 <br />refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 <br />refresh_pattern . 0 20% 4320 <br /> <br />visible_hostname google.com <br /> <br />10/ touch /etc/squid/squid_passwd <br />11/ chown root.root /etc/squid/squid_passwd <br />12/ htpasswd -b /etc/squid/squid_passwd aulialpa 123456 <br />13/ cd /var/spool <br />14/ chmod 775 squid <br />15/ chmod g+w squid <br />16/ squid -z <br />17/ squid -d 1 -D <br /># tekan CTRL+C================= <br />18/ service squid restart <br />19/ chkconfig --add squid <br />20/ chkconfig squid on <br />21/ service squid status

Buy Now on CodeCanyon