how to make a squid proxy sript
DO or VLtr
everybody is looking for a good proxy heres how
use ubuntu 16 64bit
apt-get update && apt-get upgrade -y
apt-get install squid apache2-utils -y
cp /etc/squid/squid.conf /etc/squid/squid.conf.bak
type this command to erase content script:
echo '' > /etc/squid/squid.conf
nano /etc/squid/squid.conf
http_port 3128
#default lng siya 3128 pde mo palitan port 8080,80 ikaw bahala ang gusto mo port
cache deny all
hierarchy_stoplist cgi-bin ?
access_log none
cache_store_log none
cache_log /dev/null
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl vpnservers dst 45.024.14.24
#45.024.14.24 palitan mo ip na ito sa ip na gagamitin mo or un vps server ip mo.
acl vpnservers dst 127.0.0.1
acl Safe_ports port 22
acl SSL_ports port 22
acl Safe_ports port 443 # https
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/passwd
#auth_param basic children 5
#auth_param basic realm Squid Basic Authentication
#auth_param basic realm Squid proxy-caching web server
#auth_param basic credentialsttl 2 hours
#acl password proxy_auth REQUIRED
http_access allow localhost
#http_access allow password
#http_access deny all
http_access allow vpnservers
http_access deny !vpnservers
http_access allow all
forwarded_for off
/etc/init.d/squid restart
iptables -I OUTPUT -p tcp --sport 3128 -j DROP && iptables -I OUTPUT -p tcp --sport 3128 -m quota --quota 500000000000 -j ACCEPT
for port 8080:
iptables -I OUTPUT -p tcp --sport 8080 -j DROP && iptables -I OUTPUT -p tcp --sport 8080 -m quota --quota 500000000000 -j ACCEPT
for port 443:
iptables -I OUTPUT -p tcp --sport 443 -j DROP && iptables -I OUTPUT -p tcp --sport 443 -m quota --quota 500000000000 -j ACCEPT
for port 22:
iptables -I OUTPUT -p tcp --sport 22 -j DROP && iptables -I OUTPUT -p tcp --sport 22 -m quota --quota 1000000000000 -j ACCEPT
iptables -nvL -t filter --line-numbers
dpkg-reconfigure tzdata
crontab -e
paste mo ito sa pinaka baba last part 12am ng madaling araw mag rerestart ang squid/RP.
00 * * * * /etc/init.d/squid restart >> /var/log/r-squid.log 2>&1
thanks
DO or VLtr
everybody is looking for a good proxy heres how
use ubuntu 16 64bit
apt-get update && apt-get upgrade -y
apt-get install squid apache2-utils -y
cp /etc/squid/squid.conf /etc/squid/squid.conf.bak
type this command to erase content script:
echo '' > /etc/squid/squid.conf
nano /etc/squid/squid.conf
http_port 3128
#default lng siya 3128 pde mo palitan port 8080,80 ikaw bahala ang gusto mo port
cache deny all
hierarchy_stoplist cgi-bin ?
access_log none
cache_store_log none
cache_log /dev/null
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl vpnservers dst 45.024.14.24
#45.024.14.24 palitan mo ip na ito sa ip na gagamitin mo or un vps server ip mo.
acl vpnservers dst 127.0.0.1
acl Safe_ports port 22
acl SSL_ports port 22
acl Safe_ports port 443 # https
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/passwd
#auth_param basic children 5
#auth_param basic realm Squid Basic Authentication
#auth_param basic realm Squid proxy-caching web server
#auth_param basic credentialsttl 2 hours
#acl password proxy_auth REQUIRED
http_access allow localhost
#http_access allow password
#http_access deny all
http_access allow vpnservers
http_access deny !vpnservers
http_access allow all
forwarded_for off
/etc/init.d/squid restart
iptables -I OUTPUT -p tcp --sport 3128 -j DROP && iptables -I OUTPUT -p tcp --sport 3128 -m quota --quota 500000000000 -j ACCEPT
for port 8080:
iptables -I OUTPUT -p tcp --sport 8080 -j DROP && iptables -I OUTPUT -p tcp --sport 8080 -m quota --quota 500000000000 -j ACCEPT
for port 443:
iptables -I OUTPUT -p tcp --sport 443 -j DROP && iptables -I OUTPUT -p tcp --sport 443 -m quota --quota 500000000000 -j ACCEPT
for port 22:
iptables -I OUTPUT -p tcp --sport 22 -j DROP && iptables -I OUTPUT -p tcp --sport 22 -m quota --quota 1000000000000 -j ACCEPT
iptables -nvL -t filter --line-numbers
dpkg-reconfigure tzdata
crontab -e
paste mo ito sa pinaka baba last part 12am ng madaling araw mag rerestart ang squid/RP.
00 * * * * /etc/init.d/squid restart >> /var/log/r-squid.log 2>&1
thanks
Last edited: