stayinside

Creating a hidden service for amusewiki

      Installing Tor

      Configure Tor

      Add hidden service url to amusewiki

Installing Tor

Install tor via the package manager, for example:

On Debian-based operating systems you can install Tor by running (as a superuser)

# apt-get install tor

For other operating systems refer or if you wish to use The Tor Project's repository check their guide.

Configure Tor

To configure your Tor hidden service, edit /etc/torrc and add the lines:

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80

Load Tor, enable auto-start, and get your new onion domain.

# service tor start && service tor enable
# cat /var/lib/tor/hidden_service/hostname
{your-domain}.onion

If the hostname file doesn't exist wait a few seconds and try again.

Add hidden service url to amusewiki

Login to the web interface and navigate to the Restricted configuration variables page.

Check the box next to "Do not redirect aliases to canonical"

Under Virtual hosts, one per line, add {your-domain}.onion

In the "Additional nginx configuration" box:

   add_header Onion-Location http://{your-domain}.onion$request_uri;

for automatic redirection to the onion service.

Under the SSL Configuration make sure "The generate webserver configuration will redirect all the HTTP requests to HTTPS" is unchecked.

Your onion domain should now be working. Make sure you use relative paths for local links in order to avoid redirection.