Hi again,
This time I've installed a web server to my RPi (acronym of "Raspberry Pi").
I've decided to install the "lighttpd" web server due to all the virtues listed in its home page: security, speed, compliance, flexibility and a small memory footprint (this last one ideal for RPi).
I have followed the "5 minutes configuration steps" and I have found the next setback:
If you create a "lighttpd.conf" file in any directory and execute "lighttpd -D -f lighttpd.conf" from this directory, the system doesn't asume the port configured in this file. By default, the listening port is the 80. This is because you have to restart your RPi after software package installation. Also if you don't restart your RPi and you try to execute "lighttpd -D -f /etc/lighttpd/lighttpd.conf" (the default config file created when installing the software), then appears the next message: "(network.c.405) can't bind to port: 80 Address already in use".
If you put a not occupied port in the .conf file you will have the system OK, and you will be able to browse your web page from your RPi (http://127.0.0.1:"port number") or from another computer connected to the same network as your RPi (through the wired ethernet network or through the USB WiFi network).
When copying the executable file "etc/lighttpd/lighttpd" to "etc/init.d/lighttpd", you are saying the system to run the web server in every boot. If you change the file attributes to "non executable" this service is not started at boot.
Here you will find simple explanations and resources to problems encountered with the Raspberry Pi software and hardware. (Also it helps me to remember!)
lunes, 19 de enero de 2015
domingo, 11 de enero de 2015
Configuring wlan0 and eth0
Hi,
Finally I have decided to use the wired ethernet port (eth0 in the RASPIBIAN) as VNC server and "watch" the OS through it. For that I have asigned a static IP to eth0:
I have removed the next line
The wlan0 interface tries to connect to a Wi-Fi network configured in the file "wpa_supplicant.conf". This file can be edited manually or can be configured through the wpa_gui application.
Finally I have decided to use the wired ethernet port (eth0 in the RASPIBIAN) as VNC server and "watch" the OS through it. For that I have asigned a static IP to eth0:
- Edit the next file:
nano /etc/network/interfaces
- I have edited it and put the static IP in the eth0 config lines:
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.160
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
I have removed the next line
gateway 192.168.1.1 below the "broadcast" line because there are internet access conflicts between the eth0 and the wlan0 interface. If this line appears in the eth0 config then the wlan0 is unable to connect to internet (only one gateway can be configured in this file) and the system tries to connect through the eth0.The wlan0 interface tries to connect to a Wi-Fi network configured in the file "wpa_supplicant.conf". This file can be edited manually or can be configured through the wpa_gui application.
First steps. My new Raspberry Pi B+
Hi,
I just unpacked my new hardware and I'm working with it.
This platform works with Linux (various versions of OS are available in the Raspberry Pi official web site, also called "distros").The Micro SD memory card purchased with the hardware comes with the OS pre-installed. Mine was NOOBS. Thats fine if you wants to start "playing" with the system.
But I had a problem: I had no HDMI monitor available. But I had a laptop PC with Windows XP. So the only way to "watch" inside the system was through a VNC sessión. For this, first you have to configure the system entering with a SSH session (Secure SHell session). That is only possible if the OS has started. And this is impossible with the pre-installed NOOBS image card, and without a HDMI monitor and a keyboard.
So, the first of all was to delete the original SD card with the pre-installed NOOBS and install the RASPBIAN image. Follow this steps for that.
Second: the SSH session. Be aware that the RPi has to be connected to a network with router through the wired ethernet port for the first time (remember, you don't have screen and you can't configure the Wifi connection). RASPBIAN has enabled the DHCP in the wired ethernet port by default but you must to find the IP. For this follow this steps. After that, and if you have a Raspbian release before November 2016, follow this, step by step. (¡¡Attention!!:
As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually. This is done using raspi-config:
Enter
For headless setup, SSH can be enabled by placing a file named 'ssh', without any extension, onto the boot partition of the SD card.)
Third: the VNC session. To install the VNC server in Raspberry Pi (TightVNCserver for example) type the next in the SSH session:
Remember that if you want to start de RASPBIAN GUI you must run the "startx" command.
I just unpacked my new hardware and I'm working with it.
This platform works with Linux (various versions of OS are available in the Raspberry Pi official web site, also called "distros").The Micro SD memory card purchased with the hardware comes with the OS pre-installed. Mine was NOOBS. Thats fine if you wants to start "playing" with the system.
But I had a problem: I had no HDMI monitor available. But I had a laptop PC with Windows XP. So the only way to "watch" inside the system was through a VNC sessión. For this, first you have to configure the system entering with a SSH session (Secure SHell session). That is only possible if the OS has started. And this is impossible with the pre-installed NOOBS image card, and without a HDMI monitor and a keyboard.
So, the first of all was to delete the original SD card with the pre-installed NOOBS and install the RASPBIAN image. Follow this steps for that.
Second: the SSH session. Be aware that the RPi has to be connected to a network with router through the wired ethernet port for the first time (remember, you don't have screen and you can't configure the Wifi connection). RASPBIAN has enabled the DHCP in the wired ethernet port by default but you must to find the IP. For this follow this steps. After that, and if you have a Raspbian release before November 2016, follow this, step by step. (¡¡Attention!!:
As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually. This is done using raspi-config:
Enter
sudo raspi-config in the terminal, first select Interfacing options, then navigate to ssh, press Enter and select Enable or disable ssh server.For headless setup, SSH can be enabled by placing a file named 'ssh', without any extension, onto the boot partition of the SD card.)
Third: the VNC session. To install the VNC server in Raspberry Pi (TightVNCserver for example) type the next in the SSH session:
sudo apt-get install tightvncserver tightvncserver- Log into a terminal on the Pi as root:
sudo su
- Navigate to the directory
/etc/init.d/:
cd /etc/init.d/
- Create a new file here:
nano vncboot
- And write the following script inside:
### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO
#! /bin/sh
# /etc/init.d/vncboot
USER=root
HOME=/root
export USER HOME
case "$1" in
start)
echo "Starting VNC Server"
#Insert your favoured settings for a VNC session
sudo /usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565
;;
stop)
echo "Stopping VNC Server"
/usr/bin/vncserver -kill :0
;;
*)
echo "Usage: /etc/init.d/vncboot {start|stop}"
exit 1
;;
esac
exit 0
-
Save this file as
vncboot.
- Make this file executable:
chmod 755 vncboot
- Enable dependency-based boot sequencing:
update-rc.d /etc/init.d/vncboot defaults
- If enabling dependency-based boot sequencing was successful, you will see this:
update-rc.d: using dependency based boot sequencing
- But if you see this:
update-rc.d: error: unable to read /etc/init.d//etc/init.d/vncboot
- then try the following command:
update-rc.d vncboot defaults
- Reboot your Raspberry Pi and you should find a VNC server already started.
- Install a VNC viewer in your laptop OS.
Remember that if you want to start de RASPBIAN GUI you must run the "startx" command.
Suscribirse a:
Comentarios (Atom)