Skip to content

Instantly share code, notes, and snippets.

@jacarandang
Created July 15, 2015 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacarandang/dd741eab0ee1371a878e to your computer and use it in GitHub Desktop.
Save jacarandang/dd741eab0ee1371a878e to your computer and use it in GitHub Desktop.
Setup squid3 on an ubuntu machine
#updating and upgrading
sudo apt-get update
sudo apt-get upgrade
#installing squid3
sudo apt-get install squid3
#installing rvm and rubies
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby
#get git in order to get gist files
sudo apt-get install git
#default squid config file location
cd /etc/squid3/
#get rewrite.rb
sudo git clone https://gist.github.com/d6ed7f79840e5f238325.git rewrite
sudo cp ./rewrite/rewrite.rb rewrite.rb
sudo rm -rf ./rewrite
#get squid3.conf
sudo git clone https://gist.github.com/jacarandang/076ab1989f9c5723fa4e squid3.conf.d
#backup default squid3 configuration
sudo mv ./squid.conf ./squid.conf.back
#copy squid configuration files and delete gist directory
#(You might want to change the cache size used in the directory, default is 1 GB)
sudo cp ./squid3.conf.d/gistfile1.txt ./squid.conf
sudo rm -rf ./squid3.conf.d
#Tell squid3 to use the new configuration
sudo squid3 -k reconfigure
#stop squid3
sudo service squid3 stop
#create cache directory
sudo squid3 -z
#start squid3 again
sudp service squid3 start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment