Raspberry Pi学习笔记

来源:互联网 发布:网页版淘宝 编辑:程序博客网 时间:2024/05/16 04:31

通过配置让RP自动连接WIFI

一、把WIFI网卡插入树莓派的USB口中, 用lsusb 命令查看USB设备列表

  lsusb

  可以见到USB设备列表中有 "RTL8188CUS 802.11N WLANAdapter" 的字样

  说明该USB设备已被系统识别,芯片是RTL8188

  用 ifconfig 命令可以看到 wlan0 设备,但没有IP地址(未连接)

二、修改 /etc/network/interfaces 文件(这个文件是定义网络配置的)

  sudo nano /etc/network/interfaces

  修改后文件内容如下:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "HelloWorld"
wpa-psk "password"

  说明:

  auto lo  //表示使用localhost

  iface eth0 inet dhcp  //表示如果有网卡ech0, 则用dhcp获得IP地址 (这个网卡是本机的网卡,而不是WIFI网卡)

  auto wlan0   //表示如果有wlan设备,使用wlan0设备名

  allow-hotplug wlan0 //表示wlan设备可以热插拨

  iface wlan0 inet dhcp //表示如果有WLAN网卡wlan0 (就是WIFI网卡), 则用dhcp获得IP地址

  wpa-ssid "HelloWorld"  //表示连接SSID名为HelloWorld的WIFI网络。 HelloWorld是我的WIFI网SSID名称,如果是别的,请更改

  wpa-psk "password" //表示连接WIFI网络时,使用wpa-psk认证方式,认证密码是password。如果是别的密码,请更改

  上述定义后,如果有网线连接,则采取DHCP自动连接。如果有名为HelloWorld的WIFI网络,则自动连入,采取DHCP获得地址。

三、立即连接WIFI网络

  使用命令

  sudo /etc/init.d/networking restart

  成功后,用 ifconfig 命令可以看到 wlan0 设备,且有了IP地址(已连接)

四、以后每次启动,系统都将自动连接到名为JoStudio的WIFI网络

OK,你的树莓派自由了,不再需要网线拖着了。随便放!

资源来自于网络

 

修改RP软件源使下载更快

编辑/etc/apt/sources.list文件,将原来的那一行用#注视掉,添加下面两行代码,这是中科大Debate软件源速度很快。

debhttp://mirrors.ustc.edu.cn/raspbian/raspbian/ wheezy main contrib non-freerpi  

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

 

通过Windows的远程桌面登陆RP的图形桌面(win8环境下)

使用命令 sudo apt-get install xrdp

安装完成后用ifconfig查看本机在局域网中的ip地址,记下来

打开Windows的远程桌面如下图(下图为win8系统的截图)


在计算机后面输入RP的ip地址,点击连接后可能会出现一个警告,直接确认就是了

然后我们进入了下图:


输入RP的用户名和密码,与开机的账号是一样的

登入之后是不是看到了熟悉的画面?!


在RP上安装Apache httpd

在 http://httpd.apache.org/ 下载Apache httpd

在 http://apr.apache.ore/download.cgi 下载apr和apr-util

在 http://sourceforge.net/projects/pcre/files/?source=navbar 下载pcre

统一下载 .tar.gz 格式的压缩包

并统一放入RP的一个文件夹中

用 tar -zxvf xxx.tar.gz 命令解压文件

pcre是.zip压缩包用

unzip xxx.zip 解压缩


首先,安装apr

cd apr-x.x.x 

./configure

sudo make

sudo make install

注:官方说apr会安装在/usr/local/apr下


然后安装 apr-util

cd apr-util-x.x.x

./configure --with-apr=/user/local/apr   // --with-apr=/user/local/apr 指定apr安装的位置

sudo make

sudo make install


接着安装pcre

cd pcre-x.xx

./configure

sudo make

sudo make install


最后安装httpd

cd httpd-x.x.x

./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-auth-digest --enable-cgi --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/usr/local/apache2/htdocs

sudo make 

sudo make install

 

等待它安装完成即可。

如果出现 httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 这个问题

请参考这个地址 http://blog.csdn.net/aidenliu/article/details/6589040

0 0
原创粉丝点击