Difference between revisions of "Static Website as Tor Hidden Service on Raspberry Pi"

From Run Your Own
Jump to: navigation, search
(Local HTTP server)
(Tor setup)
Line 31: Line 31:
  
 
== Tor setup ==
 
== Tor setup ==
 +
'''Note:''' This is only valid for RPi2 and later.
 +
* Add the [https://2019.www.torproject.org/docs/debian.html.en Tor deb repos] to <code>/etc/apt/sources.list</code>. At time of writing, stable Raspbian is based on Buster:
 +
deb https://deb.torproject.org/torproject.org buster main
 +
deb-src https://deb.torproject.org/torproject.org buster main
 +
* Add the GPG keys used to sign the packages from the Tor repos:
 +
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import
 +
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
 +
* Install Tor
 +
apt install tor deb.torproject.org-keyring
 +
  
 
[[Category: Raspberry Pi]]
 
[[Category: Raspberry Pi]]

Revision as of 22:39, 7 March 2020

blablabla

Local HTTP server

as root:

  • Install nginx on the RPi
apt install nginx
  • In the browser from another computer on the network, check that you the default HTML page is properly served at: http://192.168.1.XXX (you should see a small "Welcome to nginx!" text).
  • create a non-default mini static website:
mkdir /var/www/partyvan
echo "OHAI" > /var/www/partyvan/index.html
  • disable nginx default site
rm /etc/nginx/sites-enabled/default
  • create new nginx site config /etc/nginx/sites-available/partyvan with:
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/partyvan;
    index index.html;

    server_name partyvan;

    location / {
        try_files $uri $uri/ =404;
    }
}
  • Enable site
ln -s /etc/nginx/sites-available/partyvan /etc/nginx/sites-enabled/
service nginx reload
  • In the browser from another computer on the network, check that you the default HTML page is properly served: http://192.168.1.XXX (you should see a small "OHAI" text).

Tor setup

Note: This is only valid for RPi2 and later.

  • Add the Tor deb repos to /etc/apt/sources.list. At time of writing, stable Raspbian is based on Buster:
deb https://deb.torproject.org/torproject.org buster main
deb-src https://deb.torproject.org/torproject.org buster main
  • Add the GPG keys used to sign the packages from the Tor repos:
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
  • Install Tor
apt install tor deb.torproject.org-keyring