Introduction
This article demonstrates how to setup a TinyProxy proxy server on Ubuntu. The purposes of this proxy instance is to test client code targeting accessing web service via proxies and reading PAC file. The steps we took to get get to get to this point (the TinyProxy installer) are as follows (previous blog postings):
Setup and Configuration
1) To install, access the server on which tinyproxy is to be installed via ssh.
2) Execute the following command on the Ubuntu server via the terminal window:
sudo apt-get install tinyproxy
During install the terminal will generate output such as:
3) By invoking the following from the terminal we can determine current status of the newly installed tinyproxy:
service tinyproxy status
Invoking the previous command generates output such as the following:
From the previous screen we can see that the tinyproxy service is "active {running}" and is running as PID 71258.
4) To exit the status information simply type:
q
5) We need to change the configuration which is stored in a simple text file. In order to update the configuration file, the tinyproxy service must be stopped by invoking:
service tinyproxy stop
The output generated by this command is as follows:
6) To modify the configuration file associated with tinyprox, navigate to to /var/tiny/proxy
The ls invoked in the /etc/tinyproxy directory shows the configuration file for the service, tinyproxy.config.
7) Open tinyproxy.conf using vim (or editor of your choice) prefixed by sudo (only an administrator can edit the configuration file):
sudo vim tinyproxy.conf
The default contents of the the tinyproxy.cong file is as follows displayed in vim:
Notice above that the port for tinyproxy is set by default to 8888. Recall that the port we opened to access the Ubuntu server was 21777.
8) Delete the 8888 after the Port keyword and replace with a value of 21777:
9) Keep tinyproxy.config open in the editor because we need to modify the permission of our proxy server to allow any host to access tinyproxy.
10) Navigate down the configuration file util the "authorization controls" section has been reached.
Notice in the configuration file tinyproxy, tinyproxy.conf, that access is allowed to local host (IP address 127.0.0.1):
Place a # in front of the "Allow 127.0.0.1" line.:
There are now no explicit hosts permitted to access the tinyproxy instance. This means "allow access sne". This includes protocols HTTP and HTTPS.
12) Save the configuration file, tinyproxy.conf.
13) From the terminal invoke the following command to restart the tinyproxy service:
service start tinyproxy
The output generated by invoking this command is as follows:
Notice above that the user (administrator) credentials were required to be entered before the tinyproxy service started.
Verify Proxy is working using Extension Proxy SwitchyOmega
On a Windows system, the proxy settings can be se specified under Internet Explorer options. Using Chrome in conjunction with the Proxy SwitchyOmega allows extremely extensive proxy management.
To find the exertion for Chrome simply look up Proxy SwiticyOmega in any search engine. On google, the search term leads to the following screen:
The upper right corner of the web page contains a rather appropriate button:
Clicking on the "ADD TO CHROME" button disdfsplays the following:
From the previous dialog click on "Add extension":
When the Proxy SwitchyOmega extension is installed a series of tutorial screens are displayed (meaning you click on Next a lot). To break out of the tutorial wizard click on the X at the top right of the dialog.
Below notice that the extensions bar is displayed. The extension to the far right, marked by an icon that is a circle, is Proxy SwitchyOmega. Clicking on the circle icon displays the following:
At the bottom of the Proxy SwitchyOmega menu displayed above is the the Options menu item. Selecting on the Options menu items displays the following:
The previous screen allows the options to be managed for a proxy named, "proxy." To see more options selected "Show Advanced" which displays the following;
The IP address for the new installed tinyproxy service is 52.191.142.196. Using the advanced options below the server (52.191.142.196) and port (21777) can be assigned to both the HTTP and HTTPS protocols:
On the lower left is in the "Apply changes" option:
Click on "Apply changes" means the Tinyproxy proxy, is ready to us. Clicking on the extension icon the proxy options menu can be displayed for TwitchyOmega:
The menu items above includes "proxy." Recall that the configuration setup to point the tinyproxy proxy was named "proxy." By selecting the proxy named "proxy" TwitchyOmega will point all Chrome traffic for HTTP and HTTPS at the proxy server just configured.
Why not squid?
In addition to tinyproxy, the squid proxy, was researched as a potential proxy to setup. The proxy installed was not for a production environment. The proxy was to be used for development against HTTPS-based REST services. The reason tinyproxy was selected over squid, because tinyproxy was simpler to configure.