diyhosting/tor.html

96 lines
4.7 KiB
HTML
Raw Normal View History

2021-06-30 18:35:15 +00:00
<!DOCTYPE html>
<html lang=en>
<head>
<title>Mirror your site over tor</title>
<meta charset="utf-8"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel='stylesheet' type='text/css' href='style.css'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='alternate' type='application/rss+xml' title='Land Chad RSS' href='/rss.xml'>
</head>
<body>
2021-06-30 21:34:27 +00:00
<header><h1>Mirror Your Site Over Tor</h1></header>
2021-06-30 18:35:15 +00:00
<nav></nav>
<main>
2021-06-30 21:34:27 +00:00
<img class=titleimg src="pix/tor.svg" alt="Tor logo">
2021-06-30 19:05:22 +00:00
<p>
2021-06-30 18:35:15 +00:00
Now that you have a website, why not offer it on a private alternative such as the onion network?
</p>
<aside>
<a href="https://landchad.net" >LandChad.net</a> does not condone
any illegal activities or websites on the dark web nor the usage of
this tutorial to launch such sites.
</aside>
<h2>Setting up Tor</h2>
2021-07-01 07:10:05 +00:00
<p>Firstly we need to add the tor repo's to have the latest up to date version or tor.</p>
2021-07-01 07:15:11 +00:00
<pre><code>apt install apt-transport-https</code></pre>
2021-07-01 07:33:53 +00:00
<pre><code>echo "deb https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/tor</code></pre>
<pre><code>echo "deb-src https://deb.torproject.org/torproject.org buster main" >> /etc/apt/sources.list.d/tor</code></pre>
2021-07-01 07:10:05 +00:00
<p>Then we need to add the gpg keys to our keyring</p>
<pre><code>curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import</code></code>
<pre><code>gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -</code></code>
<p>Now update and install tor</p>
<pre><code>apt update</code></pre>
<pre><code>apt install tor deb.torproject.org-keyring</code></pre>
2021-06-30 18:35:15 +00:00
<p>Then edit the file <code>/etc/tor/torrc</code>, uncommenting the following lines:</p>
<pre><code> HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80</code></pre>
<aside>
<h4>Optional: Running multiple onion services</h4>
<p>If you want to forward multiple virtual ports for a single onion
service, just add more HiddenServicePort lines (replace the 80 with any unoccupied port).
</p>
<p>If you want to run multiple onion services from the same Tor client, just add another
HiddenServiceDir line.</p>
</aside>
<p>Now start and enable tor at boot</p>
2021-06-30 18:35:15 +00:00
<pre><code> systemctl enable --now tor </code></pre>
<p>If the next command outputs <q>active</q> in green you're golden!</p>
<pre><code> systemctl status tor</code></pre>
<p>Now you're server is on the dark web. The following command will give you your onion address:</p>
<pre><code> cat /var/lib/tor/hidden_service/hostname</code></pre>
<h2>Adding the Nginx Config</h2>
<p>
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
2021-06-30 19:47:19 +00:00
<a href="nginx.html">tutorial</a> up until the server block of code. Instead, paste this:
2021-06-30 18:35:15 +00:00
</p>
<pre><code> server {
listen 127.0.0.1:80 ;
root /var/www/<strong>landchad</strong> ;
index index.html ;
server_name <strong>your-onion-address</strong>.onion ;
}</code></pre>
<aside>
<h4>Clarification</h4>
<p>Nginx will listen on port 80 for your <em>server's</em> localhost.</p>
<p>The <code>root</code> line is the path to whichever website of yours you'd like to mirror.</p>
</aside>
<p>
2021-06-30 19:47:19 +00:00
From here we are almost done, all we have to do is enable the site and reload nginx which is also covered in <a href="nginx.html#enable">the webserver tutorial</a>.
2021-06-30 18:35:15 +00:00
</p>
2021-07-01 07:10:05 +00:00
<p> Also make sure to update tor on a regular basis by running</p>
<pre><code>apt update</code></pre>
<pre><code>apt install tor</code></pre>
2021-06-30 18:35:15 +00:00
<strong>Contributor</strong> - <a href="https://tomfasano.xyz" target="_blank">tomfasano.xyz</a>
</main>
<footer><a href="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><li><a href="index.html"><img src="pix/chad.gif" alt="chad"></a></li><li><a href="rss.xml"><img src="pix/rss.svg" alt="RSS"></a></li><li><a href="pix/btc.png"><img src="pix/btc.svg" alt="BTC"></a></li><li><a href="pix/xmr.png"><img src="pix/xmr.svg" alt="XMR"></a></li><li><a href="https://github.com/lukesmithxyz/landchad"><img src="pix/git.svg" alt="Github"></a></footer>
</body>
</html>