• April 24, 2024, 03:29:13 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: fun_plug (mysql, website, svn)  (Read 22340 times)

icehawk

  • Level 1 Member
  • *
  • Posts: 3
fun_plug (mysql, website, svn)
« on: January 02, 2014, 09:51:27 AM »

Dear All,

I have just bought my first NAS (DNS-320L). My goal was to store my files, and use it as a media server. I have enjoyed it, but few days later I wanted to increase to knowledged of my device. I would have like to use it as an SQL server, and a WEB server.
There are many forums on the Internet which can help for the installation in general (how to install fun_plug, mysql, web) and these forums are more or less useful. Maybe my knowledge was not enough or maybe there is a difference between NAS modells but I had problems during the setup process. I could install the fun_plug, and mysql without problem, but lighttpd was impossible for me. Finally I found a solution which was good for me, and I would like to tell you. Maybe I can help in the future for anyone. When I finished my task, I found an SVN server, and I started to install and using it.

So my soulution is below:
- Copy fun_plug and fun_plug.tgz to your NAS main directory (volume_1)
- Reboot your NAS. If everything is fine, then the fun_plug.tgz file will be removed, and a new ffp directory will be created
- Telnet into your NAS (Windows users can use command prompt, and telnet, then open NAS IP address

- Type the following commands
   usermod -s /ffp/bin/sh root
   mkdir -p /ffp/home/root/
   sed -ie 's#:/home/root:#:/ffp/home/root:#g' /etc/passwd
   pwconv

   (if you see the next messages: “usermod: no changes”, or
   “pwconv: failed to change the mode of /etc/passwd- to 0600
   then don't worry)

   passwd
   login
   
   wget http://wolf-u.li/u/172/ -O /ffp/sbin/store-passwd.sh
   store-passwd.sh

   chmod a+x /ffp/start/sshd.sh
   sh /ffp/start/sshd.sh start

- Login to your NAS with SSL (Windows users can use putty)
- If login was successful, then type the next commands (these will stop the telnet daemon)
   chmod -x /ffp/start/telnetd.sh
   sh /ffp/start/telnetd.sh stop

- Setup the package handler
   wget http://wolf-u.li/u/441 -O /ffp/bin/uwsiteloader.sh
   chmod a+x /ffp/bin/uwsiteloader.sh
   uwsiteloader.sh
   (when you can choose, then choose your favorite package provider. I use fonz, Uli, and Mijzelf)

- Now you are ready to make your NAS as a real home server. My first step is to intall the Midnight commander
   slacker -a uli:glib
   slacker -a mz:mc

- Create some directory (or you can use the newly installed Midnight Commander)
   mkdir -p /ffp/opt/srv
   mkdir -p /ffp/opt/tmp
   mkdir -p /ffp/opt/srv/www/pages
   mkdir -p /ffp/opt/srv/www/logs

- Create a link to your new srv directory (this is a vi version, but you can use MC)
   vi /ffp/etc/fun_plug.init

      # create custom link to the server-folder
      ln -s /ffp/opt/srv/ /srv   

- Copy lighthttpd.conf and mimetypes files from /etc/lighttpd to /ffp/etc/ directory

- Paste the next parameters to the end of the lighttpd.conf file (you can use either vi, or MC)
   
   $HTTP["host"] =~ "mynasname" {
   
      server.document-root = "/srv/www/pages"
   
      accesslog.filename = "/srv/www/logs/mynasname_access.log"

   }

- Start the lighttpd service, and make it as autorun
   chmod a+x /ffp/start/lighttpd.sh
   sh /ffp/start/lighttpd.sh restart
   
   create new file called restartwebs.sh in /ffp/start folder with the following content
   sh /ffp/start/lighttpd.sh restart
   
- Make this file as autorun
   chmod a+x /ffp/start/restartwebs.sh
   

- Install mysql
   slacker -a mysql-5.5
   cp /ffp/etc/examples/mysql/my.cnf /ffp/etc/
   mkdir -p /ffp/opt/srv/mysql
   mkdir -p /ffp/opt/srv/tmp/mysql
   cd /ffp
   mysql_install_db
   vi /ffp/start/mysqld.sh
      (remove --skip-networking text)
   vi /ffp/etc/my.cnf
      (add bind-address = 192.168.1.2 line)
   chmod a+x /ffp/start/mysqld.sh
   /ffp/bin/mysqladmin -u root password 'new-password'
   /ffp/bin/mysqladmin -u root -h 192.168.1.2 password 'new-password'

   mysql -p
   create database NASDB
   GRANT ALL PRIVILEGES ON *.* TO root@'192.168.1.2' IDENTIFIED BY 'user_password';

- Install SVN
   slacker -a subversio*
   slacker -a sqlite
   slacker -a apru* (normal and util)
   svnadmin create /ffp/opt/myrepo

   Edit svnserve.conf file (Add or uncomment the following lines)
   anon-access = none
   auth-access = write
   password-db = passwd
   authz-db = authz
   
   Edit passwd file (add the following line)
   name1 = name2

   Edit authz file (add the following lines)
   [groups]
   name1name2 = name1
   [/]
   * = rw

   svn mkdir file:///ffp/opt/myrepo/myrepo/Fortress
   svn mkdir file:///ffp/opt/myrepo/myrepo/SXD-KV
   sh /ffp/start/svnserve.sh start

   On client side you can connect to the repo via: svn://192.168.1.2
      
I am not a Linxux user, but on Windows: [windows system dir]/system32/drivers/etc/hosts file
You can add a new line with your NAS IP address and the name what you have choosen.
After this you can reach your NAS default web site via the IP address of the device and your private web site with your name

I hope I could help you
Have a nice day
Ice
Logged

sstavross

  • Level 1 Member
  • *
  • Posts: 3
Re: fun_plug (mysql, website, svn)
« Reply #1 on: January 03, 2014, 12:46:50 AM »

Thank you very much for your detailed post! It is really very helpfull! I have just bought a 320L and I have to say that there is a lot of information about funplug, but it is so spreaded that is very difficult to do something, especially if you are not familiar with linux (like me). I am willing to install mediatomb and minidlna. If I find a difficulty I'll ask you if you don't mind.
Now about your post, what exactly is a svn server and what can I do with it? I have not understand its use...
Logged

icehawk

  • Level 1 Member
  • *
  • Posts: 3
Re: fun_plug (mysql, website, svn)
« Reply #2 on: January 03, 2014, 03:19:09 AM »

Hi :)
Of course you can ask me, but I have never tried these softwares.

SVN = SubVersion
If you work on your own computer, then you can create copy about your work using the SVN. But...
It is not a simple copy. You can create a repository on the server and commit all of your changes to the server. The SVN system creates a log about your commits, and later you can restore it on your local computer. Not just in case if you lost all of your data, but you can do it, if you creates a new version on your PC, but it is not working. Thanks for SVN you can "go back" to your earlier version, which was good. This is just an example, but I'm sure you can find many more reason why is a good solution.
I don't know how can can you use it for ex.: MS Word, because the binary format of the document (docx is a zip format, which is binary) but I think nothing is impossible :) I use it for text documents. Source codes, XML files, etc.

Just one thing to my original post: You don't need to install neither lighttp nor PHP, because these are already installed on your NAS. Just create a simple copy about lighttpd.conf file in  place which can be reachable via your ffp, and you can increase the knowledge of the lighttpd
Logged

borekon

  • Level 1 Member
  • *
  • Posts: 5
    • El Blog de Vivancos
Re: fun_plug (mysql, website, svn)
« Reply #3 on: January 03, 2014, 12:52:26 PM »

Awesome!!!
Logged

jsslave

  • Level 1 Member
  • *
  • Posts: 21
Re: fun_plug (mysql, website, svn)
« Reply #4 on: January 17, 2014, 05:59:30 AM »

I'm reading and searching information on how to install new applications. This guide is very useful.
I understand that if you open in the browser the NAS ip, you will open the lighttpd webserver page (and the website loaded in the disk).
So my question: How is possible to reach the default NAS web GUI?
Logged

pizzaking

  • Level 2 Member
  • **
  • Posts: 34
Re: fun_plug (mysql, website, svn)
« Reply #5 on: January 17, 2014, 09:04:25 AM »

Fun_plug kills the default web server and starts it's own. This means you have control over the config file of this server, and can make it do whatever you want.

I still have the NAS web GUI running at port 80, so this is the first page i meet if when type in the NAS IP-address. You could make this run on another port e.g. port 81, where you would type http://NAS-IP:81 to access the web GUI.

You could also have it running as a sub-folder on the webserver, so you could access it on e.g. http://NAS-IP/GUI or something like that.

I also use the web server as a reverse proxy, where tools like Transmission, NZBget etc. runs on sub-folders through lighttpd. This is convenient when I'm not home, and needs to access these tools on a network which doesn't allow connections to other any other ports then HTTP/HTTPS (80/443), and as an added bonus, these subfolders are much easier to remember then the arbitrary port-numbers they would otherwise be running at.
Logged

jsslave

  • Level 1 Member
  • *
  • Posts: 21
Re: fun_plug (mysql, website, svn)
« Reply #6 on: January 21, 2014, 02:52:16 AM »

Thanks  ;)
Logged

koadrian

  • Level 2 Member
  • **
  • Posts: 36
Re: fun_plug (mysql, website, svn)
« Reply #7 on: January 21, 2014, 07:36:17 PM »

is this having a .php?
conflict on NAS home page? if can be switch how will i do?
NAS home page to Custom Home page or Custom Home page to NAS home page.
Logged

pizzaking

  • Level 2 Member
  • **
  • Posts: 34
Re: fun_plug (mysql, website, svn)
« Reply #8 on: January 22, 2014, 03:35:53 AM »

is this having a .php?
conflict on NAS home page? if can be switch how will i do?
NAS home page to Custom Home page or Custom Home page to NAS home page.

Yes, it is possible to install php and use it with lighttpd.

When you install lighttpd on funplug, the startup script will kill the default web-server, and take its place. The default config file, that comes with the lighttpd package, set the NAS web GUI to run at port 81, so there will be no conflict with the web content you want to be displayed at port 80.

I can recommend this tutorial, if you have any trouble setting it up: http://wolf-u.li/4695/konfiguration-von-mysql-und-lighttpd-mit-php-unter-ffp-0-7/

The tutorial is in German, but the steps are pretty straight forward. The tutorial also include installation of the mysql database, but if you don't need this, you could just skip all the steps.
Logged