にtorrentflux 2.4をインストールする
[前提条件]
- mysqladminのインストールと設定が終わっている
- MySQLのインストールと設定が終わっている
- Apacheのインストールと設定が終わっている
- torrentfluxダウンロードしたファイルの置き場所は/share/tldatas/
まず最初にportsからインストールする。けどこれはバージョンも古いし、portauditからインストールするなよって言われますが、無理矢理入れます。一緒にインストールされる他のファイルだけが必要なのでtorrentflux自体はすぐに消します。オプションは特に付けませんでした。
cd /usr/ports/net-p2p/torrentflux make install clean DISABLE_VULNERABILITIES=yes make deinstall
portsからtorrentfluxを消したら、公式サイトからtorrentflux2.4をDLしてきてインストールします。この辺はINSTALLとか他のサイトを多少参考にしました。こんなことしてないでApacheの公開ディレクトリにそのままDLすれば後で設定ファイル書く手間省けるんじゃないかという指摘がありましたがその通りです。
ディレクトリ作ってDL&解凍
mkdir -p /usr/local/src cd /usr/local/src wget 'http://jaist.dl.sourceforge.net/project/torrentflux/torrentflux/TorrentFlux%202.4/torrentflux_2.4.tar.gz' tar zxf torrentflux_2.4.tar.gz
設定関係mysqlのrootのパスワードがfooという前提です。適宜読み替えてください。
cd torrentflux_2.4 mysqladmin --user=root --password=foo create torrentflux mysql --user=root --password=foo torrentflux < sql/mysql_torrentflux.sql
vi html/config.php
<?php /**************************************************************************/ // YOUR DATABASE CONNECTION INFORMATION /**************************************************************************/ // Check the adodb/drivers/ directory for support for your database // you may choose from many (mysql is the default) $cfg["db_type"] = "mysql"; // mysql, postgres7, postgres8 view adodb/drivers/ $cfg["db_host"] = "localhost"; // DB host computer name or IP $cfg["db_name"] = "torrentflux"; // Name of the Database $cfg["db_user"] = "root"; // username for your MySQL database $cfg["db_pass"] = foo // password for database ?>
Apache関連の設定
vi /usr/local/etc/apache22/Includes/torrentflux.conf
Alias /tf24/ "/usr/local/src/torrentflux_2.4/html/" <Directory "/usr/local/src/torrentflux_2.4/html"> Options none Order Deny,Allow Deny from all Allow from all </Directory>
Apacheを再起動して設定ファイルを読み込ませる
apachectl restart
torrentflux2.4でダウンロードしたファイルの置き場所の作成(後述の設定でここを使う)
mkidr -p /share/tldatas cd /share/ chomod 777 tldatas chown www:www tldatas
以上の設定が終わったら以下のURLでlogin画面が出たら成功。IDとpassはMySQLの物で入れます。
http://serveraddress/tf24/
最初にloginしたときには設定画面がでるので以下を設定しておく
お好みで以下の物が設定できる
- Allow encrypted connections(暗号化された接続を認めるか)
- Only allow encrypted connections(暗号化された接続のみにするか)
- Show Server Load(サーバのロードアベレージを見せるか)
FreeBSDの場合/proc/loadavgはデフォルトでは表示できないので俺はfalseにした。
設定できたらUpdate Settings
新規にトレントファイルを追加する場合には右上のhomeをクリックする。ただトラッカーが選択できなかったり、各ファイルの進行状況がみれなかったり多少使い勝手は悪いが放置するのは向いている。
とりあえず俺は以下のトレントファイルを追加してみました
http://torrents.freebsd.org:8080/stats.html?info_hash=a233878b05f9cd1d1cdb42012cbb7107fa55ac17