f4d76878a0ba88a1a8fdf32a98d71fefb9d183fd
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

1) ## translation metadata
2) # Revision: $Revision: 22314 $
3) # Translation-Priority: 3-low
4) 
5) #include "head.wmi" TITLE="Tor Project: Hidden Service Configuration Instructions" CHARSET="UTF-8"
6) <div id="content" class="clearfix">
7)   <div id="breadcrumbs">
Andrew Lewman change all of the breadcrum...

Andrew Lewman authored 13 years ago

8)     <a href="<page index>">Home &raquo; </a>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

9)     <a href="<page docs/documentation>">Documentation &raquo; </a>
10)     <a href="<page docs/tor-hidden-service>">Tor Hidden Service</a>
11)   </div>
12)   <div id="maincol">
Andrew Lewman change all of the breadcrum...

Andrew Lewman authored 13 years ago

13)     <h1>Configuring Hidden Services for <a href="<page index>">Tor</a></h1>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

14)     <hr />
15)     
16)     <p>Tor allows clients and relays to offer hidden services. That is,
17)     you can offer a web server, SSH server, etc., without revealing your
18)     IP address to its users. In fact, because you don't use any public address,
19)     you can run a hidden service from behind your firewall.
20)     </p>
21)     
22)     <p>If you have Tor installed, you can see hidden services
23)     in action by visiting <a href="http://duskgytldkxiuqc6.onion/">our
24)     example hidden service</a>.
25)     </p>
26)     
27)     <p>This howto describes the steps for setting up your own hidden service
28)     website. For the technical details of how the hidden service protocol
29)     works, see our <a href="<page docs/hidden-services>">hidden service protocol</a> page.
30)     </p>
31)     
32)     <hr />
33)     <a id="zero"></a>
34)     <h2><a class="anchor" href="#zero">Step Zero: Get Tor working</a></h2>
35)     <br />
36)     
37)     <p>Before you start, you need to make sure:</p>
38)     <ol>
39)     <li>Tor is up and running,</li>
40)     <li>You actually set it up correctly.</li>
41)     </ol>
42)     
43)     
44)     <p>Windows users should follow the <a
45)     href="<page docs/tor-doc-windows>">Windows
46)     howto</a>, OS X users should follow the <a
47)     href="<page docs/tor-doc-osx>">OS
48)     X howto</a>, and Linux/BSD/Unix users should follow the <a
49)     href="<page docs/tor-doc-unix>">Unix howto</a>.
50)     </p>
51)     
52)     <p>Once you've got Tor installed and configured,
53)     you can see hidden services in action by following this link to <a
54)     href="http://duskgytldkxiuqc6.onion/">our example hidden service</a>
55)     or the <a
56)     href="http://gaddbiwdftapglkq.onion/">Wikileaks hidden service</a>.
57)     It will typically take 10-60 seconds to load
58)     (or to decide that it is currently unreachable). If it fails
59)     immediately and your browser pops up an alert saying that
60)     "www.duskgytldkxiuqc6.onion could not be found, please check the name and
61)     try again" then you haven't configured Tor correctly; see <a
Andrew Lewman clean up wiki and faq refer...

Andrew Lewman authored 13 years ago

62)     href="<wikifaq>#ItDoesntWork">the
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

