tor-doc-server.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  2. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  4. <head>
  5. <title>Tor Server Configuration Instructions</title>
  6. <meta name="Author" content="Roger Dingledine" />
  7. <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
  8. <link rel="stylesheet" type="text/css" href="stylesheet.css" />
  9. <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
  10. </head>
  11. <body>
  12. <!-- TITLE BAR & NAVIGATION -->
  13. <table class="banner" border="0" cellpadding="0" cellspacing="0">
  14. <tr>
  15. <td class="banner-left"></td>
  16. <td class="banner-middle">
  17. <a href="/">Home</a>
  18. <a href="/overview">Overview</a>
  19. <a href="/download">Download</a>
  20. <a href="/documentation">Docs</a>
  21. <a href="/volunteer">Volunteer</a>
  22. <a href="/people">People</a>
  23. <a href="/donate">Donate!</a>
  24. </td>
  25. <td class="banner-right"></td>
  26. </tr>
  27. </table>
  28. <!-- END TITLE BAR & NAVIGATION -->
  29. <div class="center">
  30. <div class="main-column">
  31. <p>
  32. This document is obsolete. See the new <a
  33. href="http://tor.eff.org/documentation">Tor documentation</a> page.
  34. </p>
  35. <h1>Configuring a <a href="http://tor.eff.org/">Tor</a> server</h1>
  36. <br />
  37. <p>
  38. The Tor network relies on volunteers to donate bandwidth. The more
  39. people who run servers, the faster the Tor network will be. If you have
  40. at least 20 kilobytes/s each way, please help out Tor by configuring your
  41. Tor to be a server too. We have many features that make Tor servers easy
  42. and convenient, including rate limiting for bandwidth, exit policies so
  43. you can limit your exposure to abuse complaints, and support for dynamic
  44. IP addresses.</p>
  45. <p>Having servers in many different places on the Internet is what
  46. makes Tor users secure. <a
  47. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#ServerAnonymity">You
  48. may also get stronger anonymity yourself</a>,
  49. since remote sites can't know whether connections originated at your
  50. computer or were relayed from others.</p>
  51. <p>Setting up a Tor server is easy and convenient:
  52. <ul>
  53. <li>Tor has built-in support for <a
  54. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#LimitBandwidth">rate
  55. limiting</a>. Further, if you have a fast link
  56. but want to limit the number of bytes per day
  57. (or week or month) that you donate, check out the <a
  58. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#Hibernation">hibernation
  59. feature</a>.
  60. </li>
  61. <li>Each Tor server has an <a
  62. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#RunAServerBut">exit
  63. policy</a> that specifies what sort of outbound connections are allowed
  64. or refused from that server. If you are uncomfortable allowing people
  65. to exit from your server, you can set it up to only allow connections
  66. to other Tor servers.
  67. </li>
  68. <li>It's fine if the server goes offline sometimes. The directories
  69. notice this quickly and stop advertising the server. Just try to make
  70. sure it's not too often, since connections using the server when it
  71. disconnects will break.
  72. </li>
  73. <li>We can handle servers with dynamic IPs just fine, as long as the
  74. server itself knows its IP. Have a look at this
  75. <a href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#DynamicIP">
  76. entry in the FAQ</a>.
  77. </li>
  78. <li>If your server is behind a NAT and it doesn't know its public
  79. IP (e.g. it has an IP of 192.168.x.y), you'll need to set up port
  80. forwarding. Forwarding TCP connections is system dependent but <a
  81. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#ServerForFirewalledCli
  82. ents">this FAQ entry</a> offers some examples on how to do this.
  83. </li>
  84. <li>Your server will passively estimate and advertise its recent
  85. bandwidth capacity, so high-bandwidth servers will attract more users than
  86. low-bandwidth ones. Therefore having low-bandwidth servers is useful too.
  87. </li>
  88. </ul>
  89. <p>You can run a Tor server on
  90. pretty much any operating system, but see <a
  91. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#ServerOS">this
  92. FAQ entry</a> for advice about which ones work best and other problems
  93. you might encounter.</p>
  94. <hr />
  95. <a id="zero"></a>
  96. <h2><a class="anchor" href="#zero">Step Zero: Download and Install Tor</a></h2>
  97. <br />
  98. <p>Before you start, you need to make sure that Tor is up and running.
  99. </p>
  100. <p>For Windows users, this means at least <a
  101. href="http://tor.eff.org/doc/tor-doc-win32.html#installing">step one</a>
  102. of the Windows Tor installation howto. Mac OS X users need to do at least
  103. <a href="http://tor.eff.org/doc/tor-doc-osx.html#installing">step one</a>
  104. of OS X Tor installation howto. Linux/BSD/Unix users should do at least
  105. <a href="http://tor.eff.org/doc/tor-doc-unix.html#installing">step one</a>
  106. of the Unix Tor installation howto.
  107. </p>
  108. <p>If it's convenient, you might also want to use it as a client for a
  109. while to make sure it's actually working.</p>
  110. <hr />
  111. <a id="one"></a>
  112. <h2><a class="anchor" href="#one">Step One: Set it up as a server</a></h2>
  113. <br />
  114. <p>
  115. 1. Verify that your clock is set correctly. If possible, synchronize
  116. your clock with public time servers.
  117. </p>
  118. <p>
  119. 2. Make sure name resolution works (that is, your computer can resolve addresses correctly).
  120. </p>
  121. <p>
  122. 3. Edit the bottom part of your torrc. (See <a
  123. href="http://wiki.noreply.org/wiki/TheOnionRouter/TorFAQ#torrc">this
  124. FAQ entry</a> for help.)
  125. Make sure to define at least Nickname and ORPort. Create the DataDirectory
  126. if necessary, and make sure it's owned by the user that will be running
  127. tor. <em>If you want to run more than one server that's great, but
  128. please set <a href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#MultipleServers">the
  129. MyFamily option</a> in all your servers' configuration files.</em>
  130. </p>
  131. <p>
  132. 4. If you are using a firewall, open a hole in your firewall so
  133. incoming connections can reach the ports you configured (ORPort, plus
  134. DirPort if you enabled it). Make sure you allow all outgoing connections,
  135. so your server can reach the other Tor servers.
  136. </p>
  137. <p>
  138. 5. Start your server: if you installed from source you can just
  139. run <tt>tor</tt>, whereas packages typically launch Tor from their
  140. initscripts or startup scripts. If it logs any warnings, address them. (By
  141. default Tor logs to stdout, but some packages log to <tt>/var/log/tor/</tt>
  142. instead. You can edit your torrc to configure log locations.)
  143. </p>
  144. <p>
  145. 6. Subscribe to the <a
  146. href="http://archives.seul.org/or/announce/">or-announce</a>
  147. mailing list. It is very low volume, and it will keep you informed
  148. of new stable releases. You might also consider subscribing to <a
  149. href="http://archives.seul.org/or/talk/">or-talk</a> (higher volume),
  150. where new development releases are announced.
  151. </p>
  152. <p>
  153. 7. Have a look at the manual.
  154. The <a href="http://tor.eff.org/tor-manual.html.en">manual</a> for the
  155. latest stable version provides detailed instructions for how to install
  156. and use Tor, including configuration of client and server options.
  157. If you are running the CVS version the manual is available
  158. <a href="http://tor.eff.org/tor-manual-cvs.html.en">here</a>.
  159. </p>
  160. <p>
  161. 8. Read
  162. <a href="http://wiki.noreply.org/noreply/TheOnionRouter/OperationalSecurity">this document</a>
  163. to get ideas how you can increase the security of your server.
  164. <hr />
  165. <a id="two"></a>
  166. <h2><a class="anchor" href="#two">Step Two: Make sure it's working</a></h2>
  167. <br />
  168. <p>As soon as your server manages to connect to the network, it will
  169. try to determine whether the ports you configured are reachable from
  170. the outside. This may take up to 20 minutes. Look for a log entry like
  171. <tt>Self-testing indicates your ORPort is reachable from the outside. Excellent.</tt>
  172. If you don't see this message, it means that your server is not reachable
  173. from the outside &mdash; you should re-check your firewalls, check that it's
  174. testing the IP and port you think it should be testing, etc.
  175. </p>
  176. <p>When it decides that it's reachable, it will upload a "server
  177. descriptor" to the directories. This will let clients know
  178. what address, ports, keys, etc your server is using. You can <a
  179. href="http://belegost.seul.org/">load the directory manually</a> and
  180. look through it to find the nickname you configured, to make sure it's
  181. there. You may need to wait a few seconds to give enough time for it to
  182. make a fresh directory.</p>
  183. <hr />
  184. <a id="three"></a>
  185. <h2><a class="anchor" href="#three">Step Three: Register your nickname</a></h2>
  186. <br />
  187. <p>
  188. Once you are convinced it's working (after a day or two maybe), you should
  189. register your server.
  190. This reserves your nickname so nobody else can take it, and lets us
  191. contact you if you need to upgrade or something goes wrong.
  192. </p>
  193. <p>
  194. Send mail to <a
  195. href="mailto:tor-ops@freehaven.net">tor-ops@freehaven.net</a> with a
  196. subject of '[New Server] &lt;your server's nickname&gt;' and
  197. include the following information in the message:
  198. </p>
  199. <ul>
  200. <li>Your server's nickname</li>
  201. <li>The fingerprint for your server's key (the contents of the
  202. "fingerprint" file in your DataDirectory &mdash; on Windows, look in
  203. \<i>username</i>\Application&nbsp;Data\tor\ or \Application&nbsp;Data\tor\;
  204. on OS X, look in /Library/Tor/var/lib/tor/; and on Linux/BSD/Unix,
  205. look in /var/lib/tor or ~/.tor)
  206. </li>
  207. <li>Who you are, so we know whom to contact if a problem arises</li>
  208. <li>What kind of connectivity the new server will have</li>
  209. </ul>
  210. <hr />
  211. <a id="four"></a>
  212. <h2><a class="anchor" href="#four">Step Four: Once it's working</a></h2>
  213. <br />
  214. <p>
  215. We recommend the following steps as well:
  216. </p>
  217. <p>
  218. 6. Decide what exit policy you want. By default your server allows
  219. access to many popular services, but we restrict some (such as port 25)
  220. due to abuse potential. You might want an exit policy that is
  221. less restrictive or more restrictive; edit your torrc appropriately.
  222. Read the FAQ entry on <a
  223. href="http://tor.eff.org/faq-abuse.html#TypicalAbuses">issues you might
  224. encounter if you use the default exit policy</a>.
  225. If you choose a particularly open exit policy, you should make
  226. sure your ISP is ok with that choice.
  227. </p>
  228. <p>
  229. 7. Decide about rate limiting. Cable modem, DSL, and other users
  230. who have asymmetric bandwidth (e.g. more down than up) should
  231. rate limit to their slower bandwidth, to avoid congestion. See the <a
  232. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#LimitBandwidth">rate
  233. limiting FAQ entry</a> for details.
  234. </p>
  235. <p>
  236. 8. If you control the name servers for your domain, consider setting
  237. your hostname to 'anonymous' or 'proxy' or 'tor-proxy', so when other
  238. people see the address in their web logs, they will more quickly
  239. understand what's going on.
  240. </p>
  241. <p>
  242. 9. If your computer isn't running a webserver, please consider
  243. changing your ORPort to 443 and your DirPort to 80. Many Tor
  244. users are stuck behind firewalls that only let them browse the
  245. web, and this change will let them reach your Tor server. Win32
  246. servers can simply change their ORPort and DirPort directly
  247. in their torrc and restart Tor. OS X or Unix servers can't bind
  248. directly to these ports (since they don't run as root), so they will
  249. need to set up some sort of <a
  250. href="http://wiki.noreply.org/wiki/TheOnionRouter/TorFAQ#ServerForFirewalledClients">
  251. port forwarding</a> so connections can reach their Tor server. If you are
  252. using ports 80 and 443 already but still want to help out, other useful
  253. ports are 22, 110, and 143.
  254. </p>
  255. <p>
  256. 10. If your Tor server provides other services on the same IP address
  257. &mdash; such as a public webserver &mdash; make sure that connections to the
  258. webserver are allowed from the local host too. You need to allow these
  259. connections because Tor clients will detect that your Tor server is the <a
  260. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#ExitEavesdroppers">safest
  261. way to reach that webserver</a>, and always build a circuit that ends
  262. at your server. If you don't want to allow the connections, you must
  263. explicitly reject them in your exit policy.
  264. </p>
  265. <p>
  266. 11. (Unix only). Make a separate user to run the server. If you
  267. installed the OS X package or the deb or the rpm, this is already
  268. done. Otherwise, you can do it by hand. (The Tor server doesn't need to
  269. be run as root, so it's good practice to not run it as root. Running
  270. as a 'tor' user avoids issues with identd and other services that
  271. detect user name. If you're the paranoid sort, feel free to <a
  272. href="http://wiki.noreply.org/wiki/TheOnionRouter/TorInChroot">put Tor
  273. into a chroot jail</a>.)
  274. </p>
  275. <p>
  276. 12. (Unix only.) Your operating system probably limits the number
  277. of open file descriptors per process to 1024 (or even less). If you
  278. plan to be running a fast exit node, this is probably not enough. On
  279. Linux, you should add a line like "toruser hard nofile 8192" to your
  280. /etc/security/limits.conf file (where toruser is the user that runs the
  281. Tor process), and then restart Tor if it's installed as a package (or log
  282. out and log back in if you run it yourself). If that doesn't work, see <a
  283. href="http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#FileDescriptors">this
  284. FAQ entry</a> for other suggested ways to run "ulimit -n 8192" before
  285. you launch Tor.
  286. </p>
  287. <p>
  288. 13. If you installed Tor via some package or installer, it probably starts
  289. Tor for you automatically on boot. But if you installed from source,
  290. you may find the initscripts in contrib/tor.sh or contrib/torctl useful.
  291. </p>
  292. When you change your Tor configuration, be sure to restart Tor, and
  293. remember to verify that your server still works correctly after the
  294. change.
  295. <hr />
  296. <p>If you have suggestions for improving this document, please post
  297. them on <a href="http://bugs.noreply.org/tor">our bugtracker</a> in the
  298. website category. Thanks!</p>
  299. </div><!-- #main -->
  300. </div>
  301. <div class="bottom" id="bottom">
  302. <i><a href="/contact"
  303. class="smalllink">Webmaster</a></i> - $Id$
  304. </div>
  305. </body>
  306. </html>