之前买了个树莓派玩,觉得挺有意思。于是又买了个打算长期当个小服务器用。记录一些用到的东西以后好找:

 

先换掉更新源,加速安装。

sudo nano /etc/apt/sources.list

deb http://mirrors.neusoft.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi
deb-src http://mirrors.neusoft.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi
deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi

 

更多更新源在此;

http://www.raspbian.org/RaspbianMirrors

 

初始设置

sudo raspi-config

更新raspi-config,扩容SD卡,设置语言为:EN-US.UTF8 ZH-CN.UTF8,去掉EN-GB

 

更新固件

sudo rpi-update

 

为了能用raspberrypi.local来访问到局域网里的树莓派

sudo apt-get install avahi-daemon 

 

中文字体

sudo apt-get install ttf-wqy-zenhei

 

安装拼音

sudo apt-get install scim-pinyin

 

安装RDP

sudo apt-get install xrdp

 

安装Screen 

sudo apt-get install screen

常用命令 screen, screen-list, screen -r xxxx, 切出Screen用Ctrl+A,D

 

之前update时这个包一直更新失败,体积又大,暂时用不着先remove掉

sudo apt-get remove wolfram-engine

 

安装Samba

sudo apt-get install samba samba-common-bin

 

加入NTFS,EXFAT支持

sudo apt-get install ntfs-3g
sudo apt-get install exfat-nofuse

 

外置优盘格式化成EXT4,去掉日志提高性能

sudo mkfs.ext4 -O ^has_journal /dev/sda1

 

挂载

sudo nano /etc/fstab

/dev/sda1 /mnt/usb ext4 defaults,noatime,nodiratime 0 0

 

在优盘里新建一个share文件夹,做局域网共享

mkdir /mnt/usb/share

chmod -R 777 /mnt/usb/share

 

sudo nano /etc/samba/smb.conf

添加:

[share]
comment = USB Share
path = /mnt/usb/share
read only = no
writeable = Yes
guest ok = yes
only guest = Yes
create mask = 0777
directory mask = 0777
browseable = Yes
public = yes

 

然后是GoAgent,参考 http://xwlogic.github.io/2014/02/rpi_gae/

安装基础包

sudo apt-get install python-crypto
sudo apt-get install python-openssl
sudo apt-get install libnss3-tools

 

Gevent提高效率

sudo apt-get install python-dev

sudo easy_install -U distribute
sudo apt-get install python-pip
sudo apt-get install libevent-dev
sudo pip install gevent
sudo easy_install PyOpenSSL

 

重建证书库

cd ~

mkdir .pki

cd .pki

mkdir nssdb

certutil -d sql:$HOME/.pki/nssdb -N

sudo certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n GoAgent -i /app/goagent/CA.crt

certutil -d sql:$HOME/.pki/nssdb -L

 

修改proxy.ini

ip = 0.0.0.0

修改proxy.pac

var autoproxy = 'PROXY 0.0.0.0:8087';
var blackhole = 'PROXY 0.0.0.0:8086';

 

开机自动启动

sudo nano /etc/rc.local

nohup /usr/bin/python /app/goagent/proxy.py >/dev/null 2>&1 &

 

安装nginx和php

http://www.ducky-pond.com/posts/2013/Sep/setup-a-web-server-on-rpi/

 

安装&优化mysql

http://www.ducky-pond.com/posts/2014/Feb/how-to-install-and-optimize-mysql-on-raspberry-pi/

 

安装wiring Pi

http://wiringpi.com/download-and-install/

 

安装 Node.JS 和 Node-RED

https://learn.adafruit.com/raspberry-pi-hosting-node-red/setting-up-node-dot-js

posted on 2014-08-21 18:08  Elvin Chen  阅读(6683)  评论(0编辑  收藏  举报