# service transmission-daemon reload # usermod -aG debian-transmission dasomoli
download-dir은 다운로드 받을 디렉토리, rpc-username은 웹 인터페이스로 들어갈 때 로그인 할 ID, rpc-password는 그 Password이다. rpc-whitelist-enabled를 false 로 설정하면, 말 그대로 whitelist를 사용하지 않으므로, 어디에서든 접속이 가능하다.
접속은 기본은 9091 포트로 접속하면 된다. 위에선 9000으로 바꿨다. 하지만, 포트 번호를 치긴 귀찮으므로 apache2의 proxy를 이용해서 접속하자.
# vi /etc/apache2/sites-available/torrent.dasomoli.org.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName torrent.dasomoli.org
ServerAdmin dasomoli@gmail.com
ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/torrent.log
CustomLog ${APACHE_LOG_DIR}/torrent.access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
이제 proxy 모듈을 enable하고, site를 enable한 후, apache2를 재시작하자.
이제 http://torrent.dasomoli.org 로 접속하면 된다.
당연히 미리 DNS설정은 되어 있어야 한다.
부팅 시에 Web UI 가 연결이 안되는 경우가 있는데, 이 때는 transmission-daemon을 reload 하면 된다. 수많은 해결(이라고 주장하는) 방법이 있지만, 가장 간단하면서 잘 동작하는 방법은 그냥 raspi-config에서 “Network at Boot:”의 “Wait for network”을 체크하는 것이다.
Proxy 환경에서 add-apt-repository ppa:sun-java-community-team/sun-java6 에서 “couldn’t connect to host” 에러가 나는 경우 환경 변수 http_proxy, https_proxy, ftp_proxy 가 sudo 에서도 먹도록 다음을 /etc/sudoers 에 추가한다.
일전에 OMAPpedia 에 나와 있다고 쓴 적이 있었는데, 그 글에서 다른 이슈들에 묻혀서 잘 안보이길래 아예 다른 글로 하나 빼서 쓴다.
가끔 ssh 를 Proxy 환경에서 사용해야 할 일이 있다. 이럴 때는 corkscrew 를 설치하고 ~/.ssh/config 안에 다음과 같이 설정하면 된다.
ProxyCommand /usr/local/bin/corkscrew <Proxy URL or IP> <Proxy Port> %h %p
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config –global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny
# Configuration. Common proxy ports are 3128, 8123, 8000.
_proxy=<IP:xxx.xxx.xxx.xxx>
_proxyport=<PORT:8080>