How to set up Apache as a Hidden Service

From PeerFreedom Wiki
Jump to navigation Jump to search

Contents

TOR

Run:

# apt install tor

Edit :

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

Restart TOR:

# systemctl restart tor.service

Get you hidden service address:

$ cat /var/lib/tor/example_hs/hostname

It should be something like this:

somethingsomethingsometingdarksidesomethingsomethingsomethingcomplete.onion

Apache

Run:

# apt install apache2

Edit /etc/apache2/sites-enabled/000-default.conf from:

<VirtualHost *:80>

to:

<VirtualHost *:80>
     ServerName somethingsomethingsometingdarksidesomethingsomethingsomethingcomplete.onion

And in /etc/apache2/ports.conf all instances of:

Listen XYZ

to:

Listen 127.0.0.1:XYZ

Then run:

# systemctl restart apache2.service