Raspberry Pi as tor2web service running apache

Hey,

In this article I will describe how to set up a Raspberry Pi, install tor and access it using tor2web.

Start by installing RASPBIAN JESSIE LITE (Minimal image based on Debian Jessie) from the raspberry pi web . I will be using this version:

Version:November 2015
Release date:2015-11-21
Kernel version:4.1

I will walk you through everything until you have a raspberry pi online with a hidden tor2web url that you can access from anywhere.

1 – Change root password
The default password is “raspberry” and user is “pi”. Make sure you change this.

2 – Updating the Pi
Once you have connected the Pi to the network make sure you update it.

apt-get update -y; apt-get upgrade -y

3 – Installing apache2

I will refer to Raspberry Pi documentation for how to install apache.
We will also configure it to only listen on localhost, as we do not need it to listen on the public interface, we will only have ssh there. This is also they way tor hidden services work, but more on that later!

This is optional. Install php, mysql and php-pdo

4 – Configure apache
We only want it to listen on localhost because we want to use it on tor. So let’s change that. Modify the file /etc/apache2/ports.conf so that it looks like this. Make sure the line is changed from “Listen 80” to “Listen 127.0.0.1:8080”.

5 – Installing tor

6 – Configure tor
We will now create the directories and configure the hidden service. If you want to read more check the reference documentation here

Edit the file /etc/tor/torrc

Time to start, “service tor start”

Your hostname will now be visible in this file:

Your website will now be available by accessing a url such as

https://xxxxxxxxxxxxxxx.onion.to/

Replace the x’s with your hostname found in the hostname file. This works because of the “.to” that is added to the onion domain. More information here https://tor2web.org/

To make tor start on boot, enter the following command

References and additional reading

  • http://httpd.apache.org/docs/2.4/ssl/ssl_howto.html
  • https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04
  • https://www.torproject.org/docs/tor-hidden-service.html.en
  • https://www.torproject.org/docs/debian.html.en
  • https://tor2web.org/
  • Leave a Reply

    Your email address will not be published. Required fields are marked *