docs/en/running-a-mirror.wml
2a9aaa80
 ## translation metadata
40e07e2e
 # Revision: $Revision$
2a9aaa80
 # Translation-Priority: 4-optional
 
 #include "head.wmi" TITLE="Tor: Running a Mirror" CHARSET="UTF-8"
 <div id="content" class="clearfix">
   <div id="breadcrumbs">
b289ef06
     <a href="<page index>">Home &raquo; </a>
2a9aaa80
     <a href="<page docs/documentation>">Documentation &raquo; </a>
     <a href="<page docs/running-a-mirror>">Running a Mirror</a>
ddc8f223
   </div>
   <div id="maincol">
2a9aaa80
     <h1>Tor: Running a Mirror</h1>
ed5ac546
     <hr>
ddc8f223
 
2a9aaa80
     <p>Thank you for wanting to mirror the Tor website.  All of
     our mirrors are publicly listed on <a href="<page getinvolved/mirrors>">our mirrors
     page</a>.  We've included some sample commands and configuration below
     to make the initial setup and ongoing maintenance a minimal effort.
6bb1efe4
     The Tor website and distribution directory currently require roughly
1dbe92c5
     30 GB of disk space, but this number can fluctuate. Expect space
     requirements of up to 50 GB.
6bb1efe4
     </p>
a540c948
     <a id="sysconfig"></a>
721026f2
     <h2><a class="anchor" href="#sysconfig">Configuring your System</a></h2>
2a9aaa80
     <p>
bccb6f1c
     If you would like to run a mirror, it's as easy as these commands to download
2a9aaa80
     everything a mirror should share with the world:
2038af2c
     </p>
2a9aaa80
     <tt>
fddc41c5
 <pre>
2be237ed
 rsync -aq --exclude dist --delete rsync://rsync.torproject.org/website-mirror/ /var/www/mirrors/torproject.org
 rsync -aq --delete rsync://rsync.torproject.org/dist-mirror/ /var/www/mirrors/torproject.org/dist
fddc41c5
 </pre>
2a9aaa80
     </tt>
ddc8f223
 
2a9aaa80
     <p>
     In order to assure we have reliable and up to date mirrors,
     please ensure your mirror does at least the following:<br/><br/>
ddc8f223
 
2a9aaa80
     Updates <b>no less</b> than every six hours, but no more frequent than every
     hour.<br/><br/>
ddc8f223
 
2a9aaa80
     Allows "Directory Index / Indexes" (Index viewing) of the /dist
     directory.<br/><br/>
ddc8f223
 
2a9aaa80
     Have a valid contact email for administrative communications should your
     server have issues.<br/><br/>
ddc8f223
 
2a9aaa80
     It is highly recommended for all mirror operators to subscribe to <A
f4bdf49c
     href="https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-mirrors">tor-mirrors mailing
2a9aaa80
     list</A> where all mirror listing modification requests should go (ADD,
     CHANGE, DELETE, any other requests/notifications).  Also, any technical
     assistance in setting up your mirror may be found here as well.<br/><br/>
ddc8f223
 
2a9aaa80
     </p>
ed5ac546
     <br><br>
2a9aaa80
     <p>
     An example cronjob to update a full mirror once every 6 hours may look like so:
2038af2c
     </p>
2a9aaa80
     <tt>
fddc41c5
 <pre>
 # m h  dom mon dow   command
e24f816d
 0 */6 * * * rsync -aq --exclude dist --delete rsync://rsync.torproject.org/website-mirror/ /var/www/mirrors/torproject.org
fddc41c5
 5 */6 * * * rsync -aq --delete rsync://rsync.torproject.org/dist-mirror/ /var/www/mirrors/torproject.org/dist
 </pre>
2a9aaa80
     </tt>
2038af2c
     <p>
2a9aaa80
     For mirror operators that use Apache, we have created a sample virtual host
     configuration file to use:
2038af2c
     </p>
2a9aaa80
     <tt>
fddc41c5
 <pre>
 &lt;VirtualHost 10.10.10.10:80&gt;
2038af2c
     ServerAdmin youremail@example.com<br/>
     ServerName  ServerNameHere<br/>
ddc8f223
 
2038af2c
     DocumentRoot /var/www/mirrors/torproject.org<br/>
ddc8f223
 
2038af2c
     &lt;Directory /var/www/mirrors/torproject.org/&gt;<br/>
c61eac7c
         # Be sure to enable the autoindex and negotiation modules<br/>
         Options MultiViews Indexes<br/>
2038af2c
         DirectoryIndex index<br/>
         AllowOverride None<br/>
     &lt;/Directory&gt;<br/>
ddc8f223
 
fddc41c5
 &lt;/VirtualHost&gt;
 </pre>
2a9aaa80
     </tt>
2038af2c
     <p>
b85ab915
     For mirror operators that use nginx, we created a sample virtual host
     configuration file to use:
2038af2c
     </p>
b85ab915
     <tt>
fddc41c5
 <pre>
 server {
     listen 10.10.10.10:80;
     server_name your.example.com;
b85ab915
 
fddc41c5
     root /var/www/mirrors/torproject.org;
     index index.html.en;
416fbc9a
 
fddc41c5
     location  / {
         autoindex on;
b85ab915
     }
fddc41c5
 }
 </pre>
b85ab915
     </tt>
2038af2c
     <p>
b85ab915
     If you use nginx, please ensure the text/html line in
68a5f97a
     <tt>/etc/nginx/mime.types</tt> matches:
2038af2c
     </p>
b85ab915
     <tt>
fddc41c5
 <pre>
 text/html                             en html htm shtml;
 </pre>
b85ab915
     </tt>
     <br/><br>
2a9aaa80
     Please ensure that you keep your mirror updated (we suggest automating this
     task with something like '<tt>cron</tt>'). Our website, source code and
     binary releases change often. An update frequency of six hours is recommended.  Tor users everywhere will thank you.
     </p>
ddc8f223
     <br/>
a540c948
     <a id="mirrorops"></a>
721026f2
     <h2><a class="anchor" href="#mirrorops">Joining the mirror community</a></h2>
2a9aaa80
     <p>
d18dfbe5
     If you are running a mirror, please subscribe to the <A
     href="https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-mirrors">tor-mirrors
bea20699
     mailing list</A>, and introduce yourself there. Help for mirror
     support and configuration issues may also be found on the list.
     </p>
721026f2
 
bea20699
     <p>
     In order to add your mirror, please send a
     single, comma delimited line of text based on <a
6b83672a
     href="https://gitweb.torproject.org/project/web/webwml.git/plain/include/tor-mirrors.csv">this
bea20699
     file</a> to the mirrors list. Your mirror will then be added manually
     if it passes availability testing and your provided information is
8a30b8a8
     confirmed. Some general pointers on mirrors are:
e24f816d
     <ol><li> Try not to run your mirror behind a content delivery network
     (such as Akamai, Cloudflare, Fastly, etc) as most of them block
8a30b8a8
     access from countries where the mirror is needed the most.</li>
     <li> Try not to redirect http to https. Many places in the world
721026f2
     cannot use https due to local or national firewalls.</li>
8a30b8a8
     </ol>
2a9aaa80
     </p>
   </div>
   <!-- END MAINCOL -->
   <div id = "sidecol">
 #include "side.wmi"
 #include "info.wmi"
   </div>
   <!-- END SIDECOL -->
 </div>
 <!-- END CONTENT -->
ddc8f223
 #include <foot.wmi>