Ubuntu Proxy Server squid
Created by AFRIZAL
Ubuntu Proxy can be understood as a
third party who stood in the middle between two
parties that are interconnected and function as an
intermediary, such that the first party and second
party not directly related, but are each associated with an intermediary, namely Proxy server. Now we
want to setup a ubuntu proxy server using a Personal Computer with basic spesifications are follow:
Proccessor : Intel Dual Core
RAM : 2GB DDR2
Hard Disk : 200 GB SATA
If a student borrows a book about "how to setup Ubuntu Proxy" in the library, sometimes the
students are not allowed to directly search and retrieve their own books that we want from the shelves, but
we ask for the book to the officers, of course by giving a number or code book, and then the officer who
will find and fetch the book. In the case above, the librarian has been acting as an intermediary or proxy.
Officers are also able to ensure and maintain for example, that students can only borrow books for
students, faculty may borrow books all the books, or the general public is only allowed to borrow a
Maybe the process of installation ubuntu proxy is longer than if we directly search and retrieve
their own books we want. But if only every time officers locate and retrieve a book for someone, the
officer also made several copies of the book before giving his book to those who ask, and keep it on the
table service, so if there are others who ask for specific books, is very likely The requested book is
available a copy of it on the table, and the clerk gave it to stay straight. The result is faster service and
well as good security.
This article will explain step by step setup Ubuntu Proxy server using Squid under Linux Ubuntu
1. Installation Squid
First of all first install squid via synaptic or via the linux command prompt / console / Terminal with:
# Sudo apt-get install squid
Once completed then Squid can be configured directly by:
# Sudo vi / etc / squid / squid.conf
But before the first edit the original file for backup if damaged can be returned to the default:
# Sudo cp / etc / squid / squid.conf / etc / squid / squid.conf.bak
2. Configuring Squid proxy Ubuntu
Furthermore Squid configuration script:
# Sudo vi / etc / squid / squid.conf
Squid configuration file will appear very long, following the steps that must be considered ....
a. HTTP Port: A port used to run Squid
b. Visible Host Name: So that if an error occurs Squid can find a valid hostname
localhost can be replaced with the IP (eg 192.168.0.254) or domains such as proxy.anu.com
c. Cache Manager: To define the email address of the Squid Cache Manager
d. Directory Cache Squid: Squid directory Defining the location and magnitude.
Figures 500 show directory size in MB
Figures 16 shows the number of sub-directory level 1
Figures 256 show the number of subdirectories subdirectory level 2 from level 1
The number above the higher the better
cache_dir ufs / var / spool / squid 500 16 256
e. Filtering: This is an important part of the Squid, by this we can mngatur rule-rule, from anyone who
can access the Internet through websites what is allowed to be accessed.
Access List: Who can access the Internet
access acl src 192.168.0.1/255.255.255.255
acl: an access list command
Access: the user name that has the IP or group
src: source ip is in use, can use a range if you want to make group
acl group-it src 192.168.0.1-192.168.0.12/255.255.255.255
Time Filtering: Provides access permission based on the time and day
acl-time access time MTWHFA 08:00 to 16:00
acl: access list command
time-access: caption for command acl
time: Squid command to define the time
MTWHFA: Squid is a command to define the time M: Monday, T: Tuesday, etc ... ..
08:00 to 16:00: It is time that is allowed to provide Internet access to users
Website Filtering: Filter any websites that should not be accessed by users.
Previously must be made before a document that contains the url-list list will diblock, with the command :
# Sudo vi / etc / squid / pornourl.txt
then fill with:
Then give the command squid squid.conf file with the command:
acl blokporno dstdomain "/ etc / squid / pornourl.txt"
Keyword Filtering: Filter keywords that are entered by the user, eg user enters the word 'mem3k' in
google then Squid will block it.
Before you add a command in the squid.conf, we must create a file containing those keywords on Ubuntu
Proxy server will be blocked with the command:
# Sudo vi / etc / squid / keywordblock.txt
Then fill with words that will be on the block:
mem3k, pel3r, nen3n, etc...
And give commands in squid.conf with the command:
url_regex keywordblok acl-i "/ etc / squid / keywordblock.txt"
The commands filter is enough to make a simple Server Squid,
Furthermore, granting access to the rules that have been made previously. In Squid Ubuntu Proxy server
command called http_access. The syntax is as follows:
blokporno # http_access deny to deny all the urls contained in acl blokporno
keywordblock # http_access deny to deny keywords that exist on acl keywordblock
http_access time I access # Allow acl acl-time access to user I
http_access deny all # Men-deny all users who are not registered in squid.conf
http_reply_access allow all # default
icp_access allow all # default
Then do not forget to save the configuration file squid.conf edited using the command:
: Wq # w: save q: out (Command vi)
Then in the terminal command you typed the command;
# Sudo squid-z
Function: to create a cache directory that we created at the command squid.
Free Share this tutorial only for non commercial purpose.