visit
For help, if you get stuck, look at the Note at the bottom of this post.
This tutorial is specifically aimed for Unix users but anyone can follow this in all honesty. Yeah, even the Windows users!👌🏻Alright, so, first of all, you wanna make sure that you have a web server up and running. You can use Apache2 but for better security and anonymity, I'd recommend that you use Nginx. It's pretty cool :PStep 1 - Setting up the Nginx server
To check for its installation, type
nginx
into the terminal. And head to localhost:8080
in your preferred web browser.If you don't have it installed, you can go ahead and install it using
brew install nginx
on your macOS or sudo apt-get install nginx
on your WSL or Linux distro with Debian packages.Once you have it installed, run it using
nginx
and head to the localhost:8080
in your browser. If it shows something similar to:Step 2 - Configuring the Nginx config file *( Optional )*
Let's say you are already hosting something on localhost:8080 and don't want to set up Nginx on that port, you'd want to change the Nginx config file in that case.arthtyagi@MacBook-Pro ~ % cd /usr/local/etc/nginx
arthtyagi@MacBook-Pro ~ % vim nginx.conf
84 #server {
85 # listen 8000;
86 # listen somename:8080;
87 # server_name somename alias another.alias;
88
89 # location / {
90 # root html;
91 # index index.html index.htm;
92 # }
93 #}
Step 3 - Serving static content
arthtyagi@MacBook-Pro ~ % cd /usr/local/var/www
arthtyagi@MacBook-Pro ~ % vim index.html
Step 4 - Serving on the Dark Web as a .onion site
First, you wanna make sure that you have
tor
installed on your system.Type in
tor
in your terminal, if it initiates a tor connection, you've got tor installed. Else, you might really wanna install it. Use brew install tor
to install tor on your macOS.For Debian/Ubuntu/WSL with Debian/Ubuntu refer to . Once you have made sure it's installed, move on to Step 5.Step 5 - Configuring the torrc
1. Head into the tor directory. For macOS, it's available here :arthtyagi@MacBook-Pro ~ % cd /usr/local/etc/tor
2. If you list the files present, you'll find that there is a file named
torrc.sample
present in the tor directory. Now you'd want to change `
torrc.sample
` to `torrc
`. You can do that by simply opening the `torrc.sample` in vim and using the vim command, :!mv torrc.sample torrc
.3. Edit the torrc file using
vim torrc
.Add these lines : HiddenServiceDir /usr/local/etc/tor/hidden_http_service/
HiddenServicePort 80 127.0.0.1:8080
Final Step: Run the Service
arthtyagi@MacBook-Pro ~ % tor
Your site is serving over Tor relay now. But where?arthtyagi@MacBookPro~% cat/usr/local/etc/tor/hidden_http_service/
Additional Step: Read into these
and options.NOTE :
1. To stop the Nginx server, use
sudo nginx -s stop
.2. To stop Tor, use
killall tor
.3. To save and exit in vim, use
:x
.4. For a nice Vim reference, visit .Either way, I'm glad you read this to the end ( hopefully lol ).