Wednesday, October 03, 2007

How to build tor + privoxy under solaris (and get it working)

Ok, FYI just in case you're looking for help...

1) get privoxy (http://www.privoxy.org)
Download the solaris 10 build of privoxy (the links point to the source, but it's already working)
2) Download tor sources (tor.eff.org)
3) Download gcc stuffs from http://www.sunfreeware.com (should work with different versions)
- gcc-3.4.6-sol10-x86-local.gz
- libevent-1.2a-sol10-x86-local.gz
- libiconv-1.11-sol10-x86-local.gz
(gunzip each file and then do a pkgadd -d . package_directory )
4) Set PATH and LD_LIBRARY_PATH environment
export PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/ccs/bin #/usr/ccs/bin is needed for 'ar' binary
export LD_LIBRARY_PATH=/usr/local/lib #for libevent

5) add privoxy/tor users to /etc/group and /etc/passwd:
- /etc/passwd:
privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell
tor:*:7778:7778:tor user:/no/home:/no/shell
- /etc/group:
privoxy:*:7777:
tor::7778:

6) build tor... (you'll get "some" warnings :) )
./configure --prefix /usr/local
make
make install

7) install privoxy...
cp -rp privoxy /usr/local/bin
mkdir /etc/privoxy
cp *action /etc/privoxy; cp *filter /etc/privoxy; cp -rp templates /etc/privoxy/
cp -rp trust /etc/privoxy; cp config /etc/privoxy

8) edit /etc/privoxy/config
logfile /var/log/privoxy/logfile
forward-socks4a / 127.0.0.1:9050 .
9) configure tor:
cp /usr/local/etc/tor/torrc.sample /usr/local/etc/torrc
10) create privoxy log directory:
mkdir /var/log/privoxy/
chown privoxy:privoxy /var/log/privoxy
chown -R privoxy:privoxy /etc/privoxy
11) Create init script...
cat /etc/init.d/privoxy-tor.sh
-------------------------
#!/usr/bin/sh
PATH=/usr/local/bin
$PATH/privoxy --pidfile /var/run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config
/usr/local/bin/tor -f /usr/local/etc/tor/torrc &
--------------------------
chmod +x /etc/init.d/privoxy-tor.sh
12) RUN ...
/etc/init.d/privoxy-tor.sh

13) Set your browser proxy settings ....
localhost 8118 (for all protocols except for socks server...)
localhost 9050 (for sock)

14) enjoy

DISCLAIMER
This is a summary of what I remember of the entire procedure (...10minutes ago)
Tor gives you a warning telling that it's running as root... (I'm too lazy to fix this now)
My Opensolaris build is nv66.

Byez,
giobbe

No comments: