首页 | 资讯动态 | linux基础 | 系统管理 | 网络管理 | 编程开发 | linux数据库 | 服务器技术 | linux相关 | linux认证 | 嵌入式 | 下载中心 | 专题 | linux招聘 | HR | 镜像
OKLinux中文技术站
·设为首页
·加入收藏
·联系我们
系统管理: 中文环境 系统管理 桌面应用 内核技术 | Linux基础: 基础入门 安装配置 常用命令 经验技巧 软件应用 | Linux数据库: Mysql Postgre Oracle DB2 Sybase other
网络管理: 网络安全 网络应用 Linux服务器 环境配置 黑客安全 | 编程开发: PHP CC++ Python Perl Shell 嵌入式开发 java jsp | PHP技术: PHP基础 PHP技巧 PHP应用 PHP文摘
搜索中心 Linux招聘 Linux专题 Apache | Linux相关: 硬件相关 Linux解决方案 Linux认证 企业应用 其它Unix | 相关下载: 资料下载 参考手册 开发工具 服务器类 软路由 其它
 技术搜索:
会员中心 注册会员 高级搜索  
  → 当前位置:首页>网络管理>linux服务器>正文

Linux平台下安装配置Tor中继服务器过程

http://www.oklinux.cn  2008-03-02  OKLinux搜集整理   会员收藏  游客收藏  【 】 
您查看的文章来源于http://www.oklinux.cn

今日终于顺利在Linux系统里安装成功Tor中继服务,系统平台为Fedora 8,Tor版本为tor-0.2.0.19-alpha。
虽然遇到些小问题,但也顺利解决了,以下是安装与配置流程和一些小问题的解决办法与心得,供大家参考。

第一步:下载并安装Tor
在官方网站下载最新版本的Tor,我下载的是tor-0.2.0.19-alpha.tar.gz,考虑到系统兼容性,我下载的是非RPM的包。
tar zxvf tor-0.2.0.19-alpha.tar.gz
cd tor-0.2.0.19-alpha
./configure
make
make install
如果顺利的话应该就安装成功了,不过我在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}
虽然Fedora 8日已经安装好libevent的包的,但显然配置程序并没有找到默认路径,这时候我只能到libevent的官方网站下载最新的libevent版本:
http://www.monkey.org/~provos/libevent/
http://www.monkey.org/~provos/libevent-1.4.1-beta.tar.gz
libevent包的安装方式类似,很顺利,然后回到Tor的目录里重新指定libevent目录重新安装:
./configure –with-libevent-dir=/usr/local/lib
make
make install
顺利安装成功。

第二步:设置Tor的配置文件
默认安装好以后,主要配置文件在/usr/local/etc/tor/目录下,有个torrc.sample文件。
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/tor.pid
mkdir /var/lib/tor
编辑torrc文件并把以下配置打开并设置:
SocksPort 9050
SocksListenAddress 127.0.0.1
Log notice file /var/log/tor/notices.log
Log debug file /var/log/tor/debug.log
#注意debug.log文件增加很快,如果是平时正常运行时不建议打开,但刚安装调试时可以测试效果。
DataDirectory /var/lib/tor
#此目录为tor主要的运行数据存放目录包括key文件等。
Nickname yourname
#这个名称设置可以自己定义,字母或数字即可,不可以有空格或符号。
ContactInfo
#这里定义你的email联系信息,据说是以便Tor联系你。
ORPort 9001
这个文件里主要就是以上这些配置,其它还有一些带宽配置等,如果觉得需要的话,可以以后再配置。

第三步:设置Tor启动和控制文件
以上配置好以后,默认情况下已经可以通过/usr/local/bin/tor -f /usr/local/etc/tor/torrc &来把服务运行在后台了,不过为了让以后方便管理,可以再配置一下启动和控制脚本。
回到安装包的解压的目录,进去子目录contrib。
vi torctl
编辑此文件,并确保相应的指定的文件与目录都正确:
# 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/tor.pid”
# The path to the log file
LOGFILE=”/var/log/tor/tor.log”
# The path to the datadirectory
TORDATA=”/var/lib/tor”
设置Tor运行用户,可以指定用户也可以用root,如果指定用户的话,需要确保相应目录的权限无误:
TORUSER=root
TORGROUP=root
然后copy控制文件到相应的调用目录:
cp torctl /usr/local/bin/
最后配置tor.sh脚本确保对torctl调用目录的正确以下启动用户的正确:
TORCTL=/usr/local/bin/torctl
TORUSER=root
export TORUSER
TORGROUP=root
export TORGROUP
把编辑好以后的tor.sh复制到启动脚本目录就可以运行了:
cp tor.sh /etc/rc.d/init.d/
#tor.sh
Usage: /etc/rc.d/init.d/tor.sh (start|stop|restart|reload|status)

正常启动后,应该在tor的日志文件里看到如下记录,那么你的服务就正常了:
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] Performing bandwidth self-test…done.


上一篇:教你快速掌握Oracle数据库的状态查询   下一篇:Linux少病毒主要原因是编写出来找不到攻击谁?

收藏于收藏夹】 【评论】 【推荐】 【打印】 【关闭
相关文档
·SUSE 10下安装PHP MySQL Apache(英文)
·Ubuntu下安装tftp服务器的步骤
·Ubuntu下通过SSH远程登录服务器的方法
·Debian安装LAMP网络开发平台
·Linux主机限制用户进程CPU占用率
·在Windows下远程关掉Linux主机
·Linux环境下配置OPENVZ 虚拟机实例讲解
·Linux与Windows下Samba设置实例解析
·SUSE 10.1下安装配置Tomcat服务器
·Linux下NTOP的安装过程
·用NTOP监控Linux服务器网络状态
·Ubuntu 下php环境的配置技巧
·Linux平台下安装LAMP的曲折历程
·Linux下配置Samba3.0为域登录与文件服务器
·Linux下轻松搭建DHCP服务
·Linux平台下安装code::blocks
发表评论
密码: 匿名评论
评论内容:

(不超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规)
 
  最新文档
·利用VSFTP架设Linux环境下的FTP服务器
·Linux下安装Apache 2.2.6 笔记
·Linux下的主要VPN技术
·Linux下Samba服务器搭建实例
·用Sendmail在Linux下架设邮件服务器
·2009服务器盘点:再见Sun 再见麦克利尼
·SUSE 10上做VPN服务器
·在Ubuntu 9.10中打造带tdbsam Backend
·Ubuntu服务器上SSH Server 的安装配置
·Nginx 禁止某个 User_Agent 的方法
·Linux-Apache-MySQL-PHP网站架构方案分
·Nginx 对某些 User_Agent 进行限速的方
  阅读排行
·Linux系统下架设APACHE SVN服务器全过
·Linux下用vsftp轻松搭建FTP服务器(修订
·Ubuntu下安装tftp服务器的步骤
·Linux 下配置vsftp虚拟用户总结
·详解远程SHELL下安装配置RedHat ES 5的
·Linux下安装eclipse与myeclipse
·Linux DNS Server -bind 9.5.0 安装配
·Linux与Linux,Linux与Windows之间使用S
·Ubuntu上搭建SVN服务器全攻略
·LVS集群学习笔记(NAT\DR\IP tunnel)
·Linux下tomcat启动jvm内存设置
·Linux shell 中FTP实现自动下载上传文
·安装大型Linux集群(4):节点安装和 GPFS
·Linux系统下架设PPTP VPN服务器
·Linux系统中下查看内存的方法
网摘收藏: