Install Squid and Sockd proxy servers on an AWS instance

From JMK Wiki
Jump to navigation Jump to search

Dante

root@localhost ~ # cd /usr/local/src
root@localhost /usr/local/src # wget wget https://www.inet.no/dante/files/dante-1.4.1.tar.gz
root@localhost /usr/local/src # tar xvzf dante-1.4.1.tar.gz
root@localhost /usr/local/src # cd dante-1.4.1
root@localhost /usr/local/src/dante-1.4.1 # ./configure
root@localhost /usr/local/src/dante-1.4.1 # make
root@localhost /usr/local/src/dante-1.4.1 # make install
root@localhost ~ # nano -w /etc/sockd.conf
errorlog: /var/log/sockd.errlog
logoutput: /var/log/sockd.log

internal: 0.0.0.0 port = 1080
external: eth0

user.notprivileged: nobody

clientmethod: none
socksmethod: none

client pass {
	from: 0.0.0.0/0 to: 0.0.0.0/0
	log: error connect # disconnect
}

socks pass {
	from: 0.0.0.0/0 to: 0.0.0.0/0
	command: bind connect udpassociate
	log: error connect # disconnect iooperation
}

socks pass {
	from: 0.0.0.0/0 to: 0.0.0.0/0
	command: bindreply udpreply
	log: error connect # disconnect iooperation
}

Squid

root@localhost ~ # yum install squid
root@localhost ~ # nano -w /etc/squid/squid.conf
auth_param digest program /usr/lib64/squid/digest_pw_auth -c /etc/squid/digest
auth_param digest children 2
auth_param digest realm REALM

acl authenticatedusers proxy_auth REQUIRED

http_access allow authenticatedusers
http_access deny all

http_port 3128
root@localhost ~ # touch /etc/squid/digest
root@localhost ~ # chown squid:squid /etc/squid/digest
root@localhost ~ # chmod 640 /etc/squid/digest
root@localhost ~ # htdigest /etc/squid/digest REALM USER
root@localhost ~ # echo -n "USER:REALM:SECRET" | md5hash
root@localhost ~ # chkconfig squid on
root@localhost ~ # /etc/init.d/squid start