메뉴 건너뛰기

infra

[tor] 우분투에서 Tor 설치와 PHP 활용

suritam92012.11.27 23:05조회 수 2091댓글 0

    • 글자 크기

1. https://www.torproject.org/docs/debian 이 페이지를 참고하여 아래와 같이 수행한다.


add this line to your/etc/apt/sources.listfile:

deb     http://deb.torproject.org/torproject.org <DISTRIBUTION> main
<DISTRIBUTION>은 precise 로 했다.
gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
apt-get update
apt-get install deb.torproject.org-keyring
apt-get install tor

2. Tor 설치 후 PHP 용 라이브러리를 다운 받는다.

https://github.com/kaiserbaldo/PHP-Tor-Proxy


# vi /etc/tor/torrc 파일을 수정하여 ControlPort 9051과 HashedControlPassword 을 추가한다.

# tor --hash-password t0rS3cr3tPwD

를 통해 HashedControlPassword를 생성할 수 있다.


16:16진수 값

으로 내용이 만들어진다.


3. Tor 에는 Curl을 사용해 요청하는 부분이 있어, curl을 이용할 수 있도록 extension을 열거나 설치한다.


extestion=curl.dll


또는


# sudo apt-get install php5-curl

버전에 따라, php-curl 등으로 입력 하면 된다.


이렇게 하고 test 하면, 아래와 같이 생성되는 값을 확인할 수 있다.



Array
(
    [url] => ~~~~~
    [userAgent] => Flock/5.6 (Windows 98 2.3; en-US;)
    [timeout] => 300
    [proxy] => 127.0.0.1:8118
    [payload] => ~~~
    [return] => 
)

4. proxy 기능을 사용하기 위해서는 아래의 프로그램을 추가 설치한다.
# apt-get install privoxy
# apt-get install polipo
http://kimsgomul.tistory.com/entry/%EA%B0%9C%EC%9D%B8%EC%A0%95%EB%B3%B4-%EB%B3%B4%ED%98%B8%ED%94%84%EB%A1%9D%EC%8B%9C-%EC%9A%B0%ED%9A%8C%ED%95%98%EC%97%AC-ip-%EC%88%A8%EA%B8%B0%EA%B8%B0-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%A8-Tor%ED%86%A0%EB%A5%B4
위 주소의 글에 의하면, Polipo 는 프록시 서버라고 하는데, privoxy 가 8118 포트로 열리고, polipo는 8123 포트로 운영된다.

suritam9 (비회원)
    • 글자 크기
[XP] Server 서비스 기능과 제한 (by suritam9) [MSSQL2005] The user is not associated with a trusted SQL Server connection (by suritam9)

댓글 달기

박영식
2012.03.24 조회 2047
suritam9
2012.07.06 조회 3065
suritam9
2012.07.06 조회 2210
suritam9
2012.10.04 조회 2254
suritam9
2013.05.05 조회 3781
suritam9
2013.09.05 조회 3239
첨부 (0)
위로