Now that you have a website, why not offer it on a private alternative such as the onion network?
Setting up Tor
Firstly we need to add the tor repo's to have the latest up to date version or tor.
apt install apt-transport-https
echo "deb https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/tor
echo "deb-src https://deb.torproject.org/torproject.org buster main" >> /etc/apt/sources.list.d/tor
Then we need to add the gpg keys to our keyring
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --importgpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -Now update and install tor
apt updateapt install tor deb.torproject.org-keyringThen edit the file
/etc/tor/torrc, uncommenting the following lines:HiddenServiceDir /var/lib/tor/hidden_service/ HiddenServicePort 80 127.0.0.1:80Now start and enable tor at boot
systemctl enable --now torIf the next command outputs
activein green you're golden!systemctl status torNow you're server is on the dark web. The following command will give you your onion address:
cat /var/lib/tor/hidden_service/hostnameAdding the Nginx Config
From here, the steps are almost identical to setting up a normal website configuration file. Follow the steps as if you were making a new website on the webserver tutorial up until the server block of code. Instead, paste this:
server { listen 127.0.0.1:80 ; root /var/www/landchad ; index index.html ; server_name your-onion-address.onion ; }From here we are almost done, all we have to do is enable the site and reload nginx which is also covered in the webserver tutorial.
Also make sure to update tor on a regular basis by running
apt updateContributor - tomfasano.xyzapt install tor