This is an old revision of the document!
Beginner's FAQ
Welcome to the Beginner's FAQ. I have created this page while going through the process of getting things setup on my DNS-323. Hopefully this page will answer for you some of the questions I had and save time. My goal is to provide a concise set of instructions for all users, be it young, old, with the times or not anyone can set up the DNS-323 for these things.
This page outlines my progress so far. If you would like to, please add to it. Ultimately I would like to get PHP, Ruby on Rails, and imagemagick or similar running on the DNS-323.
The Basics:
Q: What is a DNS-323?
A: Well, at a technical level the hardware specs are shown on this wiki start page. More generally the DNS323 is a little computer with no keyboard, mouse, or monitor connections, and with an empty space for you to put one or two 3.5” SATA hard disks.
You can create and share files from the hard disks over a network using Microsoft Windows-style network sharing (SMB/CIFS). That makes the DNS-323 a Network Attached Storage (NAS) device.
There are also some built in services to share a printer if one is connected to the USB port, and also to share media files (pictures, music and video) using UPnP or iTunes protocols.
Q: A whole Wiki about that! Surely it must get more interesting?
A: Perhaps - it turns out that it is simple and safe to modify the start up of the DNS-323 so that you can change the configuration of the built in services, run additional services that are not started by default, or even run your own programs.
Q: How simple?
A: You have to create a text file called fun_plug on one of your hard disks. The DNS-323 will run the commands that it finds in the file after it has started up. There are details for creating your own fun_plug script in this wiki (and also below here on this page), but read on, because you probably don't need to make your own.
Q: So what hidden goodies are in there for me to enable?
A: The simplest modification is to start the built-in telnet server. By logging in to the DNS323 you discover that it is a computer running Linux. That is, the built in firmware is a customized Linux distribution put together by DLink.
Q: Telnet?
A: Telnet an old fashioned way to control one computer from another. You use a program called a telnet client to talk to the computer you want to control (in this case the DNS323, a telnet server). One popular telnet client for Windows is Putty
Q: So I did that and got some sort of Command Prompt?
A: Right. Linux is a lot like Unix, and you were in a “shell”. You can type commands and the computer will reply to you. Just simple stuff like listing out your files, deleting things, moving them around. Look here to get started: shell introduction.
Q: And then what kind of programs can I run?
A: Remember that there's no monitor, and the CPU is not fast. Regarding the CPU, it is not the same type as you use in your laptop or desktop computer, and so it won't run your copy of Microsoft Office.
The types of programs that you might want to run are network services or clients: some folks have installed web servers, others Bit Torrent Clients (and DLink have stated that some BitTorrent functionality will be built in to the next firmware release as well), and others have installed whole Linux distributions.
Q: So where do I get this extra software and how much does it cost?
A: You won't find any software for this device in your local PC World. Apart some of the software bundled in to the firmware by DLink almost everything running on this little black box is Open Source Software or Free Software.
Again, it is unlikely that the authors of this free software have compiled a program for you to run on your funny little black box, so it needs to be compiled. But don't get scared; quite a little community has grown up around this device, and lots of useful programs are now available for you to download for free and start using.
Q: OK, so where do I get it?
A: Four popular options are:
- Install the fun_plug and applications that are distributed by fonz: fonz fun_plug/ffp
- Use the optware ipkg builds: optware
- Run a complete Debian setup: chroot_debian
- Compile it yourself. Grab the D-Link toolchain and download the source code for your favourite app: crosscompile
Or you can even mix-and-match, and install applications from a combination of the sources mentioned above, although you might find it is harder work to get the larger applications that depend on libraries and external applications to work outside of their intended distribution.
Q: Hmm. What's the difference?
A: The fonz fun_plug script, and the growing collection of applications he has built and distributes are made by him just for the DNS323. It is like a customized Linux distribution that adds to the Linux kernel built in to the DLink firmware in the DNS323. Read more about fonz' fun_plug (ffp) on this wiki
Optware is a project that provides a large collection of applications that are built for devices that run embedded linux, like the DNS323. Optware will require that you install a fun_plug script to start any services that you install with Optware, but your fun_plug can be very simple, and Optware will look out for the dependencies between any applications that you install. You can read more about Optware on the optware wiki and specific information about installing Optware on the DNS323 on this wiki.
Chroot Debian is a way to install a full Debian Linux distribution on your DNS323. Debian is a distribution of Linux primarily intended for desktop PCs and server computers. As such you may need to do some tweaking of the install to avoid your hard drives being constantly active while writing logs and indexing files. Again, you will need a simple fun_plug script to kick off the Debian boot process after you turn on your DNS323.
Compiling your favorite applications from source code is an option, and once again you will need a simple fun_plug script to start your application or provide remote access to your DNS323 so that you will be able to run your program.
Fun plug:
Q: What is the filename meant to be?
A: fun_plug (with no extension)
Q: Where does it go?
A: The fun_plug file needs to be in your root directory where you can see it when you access the network drive. When using 1.03 or 1.04 firmware for example that location would be inside the directory called “Volume_1”, it can be uploaded there most easily via FTP.
Q: I'm nervous…am I doing this right?
A: Just remember not to use Notepad to create this file! It needs to be formatted with Unix-style line breaks (i.e. “Unix format (LF)”), and Notepad will save the file in the wrong format. Then be sure you chmod the file to 777, so the DNS-323 will execute the file when it is booted.
Q: How do I chmod the file to 777?
A: quote site chmod 777 FILE_NAME
Q: I can't get the +x bit set on fun_plug - why?
A: Probably because you used the web-interface to download the file. This creates files that are given permissions 666, and for some reason you can't fix it using ftp's “quote site chmod 777 fun_plug”. Download the file locally and upload it manually using ftp and check that the bits are right.
Telnet:
Q: My virus scanner says there is a virus in the compressed folder I was told to downloaded in the Wiki.
A: The file in question is a remote administration utility that is often regarded as a virus by most virus scanners, if you are worried about it skip this file. You will only need these files from this compressed folder: ./starttelnet.sh, ./lnx_bin/utelnetd and ./lnx_bin/busybox3.
Q: I have uploaded the files to the main directory, as asked, and rebooted my DNS-323, but I still do not have telnet access.
A: Make certain all of the files including your fun_plug file, the ./lnx_bin directory and all files in the ./lnx_bin directory are chmodded to 777, also ensure you are connecting to port 23.
Q: I am using Putty and the connection is established, but there is no prompt on the screen. It's just a blank window with a cursor.
A: Make certain that before connecting you are selecting to connect with telnet in the putty client. If you connect with the default SSH protocol instead of telnet you will not be able to do anything in the command window.
Q: I have enabled ssh and use this now to connect to my NAS, how can I disable telnet so my system is secure again?
Lighttpd:
Q: Cross-compile toolchain?
A: If all you want right now is lighttpd running, then you can avoid this. Download the pre-compiled version from the bottom of that page and upload it to your server following the same directions at the top.
Q: Do I need to restart the DNS-323?
A: No, just run the server using telnet and the appropriate services will be started.
Q: How do I access the .html files I uploaded from the web?
A: Find out your IP address, this can be accomplished a number of ways either from your router which should give you this information or from a website like http://www.whatismyip.com or similar. To access your files from the web you would use your IP address, then a colon three thousand ”:3000” which is the default port that lighttpd will be running on.
Q: I still cannot access my files.
A: You will need to access them by the full filename using the default settings. For instance if your file is index.html you would enter the url: <IPaddress:Port>/index.html to access it.
Q: How do I make my “IP address and port number” combo go straight to a specific file, like index.html, without having to actually type it?
A: You can add this line to the end of your lighttpd.conf file: index-file.names = ( “index.html”, “index.htm”, “default.htm” ) and restart. This will cause your browser to return index.html, index.htm or default.htm when the directory is requested, like a directory default page.
Q: I want to access this stuff without the port number, just my IP address.
A: You will have to set up a port redirection on your router. It is a good idea to set a static IP for your DNS-323, after you have done this redirect port number 80 which is the default port accessed by http requests, to port 3000 at the local IP address of the DNS-323. Now when you visit your IP address the request will go straight to the files you want.
Q: I am linking to a CSS file, but the page is not rendering it.
A: You need to add CSS to your lighttpd.conf file in between the other ones there: ”.css” = “text/css” make certain you are using your commas correctly, all but the last file type in the list should have a comma after it.
Q: How do I make lighttpd start up automatically with the DNS-323, not through telnet?
A: Create a new script file with unix (LF) line breaks called startlighttpd.sh and put it in the same place as your starttelnet.sh file, remember these all have to start with: #!/bin/sh. Then add to your funplug the line: /mnt/HD_a2/startlighttpd.sh, or instead just add to your starttelnet.sh file, the line you will need is: /mnt/HD_a2/lnx_bin/lighttpd -D -f /mnt/HD_a2/lnx_bin/lighttpd.conf