====== apt-get ======
''apt-get'' is the package management system for [[http://www.debian.org/|Debian]] and as such contains packages compiled for a number of architectures/systems, including the Netgear ReadyNAS Duo. This means you can install programs/applications from the huge plethora of packages that are in the Debian repositories.
**NB** - it is possible that ''apt-get'' is already installed on your system (if you're using an x86 based ReadyNAS) by default as part of the [[http://www.readynas.com/?p=4216|System Toolbox]], I never checked this first, and instead installed the ''APT'' package directly (as opposed to part of the System Toolbox Add-on). If you're using a non-x86 (i.e. sparc) based system like the ReadyNAS Duo I am using you will need to follow the instructions below.
===== Installation =====
- Download the [[http://www.readynas.com/download/addons/4.00/APT_1.0.bin|APT package]] and install it from Frontview.
- Ensure you have [[readynas:enablerootssh|Enabled Root SSH]].
- ssh to your ReadyNAS as root (or if you've [[readynas@enablerootssh#disabling_root_ssh|disabled root ssh]] connect as normal user and ''su'' to root).
- Update the ''apt-get'' database :
ReadyNAS:~/ # apt-get update
- Thats it, all done, you now have up-to-date ''apt-get'' repositories for your ReadyNAS at your disposal.
===== Installing packages =====
There are a number of useful packages that are worth installing and configuring that are either pre-requisites to other tasks described within these pages or will save you a lot of time/effort.
**Warning** : Be **very** careful when installing packages with ''apt-get'', you can easily mess up your system because sometimes ''apt-get'' decides that the libraries and packages you have installed need updating/replacing. If you are prompted whether to go ahead with the install of a given package, look very carefully at //exactly// what is being installed, upgraded and removed. I personally would strongly recommend not upgrading or removing any packages.
==== bzip2 ====
A common compression format for which the ReadyNAS does not come equipped to handle, so its useful to install this. As ''root''...
ReadyNAS:~/ # apt-get install bzip2
==== nano ====
The default text editor on the ReadyNAS is [[wp>vi]] and being an [[wp>emacs]] user I find it awkward to use. However, I use [[wp>Nano_(text_editor)|nano]] on my [[gentoo:gentoo]] systems all the time for quick and fast editing of text files and its far easier and intuitive to use. Thankfully there is a version in ''apt-get'' repositories install it as root using
ReadyNAS:~/ # apt-get install nano
You can now use nano to edit text files using ''nano /path/to/filename''. The common commands and key-strokes for cutting, pasting, saving and exiting are shown at the bottom of the screen, but when you want to save changes and exit, use ''Ctrl+o'' to write the file and then ''Ctrl+x'' to exit.
==== keychain ====
Whilst you have ssh access to your ReadyNAS you currently have to enter your password each and every time you want to log in. [[http://www.gentoo.org/doc/en/keychain-guide.xml|Keychain]] allows password-less automatic ssh access between hosts. **ToDo - Work out if this is possible and finish writing up!**
==== lshw ====
Its useful to know what hardware there is inside a given system and [[|lshw]] is the ideal tool for finding this out (it even produces [[readynas:|html output]]!).
ReadyNAS:~/ # apt-get install lshw
==== tree ====
[[http://mama.indstate.edu/users/ice/tree/|tree]] is a very handy utility for displaying the directory and file structure within a given path, and is something I commonly use. It wasn't already installed on the ReadyNAS so I decided to install it as I knew I'd use it in the future.
ReadyNAS:~/ # apt-get install tree
==== PHP & CGI Environment ====
This is a pre-requisite to installing [[readynas:dokuwiki|DokuWiki]] as DokuWiki is written in [[wp>PHP]] and requires [[wp>CGI]]. The instructions are provided in the [[http://www.readynas.com/?p=140|ReadyNAS Developers Centre]], and follow naturally from having installed ''apt-get'', you only need to install one [[wp>Apache]] module for php
- Ssh to your ReadyNAS and as ''root'' install ''libapache2-mod-php5'' with:
ReadyNAS:~/ # apt-get install libapache2-mod-php5
- Ensure that ''/etc/frontview/apache/httpd.conf'' Apache configuration file has ''index.php'' listed under ''DirectoryIndex'' :
ReadyNAS:~/ # grep 'index\.php' /etc/frontview/apache/httpd.conf
DirectoryIndex redirect.html index.html index.htm index.php
- If this is missing (it wasn't when I did this) use ''nano'' to edit the file and add ''index.php'' to the end of the line (''nano -w /etc/frontview/apache/httpd.conf'').
- Restart the Apache server (I diverge from the official documentation here, instead preferring to use the system ''init'' script that is designed for starting/stopping/restarting services):
ReadyNAS$ /etc/init.d/apache2 restart
You're ready to forge ahead with installing [[readynas:dokuwiki|DokuWiki]].
===== Links =====
* [[http://www.readynas.com/?p=140|Setting up a PHP CGI Environment]]
{{tag> readynas linux howto nano keychain php cgi}}