Squid on Ubuntu 14
Installation :-
At a terminal prompt, enter the following command to install the Squid server:
first of all check Ubuntu package is update
first of all check Ubuntu package is update
in my Ubuntu squid already install thats why they can show that message but in fresh installation it can show installation message.
Squid Start at Boot?
$ sudo initctl show-config squid3
Configuration
Squid is configured by editing the directives contained within the /etc/squid3/squid.conf
configuration file.Make this copy
and protect it from writing using the following commands:
$ sudo cp /etc/squid3/squid.conf /etc/squid3/squid.conf.original
$ sudo chmod a-w /etc/squid3/squid.conf.original
Open the squid3 configuration file bye using any text editor such as vi or gedit
$ sudo vi /etc/squid3/squid.conf
1. Default Squid server listen port is
2. Change visible hostname
Change the visible_hostname directive in order to give the Squid server a specific hostname. This hostname
does not necessarily need to be the computer's hostname. In this example it is set to
visible_hostname proxy15
3. Local LAN Setting
Using Squid's access control, you may configure Squid
to be available only users with certain IP addresses. For example, we will illustrate access
by users of the 192.168.0.0/24 subnetwork only:
Add the following to the bottom of the ACL section of your /etc/squid3/squid.conf file:
acl mits_network src 192.168.0.0/24
Then, add the following to the top of the http_access section of your
/etc/squid3/squid.conf file:
http_access allow mits_network
4. website control (if required)
This is a beauty of squid we can block some website in our LAN through some setting on our squid.conf file such as
make a file in /etc/squid3 directory
$ sudo vi /etc/squid3/blocksites.acl
fill the site name such as .facebook . youtube and u wont to blok some other like .sex tag .porn u can also mentioned
$ sudo gedit /etc/squid3/squid.conf
add this line :- acl blk url_regex "/etc/squid3/blocksites.acl"
after that block that acl and allow your network
http_access deny blk
http_access allow mits_network
5. Internet Timing Control (if required )
Add the following to the bottom of the ACL section of your /etc/squid3/squid.conf file:
acl mits_hours time M T W T F 9:00-17:00
Then, add the following to the top of the http_access section of your /etc/squid3/squid.conf file:
http_access allow mits_network mits_hours
After making changes to the /etc/squid3/squid.conf file, save the file and restart the squid
server application to effect the changes using the following command entered at a terminal prompt:
Squid start
$ sudo service squid3 start
No comments:
Post a Comment