This is an old revision of the document!
1st little steps
This is a step-by-step guide on what can you do with your DNS-323 box, if you try fun_plug tweaking.
This guide suppose you use Unix/Linux desktop (altough, with very small effort it is usable for windows users as well, if using putty ssh/telnet application) with IP address 10.10.10.150.
It is assumed that your NAS device is plugged into home network 10.10.10.0/24, having DHCP server turned on.
It is assumed that your NAS device has gotten the 10.10.10.1 IP address from DHCP server (later this address will be changed to 10.10.10.123, or whatever by your choice).
Step 0. Clean from previous fun_plug
- Attach shared root folder, and delete files ffp.log, fun_plug and folder ffp.
- Alternatively you can telnet or ssh to nas, if you can.
# cd /mnt/HD_a2 # rm -r ffp # rm ffp.log # rm fun_plug # reboot
Step 1. HW reset
- Turn the device on and wait for leds constantly glowing. Then push thin wire to reset hole, hold for at least 10s, and release the wire.
- Wait for leds constantly glowing again.
- Check what IP address is assigned to DNS-323 (read it from your dhcp server, or try ping through DHCP range).
- Put the DHCP assigned IP address into browser (assumed http://10.10.10.1)
Step 2. The very first init
- Login (user:'admin', pwd:'')
- Menu Setup/Wizard/, [Run Wizard]
- [Next]
- Enter admin password: 'adminpwd', [Next]
- Enter timezone +1, [Next]
- Switch to Static IP and fill with '10.10.10.123' address, [Next]
- Name 'joesnas', [Next]
- [Completed]
- Wait 1-2 minutes, until browser reloads with new IP address to login window.
Step 3. Prepare Ftp server for FunPlug
- Login to browser page
http://10.10.10.123, user:'admin', password:'adminpwd' - Menu Advanced/UserGroups:
User Name: 'joe'
password: 'joepwd'
[Add] - Menu Advanced/FTP Server:
User: 'joe'
Folder: 'Root' checked
Permission: 'R/W Read/Write'
[Add], - Client language: (choose what best fits to your country; in doubts use Unicode),
[Apply] - [Start FTP Server]
Step 4. Install FunPlug with Telnet enabled
See details at http://wiki.dns323.info/howto:fun_plug (chapter Transfer using FTP)
- In your linux desktop, make folder fp and cd to fp
$ mkdir fp; cd fp
- Download http://www.inreto.de/dns323/fun-plug/0.5/fun_plug, http://www.inreto.de/dns323/fun-plug/0.5/fun_plug.tgz
$ wget http://www.inreto.de/dns323/fun-plug/0.5/fun_plug ; chmod 777 fun_plug $ wget http://www.inreto.de/dns323/fun-plug/0.5/fun_plug.tgz ; chmod 777 fun_plug.tgz
- In fp folder, use FTP and put files into root folder
$ ftp 10.10.10.123 Name (10.10.10.123): joe 331 User joe OK. Password required Password: joepwd ftp> cd Volume_1 ftp> bin ftp> mput fun* mput fun_plug? y mput fun_plug.tgz? y ftp> chmod 777 fun_plug ftp> bye
- Login to browser page
http://10.10.10.123, user:'admin', password:'adminpwd' - Menu Tools/System, button [Restart]
- Wait about 1-2 minutes after leds are constantly glowing again (time taken by fun_plug first installing)
Step 5. Enable SSH, disable Telnet
See details at http://nas-tweaks.net/CH3SNAS:Tutorials/fun_plug
- Telnet to 10.10.10.123
- Prepare root login
/ # pwconv / # passwd (enter 'adminpwd' as mentioned before) / # usermod -s /ffp/bin/sh root / # store-passwd.sh
- Activate ssh
/ # chmod a+x /ffp/start/sshd.sh / # sh /ffp/start/sshd.sh start
- Use ssh to connect from your machine (Linux assumed, but putty is possible also for Windows)
$ ssh -l root 10.10.10.123 root@10.10.10.123's password: 'adminpwd' root@joes_nas:~#
- Deactivate telnet
root@joes_nas:~# chmod -x /ffp/start/telnetd.sh root@joes_nas:~# reboot
- Wait about 1-2min after leds are constantly glowing (this is the delay after which sshd will start)
Step 6. Install repository for local use
See at http://nas-tweaks.net/CH3SNAS:Tutorials/ffp-packages See at http://ffp.wolf-u.li/additional/
$ ssh -l root 10.10.10.123 # cd /mnt/HD_a2/ffp/ # mkdir pkg ; cd pkg ; rsync -av --delete inreto.de::dns323/fun-plug/0.5/packages . # rsync -av --delete wolf-u.li::ffp/additional . # rsync -av --delete inreto.de::dns323/fun-plug/0.5/extra-packages .
Step 7. Install MidnightCommander
# cd /mnt/HD_a2/ffp/pkg/additional/app-misc ; funpkg -i mc-4.1.40-pre9-1.tgz
Step 8. Install NTP Time synchronisation
See at http://wiki.dns323.info/howto:ffp (chapter NTP Network Time Protocol)
# cd /ffp/etc # cp examples/ntp.conf . # chmod a+x /ffp/start/ntpd.sh # sh /ffp/start/ntpd.sh start # ntpq -p
Step 9. Install Lighttpd web server
See at http://wiki.dns323.info/howto:lighttpd_php (chapter Easy Ways )
See at http://wiki.dns323.info/howto:ffp (chapter Lighttpd Web Server)
- Prepare www store
# cd /mnt/HD_a2 # mkdir -p www/logs www/pages # echo "<html> <head><title></title></head>" > /mnt/HD_a2/www/pages/index.html # echo "<body> Lighttpd is OK and running </body> </html>" >> /mnt/HD_a2/www/pages/index.html
- Prepare server
# cd /ffp/etc # cp examples/lighttpd.conf /ffp/etc/lighttpd.conf # chmod a+x /ffp/start/lighttpd.sh # sh /ffp/start/lighttpd.sh start
- Test webserver
Navigate browser to http://10.10.10.123:8080 and read the page
Step 10. Add PHP packages into to Lighttpd
See at http://forum.dsmg600.info/viewtopic.php?id=3466
- Install PHP
# cd /mnt/HD_a2/ffp/pkg # wget http://81.216.140.39/dns-323/mysql_and_php/php-5.2.6-mysql51-1.tgz # funpkg -i php-5.2.6-mysql51-1.tgz
- Prepare webserver for PHP
# cp /ffp/etc/examples/lighttpd.conf-with-php /ffp/etc/lighttpd.conf # cp /ffp/etc/examples/php.ini-dist /ffp/etc/php.ini # echo "<? phpinfo(); ?>" > /mnt/HD_a2/www/pages/a.php # /ffp/start/lighttpd.sh restart
- Test PHP in webserver
Navigate browser to http://10.10.10.123:8080/a.php and read the page
Step 11. Add MySql packages into to Lighttpd
See at http://forum.dsmg600.info/viewtopic.php?id=3466
- Install MySql
# cd /mnt/HD_a2/ffp/pkg # wget http://81.216.140.39/dns-323/mysql_and_php/mysql-5.1.28-rc-1.tgz # funpkg -i mysql-5.1.28-rc-1.tgz
- Prepare PHP for MySql
# echo extension=mysql.so >> /ffp/etc/php.ini # echo extension=pdo.so >> /ffp/etc/php.ini # echo extension=pdo_mysql.so >> /ffp/etc/php.ini # vi /ffp/etc/php.ini
comment extension dir line
;extension_dir = "./"
and below that, add extension dir with path /ffp/lib/php/extensions/no-debug-non-zts-20060613/
extension_dir = "/ffp/lib/php/extensions/no-debug-non-zts-20060613/"
- Prepare MySQL. Be careful, initial password setting is possible only at the first time
# cp /ffp/etc/examples/my.cnf /ffp/etc/. # sh /ffp/start/mysqld.sh start # /ffp/bin/mysqladmin -u root password 'toor' # /ffp/bin/mysqladmin -u root -h joesnas password 'toor' # mysql_install_db
- Test MySQL local connection
# /ffp/bin/mysql -uroot -ptoor mysql> show databases; mysql> use mysql; mysql> show tables; mysql> select host, user, password from user;
- Test MySQL presence in lighttpd server
# sh /ffp/start/lighttpd.sh restart
Navigate browser to http://10.10.10.123:8080/a.php and see mysql section at the page
Step 12. Allow remote connection to MySql
See http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
See http://forums.mysql.com/read.php?108,62926,199511
- Allow user 'root' to connect remotely, for instance to administrate MySQL with graphical tools (SQLYog mysqladmin)
# /ffp/bin/mysql -uroot -ptoor mysql> GRANT ALL ON *.* TO root@'10.10.10.150'IDENTIFIED BY 'toor' ; mysql> FLUSH PRIVILEGES;
- Add new user with strictly defined rights
# /ffp/bin/mysql -uroot -ptoor mysql> INSERT INTO mysql.user ( HOST, USER, PASSWORD, select_priv, insert_priv, update_priv, delete_priv, create_priv, drop_priv, reload_priv, shutdown_priv, process_priv, file_priv, grant_priv, references_priv, index_priv, alter_priv, show_db_priv, super_priv, create_tmp_table_priv, lock_tables_priv, execute_priv, repl_slave_priv, repl_client_priv, create_view_priv, show_view_priv, create_routine_priv, alter_routine_priv, create_user_priv, event_priv, trigger_priv ) VALUES ( '%', 'john', PASSWORD('johnpwd'), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y' );
Command allows user 'John' to login with password 'johnpwd' from any IP ('%'), and do defined activities (e.g. all, in this case).
This command is just an example, DO NOT USE IT IN PRODUCTION ENVIRONMENT - IT IS TOO VULNERABLE !!! First, let 'Y' only with parameters you really need.
Or better, forget about it, and connect DB with SqlYog software, where is better command understanding in its GUI.