THIS GUIDE IS INCOMPLETE, PLEASE USE THE TOR VESTACP GUIDE FOUND HERE.
The following guide is a simplified version of various “onion site guides” that are currently available. Guides from 2014 and 2015 seem to be quite lacking in substance and some use apache, phpmyadmin
This guide was written to make a tor version of a clearnet website that I operate so that tor users can access the website via tor. First a small foreword to explain the tools being used in this guide:
- Nginx in a highly flexible and architecturally secure web server that will display web pages to your visitors. If you put an .html file in the folder that nginx shows to the internet, people will see that file.
- Fail2ban is a program that bans IPs that try to connect to your server (the IP address). It is usually the first program you should install on any server because if you leave a new server on without fail2ban, even overnight, someone may already have your root password. On CentOS 7 it will tell you how many people have tried to log in since you last logged in.
user@hostname:~$ ssh root@123.123.123.123
Last failed login: Wed Oct 12 18:51:02 UTC 2016 from 32.11.23.32 on ssh:notty
There were 21211 failed login attempts since the last successful login.
Last login: Sun Oct 5 13:00:11 2016 from 59.34.59.34
yum update -y
# add epel repository if not already there
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
rpm -ivh epel-release-7-8.noarch.rpm
yum install sudo -y
adduser nginx
passwd nginx
echo "%nginx ALL=(ALL:ALL) ALL" >> /etc/sudoers
su nginx
# update, install nginx, fail2ban and tor
sudo yum update -y
sudo yum install nginx -y
sudo yum install fail2ban -y
sudo yum install tor -y
exit
# start nginx
service nginx start
# remove torrc default file and make a new one with the following
rm -f /etc/tor/torrc
echo “HiddenServiceDir /var/lib/tor/hidden_service/” >> /etc/tor/torrc
echo “HiddenServicePort 80 127.0.0.1:80” >> /etc/tor/torrc
# start tor
service tor start
# show onion address
cat /var/lib/tor/hidden_service/hostname
You should turn off clearnet browsing by editing the following:
vi /etc/nginx/nginx.conf
Change:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
TO:
server {
listen 127.0.0.1:80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
Create files for your website in here:
cd /usr/share/nginx/html/
For custom .onion URLs:
Follow this guide and then edit the following:
cd /var/lib/tor/hidden_service/
Replace hostname with your custom hostname:
vi hostname
Replace private_key with your new private key:
vi private_key
They should both be owned by toranon and both be chmod 600.
chmod 600 hostname
chmod 600 private_key
chown toranon:toranon -R *
service tor stop
service tor start
Privet
Instead of fail2ban, I block the port 22 to everyone except my IP. The only bad thing about this, is because when my IP changes, I have to update the rule at the firewall, but the advantage is fail2ban will not consume my server RAM / CPU.
Are you curious to know what the dark web is? What is hidden in the deep Internet? Go!
Download TOR browser and visit TOR sites directory
TOR browser – https://www.torproject.org/download/
TOR sites directory – http://torwiki.biz/