Raspberry Pi – 继续折腾FlightAirMap



Install git, mariadb, apache and PHP with needed modules:

sudo apt-get install git mariadb-server apache2 php5 php5-curl php5-mysql php5-gd php-pclzip

Or this on Stretch:

sudo apt-get install git mariadb-server apache2 php7.0-common php7.0-cgi php7.0-mysql php7.0-curl php7.0 php7.0-xml php7.0-zip php7.0-gd php7.0-json

Get FlightAirMap from git:

cd /var/www
sudo git clone --recursive --depth=1 http://github.com/ysurac/flightairmap

Edit Apache conf /etc/apache2/site-available/000-default.conf, add this in VirtualHost section:

<VirtualHost *:8088>
        DocumentRoot "/var/www/flightairmap"
        <Directory /var/www/flightairmap>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted

Enable mod rewrite:

sudo a2enmod rewrite

Restart apache2:

sudo service apache2 restart

Fix permissions:

cd /var/www/flightairmap
sudo chmod 666 require/settings.php
sudo chmod 777 install/tmp
sudo chmod 777 data

Create database and user, may skip if already created:

mysql -u root -p
update mysql.user set password=password('YOUR_DB_PASSWORD') where user='root';


CREATE DATABASE `flightairmap`;
GRANT ALL ON `flightairmap`.* TO 'youruser'@'localhost' IDENTIFIED BY 'yourpass';

Now use your browser to go to (or ip of your server) Run scripts/update_db.php in a shell.

cd /var/www/flightairmap/
php scripts/update_db.php

Add FlightAirMap service:

sudo cp /var/www/flightairmap/install/init/flightairmap.service.systemd /etc/systemd/system/flightairmap.service

Alter paths to match your path, may skip i no change to the installation folder:

sudo nano /etc/systemd/system/flightairmap.service
sudo chmod 644 /etc/systemd/system/flightairmap.service

Then you can run flightairmap daemon:

sudo systemctl enable flightairmap.service

Add update_db.php in /etc/crontab:

sudo 5 * * * * root php /var/www/flightairmap/scripts/update_db.php >/dev/null 2>&1


Leave a Reply

Your email address will not be published.