User:Pedro Sá Couto/Prototyping 5th/Flask App/NGINX into TOR server

From XPUB & Lens-Based wiki

TOR CONFIG

01 Apt file configuration

$ cd /etc/apt
$ sudo nano sources.list

02 Add 2 lines at the end of sources.list

deb https://deb.torproject.org/torproject.org buster main
deb-src https://deb.torproject.org/torproject.org buster main

03 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 -

04 Install Tor

$ apt install tor
$ ps aux | grep tor

05 Edit /etc/tor/torrc/

$ cd /etc/tor
$ sudo nano torrc
In the section about hidden services, add:
    # <name> site
        HiddenServiceDir /var/lib/tor/partyvan/
        HiddenServicePort 80 127.0.0.1:80

06 Restart Tor

$ service tor restart

07 Check Tor hostname

$ cd /var/lib/tor/<name>/
$ cat hostname

08 Hide Nginx Version

$ cd /etc/nginx
Uncomment
server_tokens off;

08 Onion only serving

$ sudo nano /etc/nginx/sites-available/<name>
replace listen 80; with
listen 127.0.0.1:80;




AYMERIC'S GUIDE TO TOR

https://things.bleu255.com/runyourown/Static_Website_as_Tor_Hidden_Service_on_Raspberry_Pi