4

I am trying to run two or more hidden services. My torrc seems to be fine, but I am having trouble with lighttpd.conf.

My configuration file contains.

$HTTP["host"] == "2uwvt4.onion" {
  server.document-root  = "/var/www"
  server.port           = 8888
} else $HTTP["host"] == "6gkcdh.onion" {
  server.document-root  = "/var/www/2"
  server.port           = 7777
} else $HTTP["host"] =~ "" {
  server.port           = 110
  server.document-root  = "/var/www/default"
} 

I get the error that it is already bound to port 80, the port 80 is only mentioned once in torrc.

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

HiddenServiceDir /var/lib/tor/hidden_service/2/
HiddenServicePort 90 127.0.0.1:7777
mirimir
  • 3,017
  • 1
  • 19
  • 29
Tommy H.
  • 41
  • 1
  • 3

2 Answers2

1

This StackOverflow question has the key to the answer. In lighttpd.conf there should be something like this:

##
## Document root
##
server.document-root = server_root + "/HS1"
$SERVER["socket"] == ":8080" {
        server.document-root = server_root + "/HS2"
}

Then in torrc, there should be something like this:

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

HiddenServiceDir /var/lib/tor/HS2
HiddenServicePort 8080 127.0.0.1:8080
mirimir
  • 3,017
  • 1
  • 19
  • 29
0

You don't need to run them on separate port numbers; you can use host-based virtual-hosting with .onion domain names exactly as you would with clearnet domain names.

Having said that, if you're really paranoid about people discovering that the services are on the same server, you should use different port numbers.

Someone can connect to site1.onion and send a Host: header with site2.onion, and if the server replies as if it was site2.onion, then they will know they're hosted on the same server.