Tor-Hidden-Service-Setup
OS : MacOSX Sierra 10.12.2
Apache : 2.4.23
Download the MacPort.pkg
From https://github.com/macports/macports-base/releases/download/v2.4.0/MacPorts-2.4.0-10.12-Sierra.pkg
Install , it may install under /opt/local/bin/
sudo port install tor
cd /Users/{Your-home-name}
mkdir hidden-service
sudo chmod 700 hidden-service # You can't give the folder too permissive
After install tor
/usr/local/ect/tor/ has torrc.sample
Modify it!
sudo cp torrc.sample torrc
sudo vim torrc
Insert the following to torrc
SocksPort 9050 # You have to open this port!
SockListenAddress 127.0.0.1
HiddenServiceDir /Users/{Your-home-name}/hidden-service/ # Absolute path
HiddenServicePort 80 127.0.0.1:80 # first port : for tor, second port : for your server
sudo vim /etc/apache2/httpd.conf
ServerName {your onion address}
# ex : jn4nshpywumoda7s.onion:80
sudo vim /etc/pf.conf
Insert following
pass in proto tcp from any to any port 9050 # open port 9050
sudo pfctl -vnf /ect/pf.conf
Use console, run tor
It will generate the private key file and onion url file
in the hidden-service/
sudo apachectl start
Connect to the onion url in the hidden-service/hostname/