095817782
เข้าร่วม: 21 Jun 2009 ตอบ: 20
|
ตอบเมื่อ: Mon Aug 31, 2009 4:31 pm เรื่อง: การลง TorrentFlux [รันได้ชั่ว |
|
|
TorrentFlux [รันได้ชั่ว 100%] ทำงานได้ที่ Free HOST ทั่วไปไม่จำเป็นต้องลงที่เครื่องเราก็ได้ ในกรณีที่ต้องการปล่อย ไฟล์ หรืออับโหลดไฟล์เท่านั้นน่ะคับ จะใช้โหลดก็ไม่แต่ไม่แน่นำ ลอง มาแล้วก็เลยเอามาพูดให้ฟัง
ตรวจสอบว่าเครื่องมี Mysql รึเปล่าวหากไม่มี
1. ทำการลง libstdc++ ก่อนครับ (บางคนอาจลงไปแล้ว)
ipkg install libstdc++
2. โหลดไฟล์ ipkg-opt_0.99.163-9_mipsel.ipk ด้วยคำสั่ง
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk
3.สั่ง install
ipkg.sh install ipkg-opt_0.99.163-9_mipsel.ipk แล้วให้ตอบ y
4. โหลดไฟล์ uclibc-opt_0.9.28-12_mipsel.ipk
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk
5.สั่ง install
ipkg.sh install uclibc-opt_0.9.28-12_mipsel.ipk
6. สั่ง update ipkg
ipkg upgrade
ipkg update
7.ลง mysql
ipkg install mysql จะใช้เวลาสักพักนึงเนื่องจากจะพ่วงโปรแกรมที่จะลงอีกหลายตัว
สังเกตตอนที่ลงเสร็จจะขึ้นข้อความนี้ Starting MySQL. SUCCESS!
8. fix bug sql ด้วยคำสั่ง
ln -s /opt/lib/mysql/libmysqlclient.so /opt/lib/libmysqlclient.so.14
9.ทดสอบว่า Sql ใช้งานได้ให้พิม
mysql -u username ถ้าใช้งานได้จะขึ้น Welcome to the MySQL monitor
เสร็จ
รูปตอน SQL สมบูรณ์
รูปตอนเข้าไปตรวจสอบว่า Sql ใช้งานได้จริง
ตอนออกให้ใช้ exit ออกครับ
ต่ออีกนิดด้วยวิธีการลง php phpmyadmin เพื่อใช้เป็นฐานข้อมูลหรือ Data base server
หลังจากลง Mysql สำเร็จแล้วเราก็จะมาต่อที่ลง lighttpd เพื่อรัน Webserver ครับ
1.ลง lighttpd
ipkg install lighttpd
2.หลังลงเสร็จทดสอบว่าสามารถรัน web ได้ด้วยการพิมพ์
http://192.168.1.1:8081/ ใน ie ครับ ก็จะขึ้นข้อความว่า lighttpd server is running. แสดงว่าตอนนี้เราสามารถรัน webserver ได้แล้ว
3.ลง php ดังนี้
ipkg install php-fcgi php-mysql
4.ลง phpmyadmin ดังนี้
ipkg install phpmyadmin
5. ก๊อปปี้ไฟล์ torrent-flux.conf ที่ผมแนบไว้ไปใส่ \\192.168.1.1\smbshare
6.สั่งย้าย ไฟล์ torrent-flux.conf ไปไว้ใน system ด้วยคำสั่ง
mv /opt/share/torrent-flux.conf /opt/etc/lighttpd/
7.แก้ port lighttpd
vi /opt/etc/lighttpd/lighttpd.conf ให้แก้ port เป็น server.port = 8082
แก้เสร็จให้เซพด้วย :wq!
8.save and reboot
flashfs save && flashfs commit && flashfs enable && reboot
9.สั่งรัน php and webserver
/opt/sbin/lighttpd -f /opt/etc/lighttpd/torrent-flux.conf
10.ทดสอบ phpmyadmin ด้วยการ เปิด ie
http://192.168.1.1:8081/phpmyadmin/
11.การสั่งให้ auto run php ทุกครั้งที่ reboot
vi /usr/local/sbin/post-boot ให้ใส่
/opt/sbin/lighttpd -f /opt/etc/lighttpd/torrent-flux.conf บรรทัดต่อจาก swapon /dev/discs/disc0/part1 ดังรูป แล้วก็เซพคำสั่งทุกครั้งด้วย :wq!
ไฟล์ torrent-flux.conf
ดาวน์โหลด
http://wl500gp.sirikasedpan.com/download.php?id=38
เย้ๆๆ เส็ดแระ สามารถรัน phpmyadmin ได้แระ
วิธีทำให้ php autorun
หลังจากที่เราสามารถรัน mysql ได้แล้วนั้นก็ให้ไป download ตัวโปรแกรม torrent flux ได้ที่ นี่ครับ หลังจากนั้นก็เอาไฟล์ที่โหลดมาไปใส่ที่ Folder www ใน //192.168.1.1/smbshare/www แระสั่ง setup โปรแกรมผ่านหน้า ie เช่น
//192.168.1.1/html เป็นต้น ต้องขอโทดทีที่ไม่มีรูปให้ดู เนื่องด้วยตอนนี้ผมไม่ได้ใช้ torrent flux แล้วอะครับ เนื่องจากเวลาไฟดับมันจะไม่ ดาวโหลดไฟล์ให้ต่ออัตโนมัติ เลยไม่ได้ใช้ แต่ถ้าคัยอยากลองใช้ดูก็ได้นะครับ
สำคัญมากต้องทำการแก้ไขไฟล์ เพื่อทำการติดต่อกับฐานข้อมูลก่อน เข้าไปที่ torrentflux ที่โหลดมา > html > config.php ใช้ Notepad เปิด
ตัวอย่างโต๊ตที่ต้องทำการเปลี่ยน
| Code: | /**************************************************************************/
// 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"] = ""; // password for database
/**************************************************************************/ |
ตอนนี้กำลังอยู่ที่ไฟล์ config.php
ทำการเปลี่ยน ก็จะมีแค่นี้แหละ คับ ให้สังเกตุ ดี ๆ ขอผมเป็นอย่างนี้
$cfg["db_type"] = "mysql";
$cfg["db_host"] = "localhost"; ชื่อ โฮสที่ได้ตั้งไว้ไน PHP MyAdimin ส่วนมากจะไม่แก่ไขกันก็จะเป็นอันเดิม
$cfg["db_name"] = "torrentflux"; ชื่อ Data ไม่ต้องเปลี่ยน
$cfg["db_user"] = "admin"; User ของฐานข้อมูล[เปลี่ยนให้ถูก]
$cfg["db_pass"] = "123"; password ของฐานข้อมูล[เปลี่ยนให้ถูก]
จำขั้นตอนนี้ไว้ดี ๆ เพราะจะไป ตั้งค่าที่ PHP MyAdimin ให้ตรงกับ ข้างบน ของไฟล์ config.php
-----------------------------------------------------------------------------------
หลังจากที่ตรวจสอบเสร็จแล้ว ให้เข้าไปที่ PHP MyAdmin 192.168.1.1:8081 หากไม่ได้ทำการเปลี่ยนแปลงหรือแก้ไขจะเป็นประมาณนี้
เข้าไปที่ > ข้อมูลทั่วไปของผู้ใช้ หรือสิทธิ์ > แก้ไขสิทธิ์ >
ชื่อผู้ใช้: admin
รหัสผ่าน: 123
เลือกเก็บของเก่าไว้น่ะ
คลิ๊ก ลงมือ
ไปที่หน้าหลัก ของ PHP MyAdmin ที่หัวข้อ "สร้างฐานข้อมูลใหม่" ทำการพิมพ์ torrentflux ลงไปในช้อง แล้วคลิ๊ก สร้างซะ แล้วเข้าไปที่ฐานข้อมูล ที่เราได้ทำการสร้างขึ้นมาใหม่ คลิ๊ก ที่ขวามือ สังเกตุ ดู torrentflux > แล้วเลือกที่ SQL จะเห็นหน้าต่าง ให้เพืม Code เข้าไป ให้ผู้ติดตั้ง เข้าไปดูในไฟล์ ที่โหลดมา torrentflux
หรือคัดลอง Code นี้เลยก็ได้
| Code: | -- phpMyAdmin SQL Dump
-- --------------------------------------------------------
--
-- Table structure for table `tf_links`
--
CREATE TABLE `tf_links` (
`lid` int(10) NOT NULL auto_increment,
`url` varchar(255) NOT NULL default '',
`sitename` varchar(255) NOT NULL default 'Old Link',
`sort_order` tinyint(3) unsigned default '0',
PRIMARY KEY (`lid`)
) ENGINE=MyISAM;
--
-- Dumping data for table `tf_links`
--
INSERT INTO `tf_links` VALUES (1, 'http://www.torrentflux.com', 'TorrentFlux.com', 0);
-- --------------------------------------------------------
--
-- Table structure for table `tf_log`
--
CREATE TABLE `tf_log` (
`cid` int(14) NOT NULL auto_increment,
`user_id` varchar(32) NOT NULL default '',
`file` varchar(200) NOT NULL default '',
`action` varchar(200) NOT NULL default '',
`ip` varchar(15) NOT NULL default '',
`ip_resolved` varchar(200) NOT NULL default '',
`user_agent` varchar(200) NOT NULL default '',
`time` varchar(14) NOT NULL default '0',
PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tf_messages`
--
CREATE TABLE `tf_messages` (
`mid` int(10) NOT NULL auto_increment,
`to_user` varchar(32) NOT NULL default '',
`from_user` varchar(32) NOT NULL default '',
`message` text,
`IsNew` int(11) default NULL,
`ip` varchar(15) NOT NULL default '',
`time` varchar(14) NOT NULL default '0',
`force_read` tinyint(1) default '0',
PRIMARY KEY (`mid`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tf_rss`
--
CREATE TABLE `tf_rss` (
`rid` int(10) NOT NULL auto_increment,
`url` varchar(255) NOT NULL default '',
PRIMARY KEY (`rid`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
--
-- Dumping data for table `tf_rss`
--
-- --------------------------------------------------------
--
-- Table structure for table `tf_settings`
--
CREATE TABLE `tf_settings` (
`tf_key` varchar(255) NOT NULL default '',
`tf_value` text NOT NULL,
PRIMARY KEY (`tf_key`)
) ENGINE=MyISAM;
--
-- Dumping data for table `tf_settings`
--
INSERT INTO `tf_settings` VALUES ('path', '/usr/local/torrent/');
INSERT INTO `tf_settings` VALUES ('btphpbin', '/var/www/TF_BitTornado/btphptornado.py');
INSERT INTO `tf_settings` VALUES ('btshowmetainfo', '/var/www/TF_BitTornado/btshowmetainfo.py');
INSERT INTO `tf_settings` VALUES ('advanced_start', '1');
INSERT INTO `tf_settings` VALUES ('max_upload_rate', '10');
INSERT INTO `tf_settings` VALUES ('max_download_rate', '0');
INSERT INTO `tf_settings` VALUES ('max_uploads', '4');
INSERT INTO `tf_settings` VALUES ('minport', '49160');
INSERT INTO `tf_settings` VALUES ('maxport', '49300');
INSERT INTO `tf_settings` VALUES ('rerequest_interval', '1800');
INSERT INTO `tf_settings` VALUES ('cmd_options', '');
INSERT INTO `tf_settings` VALUES ('enable_search', '1');
INSERT INTO `tf_settings` VALUES ('enable_file_download', '1');
INSERT INTO `tf_settings` VALUES ('enable_view_nfo', '1');
INSERT INTO `tf_settings` VALUES ('package_ENGINE', 'zip');
INSERT INTO `tf_settings` VALUES ('show_server_load', '1');
INSERT INTO `tf_settings` VALUES ('loadavg_path', '/proc/loadavg');
INSERT INTO `tf_settings` VALUES ('days_to_keep', '30');
INSERT INTO `tf_settings` VALUES ('minutes_to_keep', '3');
INSERT INTO `tf_settings` VALUES ('rss_cache_min', '20');
INSERT INTO `tf_settings` VALUES ('page_refresh', '60');
INSERT INTO `tf_settings` VALUES ('default_theme', 'matrix');
INSERT INTO `tf_settings` VALUES ('default_language', 'lang-english.php');
INSERT INTO `tf_settings` VALUES ('debug_sql', '1');
INSERT INTO `tf_settings` VALUES ('torrent_dies_when_done', 'False');
INSERT INTO `tf_settings` VALUES ('sharekill', '150');
INSERT INTO `tf_settings` VALUES ('tfQManager', '/var/www/TF_BitTornado/tfQManager.py');
INSERT INTO `tf_settings` VALUES ('AllowQueing', '0');
INSERT INTO `tf_settings` VALUES ('maxServerThreads', '5');
INSERT INTO `tf_settings` VALUES ('maxUserThreads', '2');
INSERT INTO `tf_settings` VALUES ('sleepInterval', '10');
INSERT INTO `tf_settings` VALUES ('debugTorrents', '0');
INSERT INTO `tf_settings` VALUES ('pythonCmd', '/usr/bin/python');
INSERT INTO `tf_settings` VALUES ('searchEngine', 'TorrentSpy');
INSERT INTO `tf_settings` VALUES ('TorrentSpyGenreFilter', 'a:3:{i:0;s:2:"11";i:1;s:1:"6";i:2;s:1:"7";}');
INSERT INTO `tf_settings` VALUES ('TorrentBoxGenreFilter', 'a:3:{i:0;s:1:"0";i:1;s:1:"9";i:2;s:2:"10";}');
INSERT INTO `tf_settings` VALUES ('TorrentPortalGenreFilter', 'a:3:{i:0;s:1:"0";i:1;s:1:"6";i:2;s:2:"10";}');
INSERT INTO `tf_settings` VALUES ('enable_maketorrent','0');
INSERT INTO `tf_settings` VALUES ('btmakemetafile','/var/www/TF_BitTornado/btmakemetafile.py');
INSERT INTO `tf_settings` VALUES ('enable_torrent_download','1');
INSERT INTO `tf_settings` VALUES ('enable_file_priority','1');
INSERT INTO `tf_settings` VALUES ('security_code','0');
INSERT INTO `tf_settings` VALUES ('crypto_allowed', '1');
INSERT INTO `tf_settings` VALUES ('crypto_only', '1');
INSERT INTO `tf_settings` VALUES ('crypto_stealth', '0');
-- --------------------------------------------------------
--
-- Table structure for table `tf_users`
--
CREATE TABLE `tf_users` (
`uid` int(10) NOT NULL auto_increment,
`user_id` varchar(32) NOT NULL default '',
`password` varchar(34) NOT NULL default '',
`hits` int(10) NOT NULL default '0',
`last_visit` varchar(14) NOT NULL default '0',
`time_created` varchar(14) NOT NULL default '0',
`user_level` tinyint(1) NOT NULL default '0',
`hide_offline` tinyint(1) NOT NULL default '0',
`theme` varchar(100) NOT NULL default 'mint',
`language_file` varchar(60) default 'lang-english.php',
PRIMARY KEY (`uid`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
--
-- Table structure for table `tf_cookies`
--
CREATE TABLE `tf_cookies` (
`cid` int(10) NOT NULL auto_increment,
`uid` int(10) NOT NULL,
`host` varchar(255) default NULL,
`data` varchar(255) default NULL,
PRIMARY KEY (`cid`)
) ENGINE=MyISAM ; |
และกลับมาที่เดิมเพื่มตรงนี้เข้าไปอีกนิด
| Code: | /*
Run this as the torrentflux user.
Example:
psql -d torrentflux tf_user -p -f pgsql_02_create_tables.sql
*/
CREATE SEQUENCE tf_links_sequence START 1;
CREATE TABLE `tf_links` (
lid integer PRIMARY KEY DEFAULT nextval('tf_links_sequence'),
url varchar(255) NOT NULL default '',
sitename varchar(255) NOT NULL default 'Old Link',
sort_order smallint unsigned default '0',
PRIMARY KEY (`lid`)
);
/* data */
INSERT INTO tf_links VALUES (1, 'http://www.torrentflux.com', 'TorrentFlux.com', 0);
/* -------------------------------------------------------- */
/* Table structure for table `tf_log` */
CREATE SEQUENCE tf_log_sequence START 1;
CREATE TABLE tf_log (
cid integer PRIMARY KEY DEFAULT nextval('tf_log_sequence'),
user_id varchar(32) NOT NULL DEFAULT '',
file varchar(200) NOT NULL DEFAULT '',
action varchar(200) NOT NULL DEFAULT '',
ip varchar(15) NOT NULL DEFAULT '',
ip_resolved varchar(200) NOT NULL DEFAULT '',
user_agent varchar(200) NOT NULL DEFAULT '',
time varchar(14) NOT NULL DEFAULT '0'
);
/* Table structure for table `tf_messages` */
CREATE SEQUENCE tf_messages_sequence START 1;
-- column 'new' is now 'IsNew'
CREATE TABLE tf_messages (
mid integer PRIMARY KEY default nextval('tf_messages_sequence'),
to_user varchar(32) NOT NULL default '',
from_user varchar(32) NOT NULL default '',
message text,
IsNew integer NOT NULL default '1',
ip varchar(15) NOT NULL default '',
time varchar(14) NOT NULL default '0',
force_read smallint default '0'
);
/* Table structure for table `tf_rss` */
CREATE SEQUENCE tf_rss_sequence START 1;
CREATE TABLE tf_rss (
rid integer PRIMARY KEY default nextval('tf_rss_sequence'),
url varchar(255) NOT NULL default ''
);
/* Table structure for table `tf_settings` */
CREATE TABLE tf_settings (
tf_key varchar(255) PRIMARY KEY NOT NULL default '',
tf_value text NOT NULL
);
/* data */
INSERT INTO tf_settings VALUES ('path', '/usr/local/torrent/');
INSERT INTO tf_settings VALUES ('btphpbin', '/var/www/TF_BitTornado/btphptornado.py');
INSERT INTO tf_settings VALUES ('btshowmetainfo', '/var/www/TF_BitTornado/btshowmetainfo.py');
INSERT INTO tf_settings VALUES ('advanced_start', '1');
INSERT INTO tf_settings VALUES ('max_upload_rate', '10');
INSERT INTO tf_settings VALUES ('max_download_rate', '0');
INSERT INTO tf_settings VALUES ('max_uploads', '4');
INSERT INTO tf_settings VALUES ('minport', '49160');
INSERT INTO tf_settings VALUES ('maxport', '49300');
INSERT INTO tf_settings VALUES ('rerequest_interval', '1800');
INSERT INTO tf_settings VALUES ('cmd_options', '');
INSERT INTO tf_settings VALUES ('enable_search', '1');
INSERT INTO tf_settings VALUES ('enable_file_download', '1');
INSERT INTO tf_settings VALUES ('package_type', 'zip');
INSERT INTO tf_settings VALUES ('show_server_load', '1');
INSERT INTO tf_settings VALUES ('loadavg_path', '/proc/loadavg');
INSERT INTO tf_settings VALUES ('days_to_keep', '30');
INSERT INTO tf_settings VALUES ('minutes_to_keep', '3');
INSERT INTO tf_settings VALUES ('rss_cache_min', '20');
INSERT INTO tf_settings VALUES ('page_refresh', '60');
INSERT INTO tf_settings VALUES ('default_theme', 'matrix');
INSERT INTO tf_settings VALUES ('default_language', 'lang-english.php');
INSERT INTO tf_settings VALUES ('debug_sql', '1');
INSERT INTO tf_settings VALUES ('torrent_dies_when_done', 'False');
INSERT INTO tf_settings VALUES ('sharekill', '150');
INSERT INTO tf_settings VALUES ('tfQManager', '/var/www/TF_BitTornado/tfQManager.py');
INSERT INTO tf_settings VALUES ('AllowQueing', '0');
INSERT INTO tf_settings VALUES ('maxServerThreads', '5');
INSERT INTO tf_settings VALUES ('maxUserThreads', '2');
INSERT INTO tf_settings VALUES ('sleepInterval', '10');
INSERT INTO tf_settings VALUES ('debugTorrents', '0');
INSERT INTO tf_settings VALUES ('pythonCmd', '/usr/bin/python');
INSERT INTO tf_settings VALUES ('searchEngine', 'TorrentSpy');
INSERT INTO tf_settings VALUES ('TorrentSpyGenreFilter', 'a:3:{i:0;s:2:"11";i:1;s:1:"6";i:2;s:1:"7";}');
INSERT INTO tf_settings VALUES ('TorrentBoxGenreFilter', 'a:3:{i:0;s:1:"0";i:1;s:1:"9";i:2;s:2:"10";}');
INSERT INTO tf_settings VALUES ('TorrentPortalGenreFilter', 'a:3:{i:0;s:1:"0";i:1;s:1:"6";i:2;s:2:"10";}');
INSERT INTO tf_settings VALUES ('enable_maketorrent','0');
INSERT INTO tf_settings VALUES ('btmakemetafile','/var/www/TF_BitTornado/btmakemetafile.py');
INSERT INTO tf_settings VALUES ('enable_torrent_download','1');
INSERT INTO tf_settings VALUES ('enable_file_priority','1');
INSERT INTO tf_settings VALUES ('security_code','0');
/* -------------------------------------------------------- */
/* Table structure for table `tf_users` */
CREATE SEQUENCE tf_users_sequence START 1;
CREATE TABLE tf_users (
uid integer PRIMARY KEY default nextval('tf_users_sequence'),
user_id varchar(32) NOT NULL default '',
password varchar(34) NOT NULL default '',
hits integer NOT NULL default '0',
last_visit varchar(14) NOT NULL default '0',
time_created varchar(14) NOT NULL default '0',
user_level smallint NOT NULL default '0',
hide_offline smallint NOT NULL default '0',
theme varchar(100) NOT NULL default 'mint',
language_file varchar(60) default 'lang-english.php'
);
/* Table structure for table `tf_cookies` */
CREATE SEQUENCE tf_cookies_sequence START 1;
CREATE TABLE tf_cookies (
cid integer PRIMARY KEY default nextval('tf_cookies_sequence'),
uid integer NOT NULL,
host varchar(255) default NULL,
data varchar(255) default NULL
);
|
เสร็จสินการติดตั้ง แล้วทำการตรวจสอบว่าไฟล์ได้อยู่ในwww ใน //192.168.1.1/smbshare/www/torrentflux/index.php
ประมาณนี้ จะไม่เหมือนกันน่ะคับ แต่ตัวอย่างจะเป็นประมาณนี้ คือหาไฟล์ Index.php ให้เจอร์ใน torrentflux แล้วรันซะ
ถูกต้องจะปรากฤหน้าต่างของ torrentflux ระหัสเข้าใช้งานคือ Admin , 123 เข้าจัดการไฟล์ได้เลยคับ เสร็จสิ้นขั้นตอน ทั้งหมดโหลดไฟล์ได้เลยคับ ใช้ดีมาก ถือว่าดีที่สุดในโปรแกรมโหลด บิท เลยล่ะขอแนะนำลูกเล่นก็มากด้วย ลองเอาไปใช้กันดุ
หากลงไม่ได้เอามาเดียวลงให้ [จบ]
สุดท้านนี้ : รอให้ผู้รู้ สอนวิธีการลง Proxy Server อยู่น่ะคับ หากเป็นรีนุกอื่นทำได้แต่ รีนุก ไอ้ตัวนี้ ทำไม่เป็นเพราะคำสั่งมันแปลก ๆ ขอความช่วยเหลือด้วยขอรับ
เครติด 095817782 ขอคุณคับ |
|