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