It is sometimes desirable to compile Tor from source, and perhaps run an unreleased version (e.g., to test the latest changes, use new features unavailable in the latest release, etc.). What is the procedure for doing so?
To compile and install Tor from git follow these steps:
Step 0: Make sure you have
git, a working "C compiler" and "GNU make" installed on your linux box. You also need
libssl-dev libraries before you start.
If you're on debian/ubuntu type:
sudo apt-get install git build-essential automake libevent-dev libssl-dev zlib1g-dev
Step 1: Clone Tor from git.torproject.org
git clone https://git.torproject.org/tor.git
- Step 3: run
- Step 4: run
./configure --disable-asciidocif you don't want to build the manpages.
(See 'note' if you get error at this step)
- Step 5: run
- Step 6 (optional): run
Note: If you have problems finding libraries at step 4 try the following instead:
CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" \ ./configure
And if you have mysterious
autoconf failures while linking openssl,
consider setting your
LD_LIBRARY_PATH to the openssl lib directory.
setenv LD_LIBRARY_PATH /usr/your_username/lib.
see INSTALL for more details.
UPDATE (after Roger Dingledine's comment):
Please, do not use the "--enable-bufferevents" feature for stable installations. It's not mature yet.
The --enable-bufferevents option has not ever worked. It is a partial feature that needs somebody to finish it.
Tor can now optionally build with the "bufferevents" buffered IO backend provided by Libevent 2. To use this feature, make sure you have the latest possible version of Libevent, and pass the --enable-bufferevents flag to configure when building Tor from source. This feature will make our networking code more flexible, let us stack layers on each other, and let us use more efficient zero-copy transports where available.
Git source is really easy stuff for install tor. But I want to tell the easiest alternative way for installing tor from official tor source code. This following commands for Centos. If you're using other Linux, install libevent-devel, groupinstall 'Development Tools' from your default package manager(apt-get or any other).
root @ Centos.
- Step 1:
- Step 2:
tar -xf tor-0.4.3.4-rc.tar.gzand
mv tor-0.4.3.4-rc tor
- Step 3:
sudo yum groupinstall 'Development Tools'
- Step 4:
yum install libevent-devel
- Step 5:
- Step 6:
- Step 7:
- Step 8:
- Step 9:run
I hope this answer will helps you.