Install lightweight Web server with PHP and MySQL on Raspberry Pi

Original instructions here .

This installs lighttpd Web server with MySQL database and PHP interpreter.

  • apt-get update
  • sudo apt-get install lighttpd
  • sudo apt-get install mysql-server
  • sudo apt-get install php5-common php5-cgi php5
  • sudo apt-get install php5-mysql
  • sudo lighty-enable-mod fastcgi-php
  • sudo service lighttpd force-reload
Advertisements

CUPS – Unable to send data to printer

You can’t  print. In CUPS Web interface (port 631 of your print server) you see a message:

Paused – “Unable to send data to printer.”

Try to solve it like this:

  • Go to Printers
  • Click your printer name
  • Select Maintenance
  • Select Resume Printer

Can’t compile motion with RTSP on Raspberry Pi

You want to compile motion with RTSP support on Raspberry Pi, but you can’t.

.configure gives you this message:

**********************************************
* libavcodec.a or libavcodec.so or *
* libavformat.a or libavformat.so not found: *
* ALL FFMPEG FEATURES DISABLED *
* *
* Please read the Motion Guide for help: *
* http://motion.sourceforge.net *
**********************************************

Which means that  while motion will build, it will be lacking the RTSP support.

Possible reason:

Files do exist, but ./configure just doesn’t find them.

Solution:

Go to /usr/lib/arm-linux-gnueabihf.

See if there exist the aforementioned files.

If they don’t you need to install extra packages:

  • apt-get install libavformat-dev libavconv-dev libjpeg-dev

If they do, manually soft-link them into /usr/lib and run ./configure again.

If that was the problem, you will see a different message:

checking for ffmpeg autodetecting libraries... found in /usr/lib
checking for ffmpeg headers in /usr... found /usr/include/libavformat/avformat.h

Raspberry Pi configuration utility

You can complete tasks like expanding the main partition of the SD card,  or setting a time zone, or activating the camera module by using the raspi-config utility.


Date from time server for Raspberry Pi

If you need you can install ntpdate to keep up time of your Raspberry Pi:

  • apt-get install ntpdate

P.S.

If you have problems updating date from the time server, try stopping the ntp service for a while:

  • sudo service ntp stop
  • sudo ntpdate -s time.nist.gov
  • sudo service ntp start

Follow symlinks in ProFTPd

As a normal security precaution you would restrict your FTP users to their home directories with “DefaultRoot ~”.

But then you face a problem – how to follow symlinks to other parts of your file system.

The answer: mount them with the “bind” option!

For example, inside your user’s home directory do this:

  • mount –bind /media/sdb2/mydocs/archive /home/username/archive

Of course you have to check and adjust the file permissions as needed after that.


Installing DHCP server in Linux

Say, you want to install a DHCP server to your Raspberry Pi (Running Raspbian Linux OS, a version of Debian, similar to Ubuntu and Mint ) computer for a subnet 192.168.10.*.

It’s very easy, actually.

Install the server software (and ignore the startup failure message at the end of installation):

apt-get install isc-dhcp-server
Edit the configuration file (very simple basic config is shown):
/etc/dhcp/dhcpd.conf

To contain this:

ddns-update-style none;

option domain-name “my_domain.my_lan”;
option domain-name-servers 8.8.8.8, 8.8.4.4;

default-lease-time 86400;
max-lease-time 604800;
    
authoritative;

subnet 192.168.10.0 netmask 255.255.255.0 {
 range 192.168.10.30 192.168.10.254;
 option routers 192.168.10.1;
}

Restart the DHCP server:
/etc/init.d/isc-dhcp-server restart