PDA

View Full Version : Tutorial on how to host HTML webpage under own Tor hidden service address



Fli
11-25-2015, 12:27 PM
When one want to have STATIC(HTML only) anonymous website on Tor network (myaddress.onion), one can get an 128MB RAM VPS with Debian 6 or 7 Linux OS (http://instantcpanelhosting.com/cart.php?gid=4)

-- If one want DYNAMIC (PHP, MYSQL) website on Tor, then follow this other tutorial (https://internetlifeforum.com/linux-forums/4322-how-install-own-tor-hidden-website-centos/).

STATIC TOR SITE TUTORIAL continues:

(bold text are Linux commands, do them as a root or do command su to gain root privileges)

Add Tor project resources into Debian:

echo "deb http://deb.torproject.org/torproject.org wheezy main" >> /etc/apt/sources.list && echo "deb-src http://deb.torproject.org/torproject.org wheezy main" >> /etc/apt/sources.list && gpg --keyserver keys.gnupg.net --recv 886DDD89 && gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -

Install Tor & Nginx webserver:

apt-get update -y && apt-get install nginx tor deb.torproject.org-keyring -y && update-rc.d tor defaults && update-rc.d nginx defaults

Disable current Tor configuration(!) and create brand new new Tor configuration file:

mv /etc/tor/torrc /etc/tor/torrc-old && echo "DataDirectory /var/lib/tor
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80" >> /etc/tor/torrc && echo "Reload Tor to apply config. changes:" && service tor reload

Create www directory & index file for the hidden service website & Set permissions for www folders:

mkdir -p /var/www/hidden_service/ && echo "This is file /var/www/hidden_service/index.html. You can edit it / upload website into /var/www/hidden_service/" > /var/www/hidden_service/index.html && chown -R www-data:www-data /var/www/hidden_service/ && chmod 755 /var/www

Setup hidden service Nginx configuration:

echo "server {
listen 127.0.0.1:80;

root /var/www/hidden_service/;
index index.html index.htm;
server_name $(cat /var/lib/tor/hidden_service/hostname);
}" >> /etc/nginx/sites-available/hidden_service && echo "" && echo "Your Tor hidden service address is: $(cat /var/lib/tor/hidden_service/hostname)" && ln -s /etc/nginx/sites-available/hidden_service /etc/nginx/sites-enabled/hidden_service

The last command shown Your Tor hidden service address (it is in file /var/lib/tor/hidden_service/hostname)
So open that address via Tor browser

------