Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:howto:readynasduo_dokuwiki [2010/05/04 00:20] (current)
michael created
Line 1: Line 1:
 +What you are currently reading is an article in a DokuWiki called "​MZwiki",​ that resides in a Netgear ReadyNAS Duo which itself doesn'​t have a fixed IP so it is accessed via DynDNS. And this works without generating any extra costs (if you don't count power consumption and disk usage).
  
 +If you would like to have a free wiki on your NAS as well then this article might be interesting for you.
 +
 +====== Overview ======
 +That's the short version of what you'll have to do:
 +
 +  - update your firmware (if you haven'​t already)
 +  - create a share for your website (dokuwiki)
 +  - redirect http access to that share
 +  - configure your router to direct port 80 tcp to your NAS
 +  - create a dyndns-account
 +  - <​del>​install the dyndns-addon</​del>​config router
 +  - install the APT installer
 +  - install root-access
 +  - install php (via root-access)
 +  - install dokuwiki ​
 +  - fix the security holes that ReadyNAS Duo has by default.
 + 
 +
 +As you see, it's best to do this when there'​s nobody around to disturb you. On the other hand, you could do it step by step, each step will yield a small but visible result.
 +
 +====== Instructions ======
 +
 +Before you start you should check that your ReadyNAS has the latest firmware. You can do that by accessing frontview (the web interface) and then go to **System** -> **Update** -> **search for update**.
 +
 +===== Connect your NAS to the Internet =====
 +To get started, you should put a simple test page on your NAS. I recommend creating a special share and a special user called something like "​webadmin"​ who has exlusive access. This minimizes the risk of accidentally screwing up the website. ​
 +
 +[[http://​www.readynas.com/?​p=135|This official tutorial]] tells you most of what you need to do.
 +
 +If you have a fixed IP address you could get a professional address like //​%%www.myownwiki.com%%//​. If however your IP address is dynamic you should register one for free at [[http://​www.dyndns.com|DynDNS]] or the dynamic IP provider of your choice (create an account and register a new address for free). When your are done with this you need to install a dynamic IP update add-on, which can be done via frontview. What the add-on does is contacting the DynDNS server when your IP address changes, so your URL (whatever.dyndns.org) redirects to your NAS.
 +
 +FIXME <​del>​Install the [[http://​readynas.com/​forum/​viewtopic.php?​f=47&​t=28347|DNS-o-matic add-on]]. If you don't know how to install it you can read [[http://​www.readynas.com/?​p=912|the official Netgear tutorial]]. </​del>​ FIXME  You don't need to make any changes to your NAS, installing a DynDNS add-on won't help, since the NAS's IP doesn'​t change. Instead you have to configure your router to use DynDNS. See your router'​s manual.
 +
 +At the end of it you should be able to see your test page when you type the DynDNS address into your browser.
 +
 +===== Preparing your NAS =====
 +Unlike most other wikis, Dokuwiki does not need a database. Instead each article is stored as a plain text file which makes it easy to move it to a real server when your site gets too popular for your NAS and also allows for easy recovery when something goes wrong.
 +
 +However, Dokuwiki requires PHP, but you can't install this as an add-on. Instead you have to first install the APT installer and then log into your NAS as root via shh.
 +
 +
 +==== Adding APT (installer) ====
 +
 +Before you can install special programs you need to install APT. This is already installed on ReadyNASes that have x86 processors, but a ReadyNAS Duo has a sparc processor, so you have to install it manually. Just save [[http://​www.readynas.com/​download/​addons/​4.00/​APT_1.0.bin|this file]] on your computer and install it like a normal add-on via frontview.
 +
 +==== Enable root access ====
 +Now, you need to install the official "​EnableRootSSH"​ add-on, which you can find at the end of [[http://​www.readynas.com/?​page_id=617|this Netgear page]]. Remember that installing updates/​add-ons sometimes require a restart. These restarts are usually performed automatically,​ but if it ever happens that your NAS is inaccessible,​ even though the blue LED has been shining constantly for quite some time, you might want to reboot it manually. Simply push the blue OFF-button at the front for about 5 seconds. This shuts down your NAS safely. Do **not** shut it down by pulling the plug!
 +
 +==== Install PHP as root via ssh ====
 +Once the SSH add-on and APT are installed, you should be able to log in from a terminal. On Ubuntu, you usually find the terminal under //​applications//​->//​accessories//​. On Windows you have to install an SSH client first. Windows users should check out //PuTTY//.
 +
 +When you have your terminal open it's time to access the NAS. If for example you set the NAS's hostname to "​myreadynas"​ you should be able to log in by typing this:
 +
 +''​ssh root@myreadynas''​
 +
 +If you did not set a host name you can look up your NAS's IP address in RAIDAR and access it like this (put in your NAS's IP):
 +
 +''​ssh root@123.45.67.89''​
 +
 +Notice that you have to type "​root"​ instead of "​admin"​. Root means that you have full access on everything. Now, if you updated your NAS's firmware correctly you only need to run the first two commands of [[http://​www.readynas.com/?​p=140|this official Netgear tutorial on how to install PHP]]. ​
 +
 +When you are done type ''​exit''​ to log out of your ssh session. You can then close the terminal.
 +
 +===== Install DokuWiki =====
 +
 +Get the latest version [[http://​www.splitbrain.org/​projects/​dokuwiki|here]] and check out the official [[http://​www.dokuwiki.org/​manual|DokuWiki manual]], especially the part about [[http://​www.dokuwiki.org/​install|installing]] it.
 +
 +FIXME After copying the files to your server you need to fix their ownership using frontview FIXME
 +
 +===== Fix the security holes of your ReadyNAS Duo =====
 +
 +DokuWiki comes with a .htacces file that specifies which files are public and which aren'​t. Unfortunately,​ the default setting of a ReadyNAS Duo is that this access file is ignored and all your files can be accessed by everyone on the web. To check if your ReadyNAS has this security hole try to access this file (change the URL to match your own installation):​
 +
 +''​%%http://​thenameofyourwiki.dyndns.org/​theshareyourwikiisinstalledon/​data/​pages/​wiki/​dokuwiki.txt%%''​
 +
 +If you can see the content of this file your ReadyNAS Duo is insecure!
 +
 +The problem is that the file ''/​etc/​frontview/​apache/​Shares.conf''​ has a bad setting, but you can't fix it directly, since that file gets reset every time you reboot your NAS. You can however add a config file that fixes this problem and give it priority over Shares.conf. Before you do this you need to know a few commands that you can type while logged in. If you like the **vi** texteditor you can use that, since it's already installed on the ReadyNAS Duo. If you don't know what that is or if you hate it you should install the **nano** text editor, which is very easy to use. Run this:
 +
 +''​apt-get install nano''​
 +
 +
 +If you are new to working with unix you might want to have a look at these basic commands you can enter while logged in via SSH:
 +
 +^ command ^ dangerous? ^ what it does ^
 +| ''​ls'' ​     |  harmless ​ | Display directory contents (like "​dir"​ in MSDOS). |
 +| ''​cd ..'' ​  ​| ​ harmless ​ | Go up a directory (notice the space between ''​cd''​ and ''​..''​) |
 +| ''​cd /​go/​to/​an/​absolute/​path/'' ​ |  harmless ​ | Go to an absolute path. Try out ''​cd /''​ and then ''​ls''​ to see the root directory |
 +| ''​cd go/​to/​a/​relative/​path/'' ​ |  harmless ​ | Goes to a path relative to the one you are currently in. Good if you want to go to a directory that you just saw after you typed ''​ls''​ |
 +| ''​cat sometext.file'' ​ |  harmless ​ | Displays the content of that file. |
 +| ''​touch some.file'' ​ |  maybe  | Creates a file in the directory you are currently in. The file will be empty. Be carefull to not to put files where you shouldn'​t put any! |
 +| ''​nano some.file'' ​ |  dangerous! ​ | Texteditor (not included). If you edit the wrong file all hell will break loose! If you just want to look at a file use ''​cat''​ instead. When a file is open, you can access the options at the bottom by typing CTRL+letternexttotheoption |
 +
 +When you are ready go to ''/​etc/​frontview/​apache''​. Then do ''​ls''​. You should see some files, the important ones are //​Shares.conf//​ and //​httpd.conf//​. If you don't see these files you are in the wrong directory.
 +
 +FIXME