How is it that I can host multiple (static) hidden services on one server? I am just needing 3 simple and static HTML sites with their own .onion? If I add multiple HiddenServiceDir do they have to be on different ports or can they be on the same? There will not be a large amount of traffic going to the hidden services.
1 Answer
Yes, you can host multiple hidden services on the same server. Your torrc file should have this content added for each site -:
HiddenServiceDir /var/lib/tor/hidden_service1
HiddenServicePort 80 127.0.0.1:80
HiddenServiceDir /var/lib/tor/hidden_service2
HiddenServicePort 80 127.0.0.1:80
In case of ubuntu or debian if you are using apache2 add the following lines to your /etc/apache2/site-available/00-default.conf file -:
<VirtualHost *:80>
ServerName yourhiddenservice1domain.onion
DocumentRoot /var/www/html/firstsite
</VirtualHost>
<VirtualHost *:80>
ServerName yourhiddenservice2domain.onion
DocumentRoot /var/www/html/secondsite
</VirtualHost>
And you are done!
HiddenServiceDir
andHiddenServicePort
lines. They can run either on the same port or different ports depending on how you have your web server set up. For example: tor.stackexchange.com/questions/12324/…