Installation
You need to be system administrator in order to perform this task. tinyproxy is available from the Ubuntu repository, so we can use apt-get to download and install the package for us.
cgirl@cgirl-Satellite-T135D:~$ sudo apt-get install tinyproxy
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
tinyproxy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/61.6 kB of archives.
After this operation, 270 kB of additional disk space will be used.
Selecting previously deselected package tinyproxy.
(Reading database ... 252120 files and directories currently installed.)
Unpacking tinyproxy (from .../tinyproxy_1.8.2-2_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up tinyproxy (1.8.2-2) ...
Starting tinyproxy: tinyproxy.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
tinyproxy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/61.6 kB of archives.
After this operation, 270 kB of additional disk space will be used.
Selecting previously deselected package tinyproxy.
(Reading database ... 252120 files and directories currently installed.)
Unpacking tinyproxy (from .../tinyproxy_1.8.2-2_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up tinyproxy (1.8.2-2) ...
Starting tinyproxy: tinyproxy.
Feel free to skip this section(and jump to the Configuring tinyproxy section below) if you are looking to install and not worry about any technical details. Being somewhat new to the Ubuntu world, these were my observations that I found informative and interesting, which is why I am including them here.
From the last line of the installation log, it is clear that tinyproxy is installed as a service and has been started up right after installation.
cgirl@cgirl-Satellite-T135D:/etc/init.d$ cd /etc/init.d
cgirl@cgirl-Satellite-T135D:/etc/init.d$ ls -l tinyproxy
-rwxr-xr-x 1 root root 2041 2010-03-22 10:46 tinyproxy
-rwxr-xr-x 1 root root 2041 2010-03-22 10:46 tinyproxy
cgirl@cgirl-Satellite-T135D:/etc/init.d$
The installation seems to make no entries in the /etc/init and /etc/default folders.
According to Ubuntu documentation,
/etc/init.d is where all the traditional sysvinit
scripts and the backward compatible scripts for upstart live. The
backward compatible scripts basically run service myservice start instead of doing anything themselves. Some just show a notice to use the "service" command
Here are a few selected lines from the tinyproxy script.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
CONFIG=/etc/tinyproxy.conf
DAEMON=/usr/sbin/tinyproxy
DESC=tinyproxy
FLAGS=
NAME=tinyproxy
CONFIG=/etc/tinyproxy.conf
DAEMON=/usr/sbin/tinyproxy
DESC=tinyproxy
FLAGS=
NAME=tinyproxy
The DAEMON line tells us where the executable actually sits.
cgirl@cgirl-Satellite-T135D:/usr/sbin$ ls -l tinyproxy
-rwxr-xr-x 1 root root 77632 2011-04-30 17:27 tinyproxy
-rwxr-xr-x 1 root root 77632 2011-04-30 17:27 tinyproxy
The CONFIG line points us to the configuration file that drives how tinyproxy behaves. See below for details about configuring tinyproxy to meet your needs.
Configuring tinyproxy
The file /etc/tinyproxy.conf is the tinyproxy configuration file that needs to be edited to suit your needs. Here are a few selected lines from the configuration file.
Port 8888 - This is the port that tinyproxy will listen on for incoming requests. Any browser or program that needs to use the proxy needs to refer to this port.
Logfile "/var/log/tinyproxy/tinyproxy.log" - The log file that you can use to check if tinyproxy is working correctly.
#Filter "/etc/filter" - The filter file location. This line is commented out by default, so nothing is filtered if left like that. Also read the FilterDefaultDeny line explained below.
#FilterDefaultDeny Yes - This line actually commented out by default and if left like that, defaults to No. This means that tinyproxy functions in "blacklist mode" ie., any request will be allowed as long as the URL/domain is not on the filtered list. If you uncomment this line (set the option to Yes), then tinyproxy will function in "whitelist mode" ie., any domain/URL that will be allowed needs to be specified explicitly in the filter file.
There are, of course, several other settings in the configuration file, these only list the ones that I specifically found relevant and/or changed for my needs.
Restarting tinyproxy
Once the configuration file and filter files have been setup, tinyproxy needs to be restarted as follows for the changes to take effect.
Restarting tinyproxy
Once the configuration file and filter files have been setup, tinyproxy needs to be restarted as follows for the changes to take effect.
cgirl@cgirl-Satellite-T135D:~$ sudo service tinyproxy restart
Restarting tinyproxy: tinyproxy.
Restarting tinyproxy: tinyproxy.
cgirl@cgirl-Satellite-T135D:~$
No comments:
Post a Comment