I bought a TS-101 a pretty long time ago, but never really used it, recently i got it back out its box and decided to have a play with it.
Before i begin id just like to say please contact me if you know any more about the QNAP TS-101, or sign up and submit an article, we are always looking for new articles.
I dont know what most people would use this for, it has a lot of useful features built in, but i decided to use it to store all my films, music, tv shows etc in a central place that could be accessed by anyone on the network.
I have a pretty large DVD collection, but i tend to leave them lying about and they get scratched, so i like to download copies of the films i own (lets face it, p2p downloads are a lot quicker and simpler than trying to rip the DVD’s yourself), which gave me a great idea, the TS-101 was a built in webserver, with PHP, i decide to download some kind of cataloguing script where i could add the movies i had on the NAS and it would grab information about it from imdb.
Which led me to 2 programs and my first issues with the TS-101, the two programs i found that would fit the bill were VCD-db from http://vcddb.konni.com/ this runs on PHP5 and supports a multitude of databases, orange isnt everybodys color (nor mine) but i think this app looks gorgeous, the other app was VideoDB from http://sourceforge.net/projects/videodb/ now this app isnt as pretty maybe, but it does have a LOT of things in its favor, it runs on PHP4 with MySQL… so whats my problem? The TS-101 Webserver has PHP4 and SQlite…
Damnit… VCD-db fills the SQlite tickbox but not the PHP4 wheres VideoDB is the opposite, so i decided to look into modding the TS-101 myself, at the time of writing, i still havent managed to get either app working on the TS-101, but i HAVE found several interesting things out.
*Update* Following the MySQL update at the bottom of this article, i have now managed to install VideoDB
First things first, connecting to the TS-101, i figured there must be some way to connect to it, after searching for a while i found reference to enabling the Telnet port by doing some MD5 hashing on blah blah blah… it didnt work, maybe i did something wrong, it doesnt really matter, what i have found is the best way is to use a firmware with the Telnet already enabled, i have uploaded 2 firmwares in the downloads section, the 2.0.0 firmware from progressive, and the Optware firmware, personally i use the Optware firmware, the packages are in the unstable status, but its so much more interesting.
To Telnet to the TS-101 i recommend using PuTTy, again you can get this from the download section, dont even bother using Windows… telnet on port 13131.
Once you are in its time to do something, lol, i found a lot of information on creating a build environment to compile new programs from http://scratchpad.wikia.com/wiki/Open_Turbostation:Software about creating a cross compiler, using cygwin, colinux, etc, but basically the easiest way to set up a uclibc build enviroment is as follows.
1) Download the tarball from here
2) Copy the tarball to a Qnap share directory (e.g. Qweb)
3) Telnet in as administrator
4) Unpack the tarball tar -xvjf ppc.rootfs.tar.bz2
5) Mount the new directory mount -t proc none loopmount/proc
6) Now log into the new filesystem chroot loopmount /bin/bash
You should now have a fully functional build environment which also includes C/C++, awk etc. This environment can now be used to build packages, with the correct shared library support. Once you have built your code, it can be used in the normal Qnap environment. Currently the Qnap runs its OS in Ram drive, so what does that mean to us? Any changes are lost at reboot! To return to the environment it is necessary relogin as administrator, navigate to the location of the dir to be loopmounted, and re-issue the mount and chroot commands.
Doing it this way i managed to get a fair amount of packages compiled, however, remember, the TS-101 is not a Dual Core processor with 2GB of memory… compiling new packages takes a while… a LONG while, up to several hours depending on the packages, and after waiting all that time, if something doesnt work quite right, its VERY frustrating, i eventually managed to get Apache2, MySQL5 and PHP5 installed after 2 days of changing configs, doing everything i could think of, and then when i tried to start Apache it said it couldnt find the libphp5.so, i checked the dir it was looking in, and it was definately there… i wanted to kill someone at this point, lol.
The alternative is Optware.. and in comparison its like heaven, lol.
To install it simply download the firmware from the downloads section, then in the QNAP web administration panel go to updating the system, update the firmware, browse for the downloaded firmware and apply it.
Once the system has rebooted, just telnet to port 13131 and you’re set, to get a list of available packages type ipkg list to install a package ipkg install [pkg name] to remove a package ipkg remove [pkg name] to get more options type ipkg –help the only probelm is these are unstable, and not all of them work, i got nano, thttpd and php installed, however installing php-thttpd (to get thttpd with php) would not work, php-apache seemed to run but wouldnt serve php pages, so its a bit hit and miss, but its a lot more fun to play with, and hopefully these issues will be addressed at some point.
*Update: MySQL*
While looking on the yahoo group i found a way to install MySQL, so here it is.
1) Telnet to the TS-101
2) Create MySQL Share Dir: mkdir /share/HDA_DATA/MySQL
3) Link share: ln-s /share/HDA_DATA/MySQL /share/MySQL
4) chmod 777 /share/HDA_DATA/MySQL
5) Upload the MySQL Package from here to the MySQL Folder.
6) cd /share/HDA_DATA/MySQL
7) tar xf mysql-4.1.21-TS-101-v0.1.tar
/share/MySQL/install.sh /share/MySQL/mysql-4.1.21-TS-101.tgz /share/MySQL
9) /usr/local/mysql/mysqld.sh start
10) Try to connect MySQL /usr/local/mysql/bin/mysql mysql -u root –password=admin if it works… congrats
Note:
1. File path
MySQL files including execution and library files are installed into /share/MySQL/mysql
MySQl database are stored in /share/MySQL/mysqldb
2. Because the link, /usr/local/mysql will be removed after rebooting, you have to input the following command to make the mysql link after every reboot.
ln -s /share/HDA_DATA/MySQL /share/MySQL
ln -sf /share/MySQL/mysql /usr/local/mysql
/usr/local/mysql/mysqld.sh start
3. You may also start/stop MySQL through web (login as administrator):
http://IP_OF_YOUR_NAS_SERVER:6000/cgi-bin/MySQL/mysql.cgi
After rebooting every time, the following commands are needed to be input to enable the MySQL web.
ln -sf /share/MySQL/webpage /home/httpd/cgi-bin/MySQL
chmod 755 /home/httpd/cgi-bin/MySQL/mysql.cgi
Links:
http://scratchpad.wikia.com/wiki/Open_Turbostation
http://vcddb.konni.com/
http://sourceforge.net/projects/videodb/
http://www.qnap.com.tw/
http://www.nslu2-linux.org/wiki/Optware/HomePage
http://tech.groups.yahoo.com/group/OpenTurbostation
#NormalPeopleHateMe on Undernet
May 23rd, 2008 at 1:16 pm
Thx for this very nice article.
But I have a problem with optware. I followed your instructions for installing optware over a firmware update. At the point I run the command: # ipkg -help, the error messege told me: “-sh: ipkg: not found”
could you tell me what my fault was? Befor this, I run the installation with untar the optware packege, same result.
Christian