Differences
This shows you the differences between the selected revision and the current version of the page.
howto:1st_steps 2010/01/05 00:00 | howto:1st_steps 2018/02/12 02:17 current | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== 1st little steps ====== | ====== 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 is a beginners step-by-step guide on how can you enhance your **DNS-323** box with **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**. | + | 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). | + | 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 ===== | + | Don't forget to substitute all IP addresses and passwords mentioned below to your environment. |
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Step 0.(optional) Clean from previous fun_plug ===== | ||
* Attach shared root folder, and delete files **ffp.log**, **fun_plug** and folder **ffp**. | * Attach shared root folder, and delete files **ffp.log**, **fun_plug** and folder **ffp**. | ||
Line 20: | Line 33: | ||
# reboot | # reboot | ||
</code> | </code> | ||
+ | |||
===== Step 1. HW reset ===== | ===== Step 1. HW reset ===== | ||
Line 25: | Line 39: | ||
* 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. | * 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. | * 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). | + | * 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) | * Put the DHCP assigned IP address into browser (assumed http://10.10.10.1) | ||
+ | |||
Line 42: | Line 57: | ||
* Wait 1-2 minutes, until browser reloads with new IP address to login window. | * Wait 1-2 minutes, until browser reloads with new IP address to login window. | ||
+ | * Make sure there is at least one drive in the NAS and it has been formatted. | ||
Line 52: | Line 68: | ||
* Client language: (choose what best fits to your country; in doubts use Unicode), \\ [//Apply//] | * Client language: (choose what best fits to your country; in doubts use Unicode), \\ [//Apply//] | ||
* [//Start FTP Server//] | * [//Start FTP Server//] | ||
+ | |||
Line 87: | Line 104: | ||
* Login to browser page \\ http://10.10.10.123, user:'admin', password:'adminpwd' | * Login to browser page \\ http://10.10.10.123, user:'admin', password:'adminpwd' | ||
* Menu **Tools/System**, button [//Restart//] | * Menu **Tools/System**, button [//Restart//] | ||
- | * Wait 1-2 minutes after leds are constantly glowing again (time taken by fun_plug first installing) | + | * Wait about 1-2 minutes after leds are constantly glowing again (time taken by fun_plug first installing) |
===== Step 5. Enable SSH, disable Telnet ===== | ===== Step 5. Enable SSH, disable Telnet ===== | ||
Line 113: | Line 129: | ||
* Deactivate telnet <code> | * Deactivate telnet <code> | ||
+ | root@joes_nas:~# /ffp/start/telnetd.sh stop | ||
root@joes_nas:~# chmod -x /ffp/start/telnetd.sh | root@joes_nas:~# chmod -x /ffp/start/telnetd.sh | ||
- | root@joes_nas:~# reboot | ||
</code> | </code> | ||
- | * 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 ===== | ||
+ | |||
+ | ===== Step 6. Install repository for local use ===== | ||
See at http://nas-tweaks.net/CH3SNAS:Tutorials/ffp-packages | See at http://nas-tweaks.net/CH3SNAS:Tutorials/ffp-packages | ||
See at http://ffp.wolf-u.li/additional/ | 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). | ||
+ | |||
<code> | <code> | ||
$ ssh -l root 10.10.10.123 | $ ssh -l root 10.10.10.123 | ||
- | # cd /mnt/HD_a2/ffp/ | + | cd /ffp/ |
- | # mkdir pkg ; cd pkg ; rsync -av --delete inreto.de::dns323/fun-plug/0.5/packages . | + | 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 wolf-u.li::ffp/additional . |
- | # rsync -av --delete inreto.de::dns323/fun-plug/0.5/extra-packages . | + | rsync -av --delete inreto.de::dns323/fun-plug/0.5/extra-packages . |
</code> | </code> | ||
+ | |||
+ | Note, if you are using the 0.7 version the command is: | ||
+ | <code> | ||
+ | rsync -av --delete inreto.de::dns323/fun-plug/0.7/XXXXXXXXXXXXXX/packages/ | ||
+ | </code> | ||
+ | |||
+ | Were XXXXXXXXXXXXXX is the architecture of your NAS | ||
===== Step 7. Install MidnightCommander ===== | ===== Step 7. Install MidnightCommander ===== | ||
<code> | <code> | ||
- | # cd /mnt/HD_a2/ffp/pkg/additional/app-misc ; funpkg -i mc-4.1.40-pre9-1.tgz | + | # funpkg -i /mnt/HD_a2/ffp/pkg/additional/app-misc/mc-*.tgz |
</code> | </code> | ||
+ | |||
+ | |||
===== Step 8. Install NTP Time synchronisation ===== | ===== Step 8. Install NTP Time synchronisation ===== | ||
+ | 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) | See at http://wiki.dns323.info/howto:ffp (chapter NTP Network Time Protocol) | ||
Line 147: | Line 176: | ||
</code> | </code> | ||
- | ===== Step 9. Install Lighttpd web server ===== | + | == Fix: HDD stand by issue == |
+ | 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 | ||
+ | == Issue with DNS-313 == | ||
+ | [[http://forum.dsmg600.info/viewtopic.php?id=6157|ntpd seems incompatible with (some versions of?) DNS-313]] | ||
+ | ===== Step 9. Install Lighttpd web server ===== | ||
+ | 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) | See at http://wiki.dns323.info/howto:lighttpd_php (chapter Easy Ways )\\ See at http://wiki.dns323.info/howto:ffp (chapter Lighttpd Web Server) | ||
Line 162: | Line 197: | ||
# cp examples/lighttpd.conf /ffp/etc/lighttpd.conf | # cp examples/lighttpd.conf /ffp/etc/lighttpd.conf | ||
# chmod a+x /ffp/start/lighttpd.sh | # chmod a+x /ffp/start/lighttpd.sh | ||
- | # sh /ffp/start/lighttpd.sh start | ||
</code> | </code> | ||
+ | * Change the user and group the daemon will run as (optional, more secure)<code> | ||
+ | # 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/ | ||
+ | </code> | ||
+ | |||
+ | * Start webserver <code> | ||
+ | # sh /ffp/start/lighttpd.sh start | ||
+ | </code> | ||
* Test webserver \\ Navigate browser to http://10.10.10.123:8080 and read the page | * Test webserver \\ Navigate browser to http://10.10.10.123:8080 and read the page | ||
- | ===== Step 10. Add PHP packages into to Lighttpd ===== | ||
+ | |||
+ | |||
+ | ===== Step 10. Add PHP packages into to Lighttpd ===== | ||
+ | See a complete Tutorial at http://nas-tweaks.net/CH3SNAS:Tutorials/php | ||
See at http://forum.dsmg600.info/viewtopic.php?id=3466 | See at http://forum.dsmg600.info/viewtopic.php?id=3466 | ||
- | * Install PHP <code> | + | * Install PHP (**fun_plug** 0.5) <code> |
- | # cd /mnt/HD_a2/ffp/pkg | + | # funpkg -i /ffp/pkg/additional/dev-lang/php-*.tgz |
- | # wget http://81.216.140.39/dns-323/mysql_and_php/php-5.2.6-mysql51-1.tgz | + | # funpkg -i /ffp/pkg/additional/net-misc/curl-*.tgz |
- | # funpkg -i php-5.2.6-mysql5*.tgz | + | |
</code> | </code> | ||
- | * Prepare webserver for PHP <code> | + | * Install PHP (**fun_plug** 0.7) <code> |
+ | # funpkg -i /ffp/pkg/packages/php-*.txz | ||
+ | # funpkg -i /ffp/pkg/packages/curl-*.txz | ||
+ | </code> | ||
+ | |||
+ | * Prepare webserver for PHP (**fun_plug** 0.5 and **fun_plug** 0.7) <code> | ||
# cp /ffp/etc/examples/lighttpd.conf-with-php /ffp/etc/lighttpd.conf | # 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 | ||
+ | </code> | ||
+ | |||
+ | * Copy the php.ini file (**fun_plug** 0.5) <code> | ||
# cp /ffp/etc/examples/php.ini-dist /ffp/etc/php.ini | # cp /ffp/etc/examples/php.ini-dist /ffp/etc/php.ini | ||
- | # echo "<? phpinfo(); ?>" > /mnt/HD_a2/www/pages/a.php | + | </code> |
- | # /ffp/start/lighttpd.sh restart | + | |
+ | * Copy the php.ini file (**fun_plug** 0.7) <code> | ||
+ | # cp /ffp/etc/examples/php.ini-production /ffp/etc/php.ini | ||
+ | </code> | ||
+ | |||
+ | * Build a test PHP page and restart lighttpd. (**fun_plug** 0.5 and **fun_plug** 0.7) <code> | ||
+ | # echo "<?php phpinfo(); ?>" > /mnt/HD_a2/www/pages/a.php | ||
+ | # sh /ffp/start/lighttpd.sh restart | ||
</code> | </code> | ||
* Test PHP in webserver \\ Navigate browser to http://10.10.10.123:8080/a.php and read the page | * 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 ===== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Step 11. Add MySQL packages into to Lighttpd ===== | ||
+ | See a complete Tutorial at http://nas-tweaks.net/CH3SNAS:Tutorials/Mysql | ||
See at http://forum.dsmg600.info/viewtopic.php?id=3466 | See at http://forum.dsmg600.info/viewtopic.php?id=3466 | ||
- | * Install MySql <code> | + | * Install MySql (**fun_plug** 0.5) <code> |
# cd /mnt/HD_a2/ffp/pkg | # cd /mnt/HD_a2/ffp/pkg | ||
# wget http://81.216.140.39/dns-323/mysql_and_php/mysql-5.1.28-rc-1.tgz | # wget http://81.216.140.39/dns-323/mysql_and_php/mysql-5.1.28-rc-1.tgz | ||
- | # funpkg -i mysql-5.*.tgz | + | # funpkg -i mysql-5.1.28-rc-1.tgz |
</code> | </code> | ||
- | * Prepare PHP for MySql <code> | + | * Install MySql (**fun_plug** 0.7) <code> |
+ | # funpkg -i /ffp/pkg/packages/mysql-*.txz | ||
+ | </code> | ||
+ | |||
+ | * Prepare PHP for MySQL <code> | ||
# echo extension=mysql.so >> /ffp/etc/php.ini | # echo extension=mysql.so >> /ffp/etc/php.ini | ||
# echo extension=pdo.so >> /ffp/etc/php.ini | # echo extension=pdo.so >> /ffp/etc/php.ini | ||
Line 203: | Line 280: | ||
# vi /ffp/etc/php.ini | # vi /ffp/etc/php.ini | ||
- | </code> comment extension dir line <code> | + | </code> |
+ | |||
+ | Comment extension dir line. This line is under the //Paths and Directories// heading, which is 42% of the way through the file.<code> | ||
;extension_dir = "./" | ;extension_dir = "./" | ||
- | </code> and below that, add extension dir with path /ffp/lib/php/extensions/no-debug-non-zts-20060613/ <code> | + | </code> |
+ | |||
+ | Below it, add a new extension directory path. (**fun_plug** 0.5) <code> | ||
extension_dir = "/ffp/lib/php/extensions/no-debug-non-zts-20060613/" | extension_dir = "/ffp/lib/php/extensions/no-debug-non-zts-20060613/" | ||
</code> | </code> | ||
- | * Prepare MySQL. Be careful, initial password setting is possible only at the first time <code> | + | Below it, add a new extension directory path. (**fun_plug** 0.7) <code> |
+ | extension_dir = "/ffp/lib/php/extensions/no-debug-non-zts-20090626/" | ||
+ | </code> | ||
+ | |||
+ | * Copy the my.cnf template. (**fun_plug** 0.5) <code> | ||
# cp /ffp/etc/examples/my.cnf /ffp/etc/. | # cp /ffp/etc/examples/my.cnf /ffp/etc/. | ||
- | # sh /ffp/start/mysqld.sh start | + | </code> |
- | # /ffp/bin/mysqladmin -u root password 'toor' | + | * Copy the my.cnf template. (**fun_plug** 0.7) <code> |
- | # /ffp/bin/mysqladmin -u root -h joesnas password 'toor' | + | # cp /ffp/etc/examples/mysql/my-small.cnf /ffp/etc/my.cnf |
+ | </code> | ||
- | # mysql_install_db | + | * Edit the my.cnf template. Here is how it looks before editing. (**fun_plug** 0.7) |
+ | <code> | ||
+ | # The MySQL server | ||
+ | [mysqld] | ||
+ | port = 3306 | ||
+ | socket = /ffp/var/run/mysql/mysql.sock | ||
+ | skip-locking | ||
+ | key_buffer_size = 16K | ||
</code> | </code> | ||
+ | * This is what it should look like after editing. A //datadir// row has been added, and //skip-locking// has been changed to //skip-external-locking//. (**fun_plug** 0.7) | ||
+ | <code> | ||
+ | # 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 | ||
+ | </code> | ||
+ | |||
+ | Create space for logs, then initialize the data directory. (**fun_plug** 0.7) <code> | ||
+ | # mkdir -p /srv/mysql | ||
+ | # mysql_install_db --datadir=/ffp/var/lib/mysql | ||
+ | </code> | ||
+ | |||
+ | Prepare MySQL. Be careful, initial password setting is possible only at the first time | ||
+ | <code> | ||
+ | # sh /ffp/start/mysqld.sh start | ||
+ | # mysql_secure_installation | ||
+ | </code> | ||
- | * Test mysql local connection <code> | + | * Test MySQL local connection <code> |
- | # /ffp/bin/mysql -uroot -ptoor | + | # /ffp/bin/mysql -uroot -p |
mysql> show databases; | mysql> show databases; | ||
mysql> use mysql; | mysql> use mysql; | ||
Line 228: | Line 342: | ||
</code> | </code> | ||
+ | * Test MySQL presence in lighttpd server <code> | ||
+ | # sh /ffp/start/lighttpd.sh restart | ||
+ | </code> 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 ===== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Step 12. Allow remote connection to MySql ===== | ||
+ | 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 | 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) <code> | * Allow user 'root' to connect remotely, for instance to administrate MySQL with graphical tools (SQLYog mysqladmin) <code> | ||
- | # /ffp/bin/mysql -uroot -ptoor | + | # /ffp/bin/mysql -uroot -p |
- | mysql> GRANT ALL ON *.* TO root@'10.10.10.150'; | + | mysql> GRANT ALL ON *.* TO root@'10.10.10.150'IDENTIFIED BY 'put-your-root-password-here' ; |
mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
</code> | </code> | ||
* Add new user with strictly defined rights <code> | * Add new user with strictly defined rights <code> | ||
- | # /ffp/bin/mysql -uroot -ptoor | + | # /ffp/bin/mysql -uroot -p |
mysql> INSERT INTO mysql.user | 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 ) | ( 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 | 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' ); | ( '%', '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' ); | ||
- | </code>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. | + | mysql> FLUSH PRIVILEGES; |
- | + | </code>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. |