Anonymous Proxy Using SQUID 3 On Ubuntu 9.04 Server – with web based auth!! (user pass soruyor :D)

Guncelleme
ubuntu 10.04 32 bit minimal install icin yeniden duzenledim

1- ubuntu 10.04 vpsimizi hazir edelim -iki adet ip adresi var
2- apt-get install squid3
3- kendi confum hazir o yuzden var olani yedekle lazim olursa
cp /etc/squid3/squid.conf /etc/squid3/squid.conf.yedek
4- nano /etc/squid3/squid.conf

#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
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
http_access allow localhost
#http_access deny all
icp_access deny all
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern (cgi-bin|\?) 0 0% 0
refresh_pattern . 0 20% 4320

auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/squid_passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours

acl ncsaauth proxy_auth REQUIRED
http_access allow ncsaauth

forwarded_for off

acl ip1 myip 178.63.148.7
tcp_outgoing_address 178.63.148.7 ip1

request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all
save et bitti
5- touch /etc/squid3/squid_passwd
6- htpasswd /etc/squid3/squid_passwd proxykullaniciadi1
7- service squid3 restart

oldu bitti masallah

port 3128 iplerimiz yukaridaki ornekde oldugu gibi 178.63.148.7 bla bla
tabi serverdaki gercek ipleri yaz yerine

————————————-

————————————-

CENTOS 5.x ICIN

yum -y install rpm-build openjade linuxdoc-tools openldap-devel pam-devel openssl-devel httpd rpm-devel

wget http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/10/Fedora/source/SRPMS/squid-3.0.STABLE10-1.fc10.src.rpm

mkdir /usr/src/redhat/

rpm -ivh squid-3.0.STABLE10-1.fc10.src.rpm

cd /usr/src/redhat/SPECS
rpmbuild -bb squid.spec

hata vericek

nano squid.spec diyip

iconv satirini asagidaki sekilde degistir

iconv -f ISO-8859-1 -t UTF-8 ChangeLog > ChangeLog.tmp

sonra yeniden

rpmbuild -bb squid.spec

rpm build olduktan sonra kur

rpm -Uvh /usr/src/redhat/RPMS/x86_64/squid-3.0.STABLE10-1.x86_64.rpm

cd /etc/squid/
mv squid.conf squid.conf.orig
nano squid.conf

YAPISTIR

#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
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
http_access allow localhost
#http_access deny all
icp_access deny all
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern (cgi-bin|\?) 0 0% 0
refresh_pattern . 0 20% 4320

auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/squid_passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours

acl ncsaauth proxy_auth REQUIRED
http_access allow ncsaauth

forwarded_for off

acl ip1 myip 178.63.148.7
tcp_outgoing_address 178.63.148.7 ip1

request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all

save et

sonra user pass olusturucaz

5- touch /etc/squid/squid_passwd
6- htpasswd /etc/squid/squid_passwd proxykullaniciadi1
7- service squid restart

oldu bitti masallah

port 3128 iplerimiz yukaridaki ornekde oldugu gibi 178.63.148.7 bla bla
tabi serverdaki gercek ipleri yaz yerine

————————————-