Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (64 sloc) 3.616 kB
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>tor2web: how to run a proxy</title>
</head>
<body><div class="header">
<h1><a href="/">tor2web</a>: how to run a proxy</h1>
</div><div class="body">
<p>Want to set up a proxy of your own? Here's how! For simplicity, we'll assume you're running a recent version of Ubuntu, but the instructions should be easy to adapt to any other OS. (Don't have a server? You can get one using Amazon's EC2 with <a href="http://alestic.com/">Ubuntu AMIs</a>.)</p>
<pre>
# Install the latest version of tor, with the tor2web flag
sudo apt-get install python-software-properties
sudo apt-add-repository http://deb.torproject.org/torproject.org
gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt-get update
sudo apt-get install deb.torproject.org-keyring dpkg-dev autoconf
sudo apt-get build-dep tor
git clone git://git.torproject.org/debian/tor.git
cd tor
curl https://trac.torproject.org/projects/tor/raw-attachment/ticket/2553/0001-Add-support-for-an-enable-tor2web-mode-DEB_BUILD_OPT.patch | patch -p 1
./autogen.sh
echo "all:" > src/test/Makefile
echo "check:" >> src/test/Makefile
echo "install:" >> src/test/Makefile
DEB_BUILD_OPTIONS="enable-tor2web-mode" fakeroot debian/rules binary
cd ..
sudo dpkg -i tor_0.2.3.12-alpha-1_amd64.deb
# (this will return an error, ignore it)
sudo sh -c "echo Tor2webMode 1 >> /etc/tor/torrc"
sudo /etc/init.d/tor restart
# Install privoxy to translate normal web requests to SOCKS, which Tor speaks:
sudo apt-get install privoxy
sudo sh -c "curl <a href="/conf/privoxy-config">http://tor2web.org/conf/privoxy-config</a> > /etc/privoxy/config"
sudo /etc/init.d/privoxy restart
# Install Apache to serve web requests
sudo apt-get install apache2
sudo sh -c "curl <a href="/conf/apache2.conf">http://tor2web.org/conf/apache2.conf</a> > /etc/apache2/apache2.conf"
sudo sh -c "curl http://tor2web.org/conf/tor2web.org-ss.crt > /etc/apache2/tor2web.org.crt"
sudo sh -c "curl http://tor2web.org/conf/tor2web.org-ss.key > /etc/apache2/tor2web.org.key"
# Make the cache directory (edit apache2.conf if you want this somewhere else)
sudo mkdir /mnt/apache2-cache
sudo chown www-data /mnt/apache2-cache
sudo /etc/init.d/apache2 restart
</pre>
<p>To debug, you can check the individual components to make sure they work:</p>
<pre>
# Tor
curl -i --socks4a 127.0.0.1:9050 http://duskgytldkxiuqc6.onion/
# privoxy
curl -x 127.0.0.1:8118 http://duskgytldkxiuqc6.onion/
# Apache
curl -k -H "Pragma: none" -H "Host: duskgytldkxiuqc6.tor2web.org" -i https://127.0.0.1/
# run again to see if it serves from cache:
curl -k -H "Pragma: none" -H "Host: duskgytldkxiuqc6.tor2web.org" -i https://127.0.0.1/
</pre>
<p>That's it!</p>
<p>Send your IP address to <a href="mailto:info@tor2web.org">info@tor2web.org</a> and ask to be added to the <code>*.tor2web.org</code> round-robin. This will allow your server to respond to requests from the public for Tor hidden services. (We'll also send you the real SSL keys; the ones above are only for testing purposes.)</p>
<p>If you have trouble with the process or would like a different way of doing it, let me know. If you want to build scripts or tools to simplify this process, that would be great too. You might also be interested in <a href="https://www.torproject.org/docs/tor-doc-relay.html.en">running a Tor relay</a>.</p>
<p><strong>See also:</strong> <a href="legal">Is this legal?</a></p>
</div>
<address><a href="mailto:info@tor2web.org">info@tor2web.org</a></address>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.