These article will discuss about how to install proxy server using Squid
(2.7STABLE9) in Linux Slackware 12.2.
First, check harddrive partition which will be used for Squid cache partition.
Create some partition on that harddrive. For assumption, you will use harddrive
which have been mounted on /dev/sdb. That harddrive then divided to 4 section.
You need to format those partitions. Before do that, you must ensure those
partitions not in active state.
Then, format those partitions with partition tool on Linux, such as fdisk and
cfdisk. In this example, I will use cfdisk.
Change its partition filesystem to ReiserFS filesystem.
Repeat that step for three other partition.
Make 4 directory in root called cache1, cache2, cache3 and cache4 respectively
which will be used for cache engine directory.
Edit filesystem table in /etc/fstab. This have purpose to save change which have
been done for cache partition so they can be used when computer boot. Add the
Mount all of those partition.
then all of those partition will be mounted on /cache1, /cache2, /cache3 and
Create new user and group which will be used by Squid daemon.
This Squid user will be used for setting up permission on cache directories you
have been created before.
Change settings for file descriptor on Linux Slackware. Variable which will need
to be changed is on FD_SETSIZE in file /usr/include/linux/posix_types.h
(Slackware 12.2). Edit this file and search for following lines:
Then use following commands:
After all prerequisites have been fullfiled, then it is time to download Squid
source code. You will compile and install from its source code.
It source code can be obtained from its official website in
For assumption, I use version squid-2.7STABLE7.
Before compile its source code, you need to find a variable (I called it xyz
variable) which will be used to compile it. These variable is obtained from
processor specification. You can check it with commands:
From that output, the number you need to use is on the cpu MHz section. In that
example, the number is 2699 and I will be rounded to 2700.
The formula I use:
Then from the previous number, variable xyz you can get:
Compile the Squid source code which following prefix and don’t forget to change
variable xyz with previous number:
After compiling process success, then install with:
If there are not appear an error message, then Squid have been successfully
installed on your system.
Do some tune up on Squid configuration. Edit file /etc/squid/squid.conf. Make
some adaptation for network in access list options (acl).
For transparent proxy mode, you need to add the following line:
Make Squid log file and set this permission:
Afterall, run Squid commands:
Check whether Squid have been running with nmap command.
Or you can look on the cache.log file you have been created before.
If the results is same as the following example, the Squid Proxy ready to serve.
Add the following commands in order to run Squid whenever the Linux machine
reboot. Edit file /etc/rc.d/rc.local.