dokuwiki is a free PHP-based wiki aimed at technical documentation (hence its employment here!). As the ReadyNAS is already running the Apache web-server its sensible to use it to serve up your DokuWiki pages too. Personally I installed DokuWiki on my nslu2 and have got used to using it, its simple, yet feature rich (there are lots of plugins).
This guide relies heavily on the official ReadyNAS Setting up a PHP CGI Environment and Create a personal webserver on the ReadyNAS HowTo's with some additional information on installing and getting dokuwiki.
This is a pre-requisite to installing DokuWiki as DokuWiki is written in PHP and requires CGI. The instructions are provided in the ReadyNAS Developers Centre, and follow naturally from having installed apt-get
, you only need to install one Apache module for php
root
install libapache2-mod-php5
with: <code bash>
ReadyNAS:~/# apt-get install libapache2-mod-php5
</code>/etc/frontview/apache/httpd.conf
Apache configuration file has index.php
listed under DirectoryIndex
: <code bash>
ReadyNAS:~/# grep 'index.php' /etc/frontview/apache/httpd.conf
DirectoryIndex redirect.html index.html index.htm index.php
</code>nano
to edit the file and add index.php
to the end of the line (nano -w /etc/frontview/apache/httpd.conf
).init
script that is designed for starting/stopping/restarting services): <code bash>
ReadyNAS:~/# /etc/init.d/apache2 restart
</code>dokuwiki
with the description Dokuwiki site
and leave the “Public Access” tick box ticked.dokuwiki
row to change the permissions on this directory.We're now ready to install DokuWiki itself. It will be installed to the 'dokuwiki' share that we just created but directly rather than through the Share interface.
su
to root.cd /c/dokuwiki
)wget
…:<code bash>
ReadyNAS:/c/dokuwiki# wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2010-11-07.tgz
</code>/c/dokuwiki/
directory itself.: <code bash>
ReadyNAS:~/# cd /c/
ReadyNAS:/c/# chown -R admin:admin dokuwiki
</code>install.php
file in the DokuWiki share, this will be something like http://readynas/dokuwiki/install.php or if you've not set a hostname for your ReadyNAS it will include the IP address of the device on your network such as http://192.168.1.101/dokuwiki/install.php.
I already had a fairly well used DokuWiki installed on my NSLU2 that I wanted to migrate over to the ReadyNAS. Thankfully because DokuWiki is essentially based around simple text file pages this was fairly straight-forward. After setting the file and folder permissions above, instead of pointing your browser to install.php
…
data/
and lib/plugins/
sub-directories (which contains all of the pages you have written and your plugins). Something like:<code bash>
host:~/# cd /opt/share/www/dokuwiki
host:/opt/share/www/dokuwiki/# tar cjvf dokuwikidataplugin.tar.bz2 data/ lib/plugins/
</code>/c/dokuwiki/
directory (NB - this is done as admin
)…: <code bash>
host:/opt/share/www/dokuwiki/# scp dokuwikidataplugin.tar.bz2 admin@readynas:/c/dokuwiki/.
</code>cd /c/dokuwiki/
and extract the data files and set the ownership of the data directory: <code bash>
ReadyNAS:~/# cd /c/dokuwiki/
ReadyNAS:/c/dokuwiki# tar xjvf dokuwikidataplugin.tar.bz2
ReadyNAS:/c/dokuwiki# cd ../
ReadyNAS:/c/dokuwiki# chown -R admin:admin dokuwiki
</code>
You should now be able to point your browser at http://readynas/dokuwiki/
or whatever its IP address is on the local network and see your wiki hosted on your ReadyNAS. Thats great if you're only ever going to view/edit your wiki at home, but really you'd like to access it from anywhere in the world wouldn't you?
If you want to be able to access your Wiki from anywhere on the internet you will have to setup your router to forward requests on port 80 (the default port on which http access is provided) to the ReadyNAS.
Your ISP provides your internet connection, and every device connected to the internet has an IP address which uniquely identifies them. These are numeric id's such as 272.146.13.158
and can be a little awkward to remember.
Thankfully someone came up with the idea of Domain Name System which allows more easy-to-remember web-address' like www.google.co.uk
to be mapped to the IP address, so you don't have to worry about remembering the numeric IP address, but can instead remember the text description. To save you having to remember your IP address all the time (and it can change over time when your ISP assigns you a new one) you can use DynamicDNS from somewhere like No-IP.org to assign an web-address to your IP address (and update it if you get assigned a new IP address by your ISP). So look up your ISP assigned IP address and go and choose a domain name at No-IP.org.
I couldn't possibly guess what router you have, but you will want to configure it to forward Port 80 to the IP address your NAS is assigned on your local network. The official ReadyNAS FAQ on port-forwarding points you to an article on Router Port Forwarding and I'm going to do the same.
Once you've registered a domain name and setup port-forwarding you should now be able to access your Dokuwiki hosted on your ReadyNAS by simply pointing a browser at the domain name you registered.
Once installed and running you will, when logged into Dokuwiki as an administrator, notice occasionally that there are notifications telling you that updates are available. Its wise to install these as they often fix bugs and security issues. Thankfully its pretty easy to do. Official instructions are here, but I've written my own walk through (heavily based on these).
su
to root and cd /c/dokuwiki
.cp -a /c/dokuwiki /tmp/.
cd tmp wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-rc2011-11-10.tgz
tar xzvf dokuwiki-rc2011-11-10.tgz 'cp' dokuwiki-rc2011-11-10/{*,.??*} /c/dokuwiki/.
install.php
and change the permissions on the data/
directory…cd /c/dokuwiki rm install.php cd /c/dokuwiki/data chown -R admin:admin
Thats pretty much it, there are a few additional things to check detailed in the official upgrade instructions that you should check though.
I'd recommend that you use namespaces from the outset on your DokuWiki as it helps keep things tidier.
readynas php dokuwiki howto