I figured I may as well share it here on the off chance it helps someone out.
***************************************************************
PREPARE THE SD CARD
- slotted sd card into laptop's card reader
- used win32diskimager to write the debian squeeze img to sd card
- opened boot partition and renamed boot_enable_ssh.rc to boot.rc (as I run my rpi headless and only access via ssh)
- rebooted laptop into gparted live
- used gparted to modify sd card partitions to make full use of 16gb
GET THE RASPBERRY PI ON THE NETWORK / INTERNET
- rebooted laptop back into windows; launched dhcp server on laptop
- configured internet sharing of wifi connection
- plugged rpi network directly into laptop network
- slotted sd card into rpi and booted
- ping -t 192.168.1.100 (the first ip of my dhcp range)
- once it was replying, connected to rpi via ssh using putty
- log into rpi
INITIAL SETUP OF OS ON RPI
note: everything below which is prefixed with a ]$ is a command completed via the putty ssh terminal window
- configure timezone
- Code: Select all
$ sudo dpkg-reconfigure tzdata
- update apt package list, needed to run this twice to fix error
- Code: Select all
$ sudo apt-get update
- update debian system files
- Code: Select all
$ sudo apt-get upgrade
- install certificate authority certs
- Code: Select all
$ sudo apt-get install ca-certificates
- install hexxeh's rpi-update tool https://github.com/Hexxeh/rpi-update#readme
- Code: Select all
$ sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && chmod +x /usr/bin/rpi-update
- rpi-update requires git (and I use git to version my own code too)
- Code: Select all
$ sudo apt-get install git-core
- run hexxeh's tool to update rpi firmware
- Code: Select all
$ sudo rpi-update
- reboot the rpi to complete updates
- Code: Select all
$ sudo shutdown -r now
- log back into the rpi when it comes back up
- setup rpi's ssh to automate future logins via authorized key
- Code: Select all
$ mkdir .ssh
- Code: Select all
$ chmod 700 .ssh/
- fire up the text editor (nano) and create an authorized_keys file where I paste in my public key (which I generated on my laptop), save and exit
- Code: Select all
$ nano .ssh/authorized_keys
- change the permissions of the auth_key file
- Code: Select all
$ chmod 600 .ssh/authorized_keys
INSTALL AND CONFIGURE CHEROKEE WEBSERVER
note: I decided to use cherokee over apache because it is slimmer and far more simple to administer
I basically use the same steps from here: http://www.howtoforge.com/installing-ch ... an-squeeze
But I found that this guide didn't mention creating the www-data group
- install mysql, during this process you will be prompted to set a mysql root password
- Code: Select all
$ sudo apt-get install mysql-server mysql-client
- create the www-data group which the cherokee process will run under
- Code: Select all
$ sudo addgroup www-data
- install cherokee webserver
- Code: Select all
$ sudo apt-get install cherokee
- fire up a web browser on my laptop and plug in the rpi's ip address and confirm that the placeholder page is displayed
- install php5
- Code: Select all
$ sudo apt-get install php5-cgi
- edit the php config file
- Code: Select all
$ sudo nano /etc/php5/cgi/php.ini
- hit ctrl+W and search for "cgi.fix_pathinfo=1", remove the ; form the front of the line (aka uncomment)
- restart cherokee so it will pick up php
- Code: Select all
$ /etc/init.d/cherokee restart
- fire up the cherokee admin webpage
- Code: Select all
$ sudo cherokee-admin -b
- in a web browser on my laptop I connect to http://192.168.1.100:9090 using the details which were output on the rpi's ssh window
- go to vServers, pick the default vhost and go to the Behavior tab; click the Rule Management button
- click the "New" button next to Behavior to add a new rule
- an overlay window pops up; select "Languages" from the left column, then choose "PHP" and click the "Add" button
- click the "Create" button in the Configuration Assistant window:
- to finalize the setup, click the box that says NON FINAL and it should change to FINAL
- in the upper right corner there should now be a "Save" link - click it to save the new configuration
- click the "Graceful restart" button
- back in the rpi ssh window, hit ctrl+C to shut down the cherokee admin web page
- grant my pi user permissions of the www directory
- Code: Select all
$ sudo chown -R pi www/
- create a file to test php
- Code: Select all
$ nano /var/www/info.php
- paste in the following: <?php phpinfo(); ?>
- ctrl+X and save
- in the web browser on my laptop I punch in http://192.168.1.100/info.php which should display a whole stack of info about the system
- do a little dance, your RPi is now a little web server