Quick Tor and HTTP proxy setup on Ubuntu server

How to quick install and setup Tor with HTTP proxy on your Ubuntu server. Posted on April 20, 2016

First we need to install tor itself and privoxy:

sudo apt-get install tor privoxy

Then update configuration file for privoxy sudo vim /etc/privoxy/config.

forward-socks5t / .
listen-address your_host_name:8118

Check if it works correct:

$ nc your_host_name 8118
HTTP/1.1 400 Invalid header received from client
Proxy-Agent: Privoxy 3.0.21
Content-Type: text/plain
Connection: close

Invalid header received from client.

Check if tor is running:

$ nc localhost 9050
HTTP/1.0 501 Tor is not an HTTP Proxy
Content-Type: text/html; charset=iso-8859-1

Simple ruby script to check your new IP address via our new HTTP proxy:

require 'open-uri'
puts open('http://myip.ru/index_small.php', proxy: URI.parse("http://your_server_name:8118")).read

Almost done.

February 24, 2016
Functional Swift
July 18, 2016
Swift string regex