This is a beginners step-by-step guide on how can you enhance your DNS-323 box with fun_plug tweaking.
This guide supposes 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).
Don't forget to substitute all IP addresses and passwords mentioned below to your environment.
# cd /mnt/HD_a2 # rm -r ffp # rm ffp.log # rm fun_plug # reboot
See details at http://wiki.dns323.info/howto:fun_plug (chapter Transfer using FTP)
$ mkdir fp; cd fp
$ 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
$ 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
See details at http://nas-tweaks.net/CH3SNAS:Tutorials/fun_plug
/ # pwconv / # passwd (enter 'adminpwd' as mentioned before) / # usermod -s /ffp/bin/sh root / # store-passwd.sh
/ # chmod a+x /ffp/start/sshd.sh / # sh /ffp/start/sshd.sh start
$ ssh -l root 10.10.10.123 root@10.10.10.123's password: 'adminpwd' root@joes_nas:~#
root@joes_nas:~# /ffp/start/telnetd.sh stop root@joes_nas:~# chmod -x /ffp/start/telnetd.sh
See at http://nas-tweaks.net/CH3SNAS:Tutorials/ffp-packages See at http://ffp.wolf-u.li/additional/
It appears that inreto.de is no longer accepting connections via rsync. The following commands are no longer working. If they do not work for you, you can download the packages by some other means (such as wget).
$ ssh -l root 10.10.10.123 cd /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 .
Note, if you are using the 0.7 version the command is:
rsync -av --delete inreto.de::dns323/fun-plug/0.7/XXXXXXXXXXXXXX/packages/
Were XXXXXXXXXXXXXX is the architecture of your NAS
# funpkg -i /mnt/HD_a2/ffp/pkg/additional/app-misc/mc-*.tgz
See a complete Tutorial at http://nas-tweaks.net/CH3SNAS:Tutorials/ntp 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
It is recommended to change drift file path in /ffp/start/ntpd.sh file to /tmp/ntp.drift. Otherwise drive won't go to stand by anymore. @yozik04
See a complete Tutorial at http://nas-tweaks.net/CH3SNAS:Tutorials/lighttpd See at http://wiki.dns323.info/howto:lighttpd_php (chapter Easy Ways )
See at http://wiki.dns323.info/howto:ffp (chapter Lighttpd Web Server)
# 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
# cd /ffp/etc # cp examples/lighttpd.conf /ffp/etc/lighttpd.conf # chmod a+x /ffp/start/lighttpd.sh
# groupadd www-data # useradd -g www-data www-data # sed -i s/#server.username.*/'server.username = "www-data"'/ /ffp/etc/lighttpd.conf # sed -i s/#server.groupname.*/'server.groupname = "www-data"'/ /ffp/etc/lighttpd.conf # chown root:www-data /mnt/HD_a2/www/logs/ # chmod 774 /mnt/HD_a2/www/logs/
# sh /ffp/start/lighttpd.sh start
See a complete Tutorial at http://nas-tweaks.net/CH3SNAS:Tutorials/php See at http://forum.dsmg600.info/viewtopic.php?id=3466
# funpkg -i /ffp/pkg/additional/dev-lang/php-*.tgz # funpkg -i /ffp/pkg/additional/net-misc/curl-*.tgz
# funpkg -i /ffp/pkg/packages/php-*.txz # funpkg -i /ffp/pkg/packages/curl-*.txz
# cp /ffp/etc/examples/lighttpd.conf-with-php /ffp/etc/lighttpd.conf # sed -i s/#server.username.*/'server.username = "www-data"'/ /ffp/etc/lighttpd.conf # sed -i s/#server.groupname.*/'server.groupname = "www-data"'/ /ffp/etc/lighttpd.conf
# cp /ffp/etc/examples/php.ini-dist /ffp/etc/php.ini
# cp /ffp/etc/examples/php.ini-production /ffp/etc/php.ini
# echo "<?php phpinfo(); ?>" > /mnt/HD_a2/www/pages/a.php # sh /ffp/start/lighttpd.sh restart
See a complete Tutorial at http://nas-tweaks.net/CH3SNAS:Tutorials/Mysql See at http://forum.dsmg600.info/viewtopic.php?id=3466
# 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
# funpkg -i /ffp/pkg/packages/mysql-*.txz
# 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. This line is under the Paths and Directories heading, which is 42% of the way through the file.
;extension_dir = "./"
Below it, add a new extension directory path. (fun_plug 0.5)
extension_dir = "/ffp/lib/php/extensions/no-debug-non-zts-20060613/"
Below it, add a new extension directory path. (fun_plug 0.7)
extension_dir = "/ffp/lib/php/extensions/no-debug-non-zts-20090626/"
# cp /ffp/etc/examples/my.cnf /ffp/etc/.
# cp /ffp/etc/examples/mysql/my-small.cnf /ffp/etc/my.cnf
# The MySQL server [mysqld] port = 3306 socket = /ffp/var/run/mysql/mysql.sock skip-locking key_buffer_size = 16K
# The MySQL server [mysqld] port = 3306 socket = /ffp/var/run/mysql/mysql.sock datadir = /ffp/var/lib/mysql skip-external-locking key_buffer_size = 16K
Create space for logs, then initialize the data directory. (fun_plug 0.7)
# mkdir -p /srv/mysql # mysql_install_db --datadir=/ffp/var/lib/mysql
Prepare MySQL. Be careful, initial password setting is possible only at the first time
# sh /ffp/start/mysqld.sh start # mysql_secure_installation
# /ffp/bin/mysql -uroot -p mysql> show databases; mysql> use mysql; mysql> show tables; mysql> select host, user, password from user;
# sh /ffp/start/lighttpd.sh restart
Navigate browser to http://10.10.10.123:8080/a.php and see mysql section at the page
See http://nas-tweaks.net/96/installation-and-configuration-of-mysql-on-fonz-fun_plug/#Allowing_external_access
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
# /ffp/bin/mysql -uroot -p mysql> GRANT ALL ON *.* TO root@'10.10.10.150'IDENTIFIED BY 'put-your-root-password-here' ; mysql> FLUSH PRIVILEGES;
# /ffp/bin/mysql -uroot -p 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' ); mysql> FLUSH PRIVILEGES;
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.