aqui cozinha-se
quinta-feira, 26 de janeiro de 2012
audiosurfer on OpenWRT @ NSLU2


Download image file from
http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/openwrt-nslu2-squashfs.bin (or whatever new version is out)

Enter upgrade mode as described here: http://www.nslu2-linux.org/wiki/HowTo/UseTheResetButtonToEnterUpgradeMode
Basically:
    Shutdown the slug
    Using a paper clip (or pushpin), push and hold in the reset button. (The reset button is located on the back of the NSLU2 above the power connection.)
    While holding in the reset button, press and release the power button.
    Watch the orange Ready/Status LED and after approx 10 seconds the LED will turn solid red. Quickly release the reset button.
    You should be in upgrade mode which is indicated by the Ready/Status LED alternating between red and green.
NOTE ON COLOURS: It will go from orange to a slightly darker orange. If you have trouble seeing the change, the secret is to not look directly at the led; at about 45 degrees off center the contrast change is much clearer

Telnet to 192.168.1.1 and change the root password.

SSH in and Modify /etc/config/network. Change IP address if you want something different. Add the following:

config interface loopback
    option ifname    lo
    option proto    static
    option ipaddr    127.0.0.1
    option netmask    255.0.0.0

#USE THIS FOR STATIC IP
#config interface lan
#    option ifname    eth0
#    option type     bridge
#    option proto    static
#    option ipaddr    192.168.2.55
#    option netmask    255.255.255.0
#    option dns    208.67.222.222
#    option gateway    192.168.2.1

#USE THIS FOR DHCP IP
#config interface lan
#    option ifname   eth0
#    option proto    dhcp
#    option netmask    255.255.255.0
#    option dns    208.67.222.222
#    option gateway    192.168.2.1


You can now reboot your NSLU2 by typing the command reboot. When it comes back up, it will fetch its IP address using your local DHCP server or use the static IP you configured before

NOTE: If you want to boot from an USB device you should configure that now. Follow instructions from here: http://yorkspace.wordpress.com/2009/03/28/linksys-nslu2-nas-and-backup-solution/
        I'm not using it because my usb ports are not working properly and so I'll be struggling to put everything in the little space the slug has left.


Now to install the necessary packages:

Note: you must run opkg update after each reboot if you want to install some packages.

opkg update

Just because it's so very best than vi:
opkg install nano

SFTP server so we can send some files to it
opkg install openssh-sftp-server

Some filesystem support:
opkg install kmod-fs-cifs
opkg install kmod-fs-ext2
opkg install kmod-fs-ext3

This one's needed for the cifs mount (or it wont read the filenames properly)
opkg install kmod-nls-utf8

Now for lighttpd (tryed nginx, never could get it to work...)
opkg install lighttpd
opkg install lighttpd-mod-cgi

PHP5 and some necessary modules:
opkg install php5
opkg install php5-cgi
opkg install php5-mod-gd
opkg install php5-mod-json
opkg install php5-mod-session

These ones I just had to intall, otherwise php wouldn't work. Really can't say why.
opkg install libsqlite3
opkg install php5-mod-sqlite3

Changes in Lighttpd config file (/etc/lighttpd/lighttpd.conf)
I'm not really using this to anything else so I didn't bother to configure any virtual host or any of that stuff. Just plain simple server in port 81.
Uncomment/change the follwing lines (there may be some in between)
server.modules = (
    "mod_cgi"
)

server.document-root = "/www/audiosurfer/"
index-file.names = ( "index.html", "default.html", "index.htm", "default.htm", "index.php" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
server.port = 81 #we are using port 80 for luci-lua
cgi.assign = ( ".php" => "/usr/bin/php-cgi" )


Changes in php config file (/etc/php.ini)
Uncomment/change the follwing lines (there may be some in between)
doc_root = "/www/audiosurfer"
extension=gd.so
extension=json.so
extension=session.so
extension=sqlite3.so

Now get the site contents from http://sourceforge.net/p/audiosurfer into /www/audiosurfer

MOUNT CIFS SHARE
insmod cifs
insmod nls_utf8
mount -t cifs //IP/SHARE /MOUNT/POINT -o user=USER,pass=PASSWORD,workgroup=WORKGROUP,nounix,noserverino,iocharset=utf8

Configure paths in /www/audiosurfer/config/config.inc.php

And that's it, your site should be up and running.

(Also you don't have that much space left, here's the output from df -h)
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 1.6M      1.6M         0 100% /rom
tmpfs                    14.7M      1.2M     13.4M   8% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock5            4.8M      4.4M    384.0K  92% /overlay
mini_fo:/overlay          1.6M      1.6M         0 100% /






 384K free from the original 4.8M ! :)

Places you need to go (but you already really know them):
http://www.nslu2-linux.org/
https://openwrt.org/
posted by rph @ 00:10   0 comments
 
Outros tascos
Only For People
dispensa
Não Fumando
Previous Posts
Archives
my flickr.com
my del.icio.us tags
Powered by

Isnaini Dot Com
BLOGGER
IBSN