Many people are wondering how to transfer the project to the torus network.
If you do not know why you need to transfer your project to the .onion domain, this post is definitely not for you. For others, it may come in handy someday.
Setting up a web server for your project makes no sense to describe, it is assumed that you have a server with a working project. Suppose your site lies in the directory /var/www/site and the web server looks at the world on port 80.
The direct setting of TOR is its installation and addition to the configuration of 2 lines.
$ sudo apt-get install tor Open /etc/tor/torrc:
We will recommend the following lines:
HiddenServiceDir /var/lib/tor/hidden_service/ HiddenServicePort 80 127.0.0.1:80
$ sudo /etc/init.d/tor restart
The private_key will be followed by a string:
As long as you are the sole owner of this file, your domain is secure.
If you clear the directory
from the key, then the next time you restart TOR will generate a new key with a new random onion address.
Your domain will be generated based on the private_key hash and displayed in the hostname file of /var/lib/tor/hidden_service/ directory.
HiddenServicePort 80 127.0.0.1:80 sets the port of the onion-resource and what address and port we redirect to it. We take address/port 127.0.0.1:80 and forward it to pigf5k6563fufj2fhdj83s5z.onion:80.
If there’s not enough sites, we’ll add them to the config:
HiddenServiceDir /var/lib/tor/hidden_service1/ HiddenServicePort 80 127.0.0.1:81 HiddenServiceDir /var/lib/tor/hidden_service2/ HiddenServicePort 80 127.0.0.1:82
restart TOR, and then the keys are created in the corresponding directories.
Remember that you should not pay money – if you can do it yourself!