Procedures for installing and configuring Tor relay servers in Linux

Source: Internet
Author: User
How to install and configure the Tor relay server in a Linux system-Linux Enterprise Application-Linux server application information. Today, the Tor Relay Service is successfully installed in Linux. The system platform is Fedora 8 and the Tor version is tor-0.2.0.19-alpha.
Some minor problems have been solved successfully. The following are the installation and configuration procedures and solutions and experiences for some minor problems, for your reference.

Step 1: download and install Tor
Download the latest tors from the official website. I downloaded tor-0.2.0.19-alpha.tar.gz. Considering system compatibility, I downloaded a non-RPM package.
Tar zxvf tor-0.2.0.19-alpha.tar.gz
Cd tor-0.2.0.19-alpha
./Configure
Make
Make install
If it succeeds, the installation should be successful, but the following error message is interrupted during configure:
Checking whether we need extra options to link libevent... Configure: error: Found linkable libevent in (system), but it does not seem to run, even with-R. Maybe specify another using? With-libevent-dir}
Although the libevent package has been installed on Fedora on the 8 th, it is clear that the default path is not found in the configuration program. At this time, I can only download the latest libevent version from the official website of libevent:
Http://www.monkey.org /~ Provos/libevent/
Http://www.monkey.org /~ Provos/libevent-1.4.1-beta.tar.gz
The Installation Method of the libevent package is similar and smooth. Then, return to the Tor directory and re-specify the libevent directory for re-installation:
./Configure? With-libevent-dir =/usr/local/lib
Make
Make install
The installation is successful.

Step 2: Set the Tor configuration file
After the installation is complete by default, the main configuration file is in the/usr/local/etc/tor/directory, and there is a torrc. sample file.
Cp torrc. sample torrc
Mkdir/var/log/tor
Touch/var/log/tor/notices. log
Touch/var/log/tor/debug. log
Mkdir/var/run/tor
Touch/var/run/tor. pid
Mkdir/var/lib/tor
Edit the torrc file and open and set the following Configuration:
SocksPort 9050
SocksListenAddress 127.0.0.1
Log notice file/var/log/tor/notices. log
Log debug file/var/log/tor/debug. log
# Note that the debug. log file is quickly added. If it is normal, it is not recommended to open it, but it can be tested during installation and debugging.
DataDirectory/var/lib/tor
# This directory is the main operating data storage directory of tor, including key files.
Nickname yourname
# This name can be defined by yourself, with letters or numbers. It cannot contain spaces or symbols.
ContactInfo
# Your email Contact information is defined here. It is said that it is used by the Tor to contact you.
Or port 9001
The above configurations are mainly contained in this file, and some other bandwidth configurations are available. If you need them, you can configure them later.

Step 3: Set the Tor startup and Control Files
After the preceding configuration, you can run the service on the background by default through/usr/local/bin/tor-f/usr/local/etc/tor/torrc, however, to facilitate future management, you can configure the startup and control scripts.
Return to the decompressed directory of the installation package and enter the sub-directory contrib.
Vi torctl
Edit the file and make sure that the specified file and directory are correct:
# The path to your binary, including options if necessary
TORBIN = "/usr/local/bin/$ EXEC"
# The path to the configuration file
TORCONF = "/usr/local/etc/tor/torrc"
# The path to your PID file
PIDFILE = "/var/run/tor. pid"
# The path to the log file
LOGFILE = "/var/log/tor. log"
# The path to the datadirectory
TORDATA = "/var/lib/tor"
Set the Tor running user. You can specify a user or use root. If you specify a user, you must ensure that the permissions of the corresponding directory are correct:
TORUSER = root
TORGROUP = root
Then copy the control file to the corresponding calling Directory:
Cp torctl/usr/local/bin/
Finally, configure the tor. sh script to ensure that the torctl call directory is correct:
TORCTL =/usr/local/bin/torctl
TORUSER = root
Export TORUSER
TORGROUP = root
Export TORGROUP
Copy the edited tor. sh file to the Startup Script directory to run the script:
Cp tor. sh/etc/rc. d/init. d/
# Tor. sh
Usage:/etc/rc. d/init. d/tor. sh (start | stop | restart | reload | status)

After normal startup, you should see the following records in the tor log file, so your service will be normal:
Feb 23 23:29:36. 464 [notice] Tor 0.2.0.19-alpha (r13450) opening log file.
Feb 23 23:29:36. 466 [warn] You are running Tor as root. You don't need to, and you probably shouldn't.
Feb 23 23:29:37. 054 [notice] Your Tor server's identity key fingerprint is ..............
Feb 23 23:29:40. 083 [notice] We now have enough directory information to build circuits.
Feb 23 23:29:41. 946 [notice] Self-testing indicates your ORPort is reachable from the outside. Excellent. Publishing server descriptor.
Feb 23 23:29:46. 656 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Feb 23 23:30:43. 600 [notice] Self-testing indicates your DirPort is reachable from the outside. Excellent.
Feb 23 23:31:49. 993 [notice] Wide Ming bandwidth self-test... Done.

Others:
1) the/var/lib/tor/keys directory stores the key of your identity after the first installation and configuration, while ensuring that the data is encrypted, it is also the credential you contributed to the Tor relay network. If you want to change the server or reinstall it, you can save the key and place it on the new server for further use.
2) After successfully running Tor relay, you can see a list of all online relay on the page of http://moria.seul.org: 9032/tor/status/authority, where your IP and name are listed.
3) In Windows, the client Tor cannot view your running Tor relay server in the server list on the Network Map. However, if the windows client also opens the relay service, then, you can see the Tor relay server running on Linux on the server list in the network map.
4) we recommend that you change ORPort 9001 to port 443 on Tor's official website, because some network firewalls may limit the access port, if port 443 is set, more people can use Tor relay. I think this situation may not exist in China. If necessary, check your interest, this is random.

The more the Tor relay network, the faster the Tor user will be. From the network map, there are many Tor relay nodes in Europe and North America, however, there are very few Tor relay nodes in mainland China, hoping that more friends will contribute their own strength to the Tor relay network.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.