Play Raspberry Pi(1)System and nodeJS/nginx
Play Raspberry Pi(1)System and nodeJS/nginx
Download the software from here http://www.raspberrypi.org/downloads/
I prefer to try RAPBIAN, because I usually use ubuntu system.
I download the file 2014-09-09-wheezy-raspbian.zip
Unzip the file and open distutil on MAC system.
Find the 16 GB disk and clean that with MS-DOS(FAT) format.
Open command line and type
> diskutil list
Unmount the disk first
> sudo diskutil unmount /dev/disk2s1
Write the file to the disk
> sudo dd if=2014-09-09-wheezy-raspbian.img of=/dev/disk2 bs=2m
Type the username and password, pi, raspberry.
I change the password and add one user for myself.
>adduser carl
Add sudoer
>visudo
root ALL=(ALL:ALL) ALL
carl ALL=(ALL:ALL) ALL
ctrl + X to exit.
Set up the static ip
> cat /etc/network/interfaces
auto lo
iface lo inet loopback
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.106
gateway 192.168.0.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface lo inet loopback
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.106
gateway 192.168.0.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Restart the system
> sudo reboot
Set up nodeJS env on raspberry pi.
Unzip the file and go to the working directory
> ./configure --prefix=/home/carl/tool/node-v0.10.33
>make
>make install
It will take a great long time to compile the source codes on that small machine. I may choose this one http://node-arm.herokuapp.com
Or I can download the arm-pi.tar.gz from some URLs like this http://nodejs.org/dist/v0.11.9/.
I pick up to install v0.10.28 or v0.11.11. Let me start with the latest one.
Some discussion about “ Illegal instruction"
Finally I found this version is working on my raspberry pi B+. http://nodejs.org/dist/v0.10.28/
> node -v && npm --version
v0.10.28
v0.10.28
1.4.9
Set up nginx on raspberry pi
Download and try with version 1.6.2, unzip the file and try to build that
> ./configure --prefix=/home/carl/tool/nginx-1.6.2
Configure not pass, I need to install this first
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
This command will help
> ./configure --prefix=/home/carl/tool/nginx-1.6.2 --with-pcre=/home/carl/tool/commons/pcre-8.36
It does not work well with manually installing PCRE. I may use this command to install PCRE instead.
> sudo apt-get install libpcre3
> sudo apt-get install libpcre3-dev
Command to test the config file
> sudo sbin/nginx -t
Command to start
> sudo sbin/nginx
Command to restart
> sudo sbin/nginx -s reload
Command to stop
> sudo sbin/nginx -s stop
References:
nginx installation
http://sillycat.iteye.com/blog/562634
http://sillycat.iteye.com/blog/2074417
http://sillycat.iteye.com/blog/2075245
http://sillycat.iteye.com/blog/1055873
相关推荐
嵌入式开发爱好者 2020-08-28
LIEVEZ 2020-05-04
LIEVEZ 2020-05-01
tianyayi 2019-11-17
pigsmall 2019-08-09
woniulx0 2019-08-06
tianyayi 2019-03-26
mahy 2019-03-01
tosim 2016-12-01
duqiang 2016-08-30
xstardust 2016-08-26
BigBang 2019-06-29
wuyemenghuirt 2019-06-28
kingpin 2017-06-07
大大丶 2017-06-07
LeeHDsniper 2019-06-26
zhufu 2015-05-08
BigBang 2016-02-29
gad 2017-02-20