63)     it-doesn't-work FAQ entry</a> for some help.
64)     </p>
65)     
66)     <hr />
67)     <a id="one"></a>
68)     <h2><a class="anchor" href="#one">Step One: Install a web server locally</a></h2>
69)     <br />
70)     
71)     <p>First, you need to set up a web server locally. Setting up a web
72)     server can be tricky,
73)     so we're just going to go over a few basics here. If you get stuck
74)     or want to do more, find a friend who can help you. We recommend you
75)     install a new separate web server for your hidden service, since even
76)     if you already have one installed, you may be using it (or want to use
77)     it later) for an actual website.
78)     </p>
79)     
80)     <p>If you're on Unix or OS X and you're comfortable with
81)     the command-line, by far the best way to go is to install <a
82)     href="http://www.acme.com/software/thttpd/">thttpd</a>. Just grab the
83)     latest tarball, untar it (it will create its own directory), and run
84)     <kbd>./configure &amp;&amp; make</kbd>. Then <kbd>mkdir hidserv; cd
85)     hidserv</kbd>, and run
86)     <kbd>../thttpd -p 5222 -h localhost</kbd>. It will give you back your prompt,
87)     and now you're running a webserver on port 5222. You can put files to
88)     serve in the hidserv directory.
89)     </p>
90)     
91)     <p>If you're on Windows, you might pick <a
92)     href="http://savant.sourceforge.net/">Savant</a> or <a
93)     href="http://httpd.apache.org/">Apache</a>, and be sure to configure it
94)     to bind only to localhost. You should also figure out what port you're
95)     listening on, because you'll use it below.
96)     </p>
97)     
98)     <p>(The reason we bind the web server only to localhost is to make
99)     sure it isn't publically accessible. If people could get to it directly,
100)     they could confirm that your computer is the one offering the hidden
101)     service.)
102)     </p>
103)     
104)     <p>Once you've got your web server set up, make sure it works: open your
105)     browser and go to <a
106)     href="http://localhost:5222/">http://localhost:5222/</a>, where 5222 is
107)     the port that you picked above. Then try putting a file in the main html
108)     directory, and make sure it shows up when you access the site.
109)     </p>
110)     
111)     <hr />
112)     <a id="two"></a>
113)     <h2><a class="anchor" href="#two">Step Two: Configure your hidden service</a></h2>
114)     <br />
115)     
116)     <p>Next, you need to configure your hidden service to point to your
117)     local web server.
118)     </p>
119)     
120)     <p>First, open your torrc file in your favorite text editor. (See <a
Andrew Lewman clean up wiki and faq refer...

Andrew Lewman authored 13 years ago

121)     href="<wikifaq>#torrc">the
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

122)     torrc FAQ entry</a> to learn what this means.) Go to the middle section and
123)     look for the line</p>
124)     
125)     <pre>
126)     \############### This section is just for location-hidden services ###
127)     </pre>
128)     
129)     <p>
130)     This section of the file consists of groups of lines, each representing
131)     one hidden service. Right now they are all commented out (the lines
132)     start with #), so hidden services are disabled. Each group of lines
133)     consists of one <var>HiddenServiceDir</var> line, and one or more
134)     <var>HiddenServicePort</var> lines:</p>
135)     <ul>
136)     <li><var>HiddenServiceDir</var> is a directory where Tor will store information
137)     about that hidden service.  In particular, Tor will create a file here named
138)     <var>hostname</var> which will tell you the onion URL.  You don't need to
139)     add any files to this directory. Make sure this is not the same directory
140)     as the hidserv directory you created when setting up thttpd, as your
141)     HiddenServiceDir contains secret information!</li>
142)     <li><var>HiddenServicePort</var> lets you specify a virtual port (that is, what
143)     port people accessing the hidden service will think they're using) and an
144)     IP address and port for redirecting connections to this virtual port.</li>
145)     </ul>
146)     
147)     <p>Add the following lines to your torrc:
148)     </p>
149)     
150)     <pre>
151)     HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/
152)     HiddenServicePort 80 127.0.0.1:5222
153)     </pre>
154)     
155)     <p>You're going to want to change the <var>HiddenServiceDir</var> line, so it points
156)     to an actual directory that is readable/writeable by the user that will
157)     be running Tor. The above line should work if you're using the OS X Tor
158)     package. On Unix, try "/home/username/hidden_service/" and fill in your own
159)     username in place of "username". On Windows you might pick:</p>
160)     <pre>
161)     HiddenServiceDir C:\Documents and Settings\username\Application Data\hidden_service\\
162)     HiddenServicePort 80 127.0.0.1:5222
163)     </pre>
164)     
165)     <p>Now save the torrc, shut down
166)     your Tor, and then start it again.
167)     </p>
168)     
169)     <p>If Tor starts up again, great. Otherwise, something is wrong. First look at
170)     your logfiles for hints. It will print some warnings or error messages. That
171)     should give you an idea what went wrong. Typically there are typos in the torrc
172)     or wrong directory permissions (See <a
Andrew Lewman clean up wiki and faq refer...

Andrew Lewman authored 13 years ago

173)     href="<wikifaq>#Logs">the