Skip to content
Ycarus edited this page Oct 3, 2017 · 21 revisions

Install using Apache and MariaDB

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

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

Or this on Stretch:

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
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:

DocumentRoot "/var/www/flightairmap"
<Directory /var/www/flightairmap>
   Options +Indexes +FollowSymLinks -MultiViews
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>

Enable mod rewrite:

a2enmod rewrite

Restart apache2:

/etc/init.d/apache2 restart

Fix permissions:

chmod 666 require/settings.php
chmod 777 install/tmp 
chmod 777 data

Create database and user:

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

Then:

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

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

Add FlightAirMap service:

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

Alter paths to match your path:

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

Then you can run flightairmap daemon:

systemctl enable flightairmap.service

Add update_db.php in /etc/crontab:

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

Install using Lighttpd and MariaDB

Update and install needed packages:

sudo -s
apt-get update
apt-get upgrade
apt-get install lighttpd 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 mariadb-server mariadb-client git

Create MySQL root password and DB:

sudo mysql -u root

   > 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';
   > FLUSH PRIVILEGES;
   > ctrl + z

Enable lighttpd modules:

lighty-enable-mod fastcgi-php
service lighttpd force-reload

Install FlightAirMap:

cd /var/www
git clone --recursive --depth=1 http://github.com/ysurac/flightairmap
chmod 666 flightairmap/require/settings.php
chmod 777 flightairmap/install/tmp
chmod 777 flightairmap/data
chmod 777 flightairmap/images/airlines
ln -s /var/www/flightairmap/install/89-flightairmap-lighttpd.conf /etc/lighttpd/conf-available/

Enable FlightAirMap module:

lighty-enable-mod flightairmap-lighttpd
/etc/init.d/lighttpd force-reload

Add FlightAirMap service:

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

Now use your browser to go to http://127.0.0.1/flightairmap/install/ (or ip of your server)

Run scripts/update_db.php in a shell. Then you can run flightairmap daemon:

systemctl enable flightairmap.service

Add update_db.php in /etc/crontab:

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

Script to Install using Lighttpd and MariaDB

This script will install mariadb, create root pass, flightairmap database and install lighttpd with php7.

It's easy, on the raspberry pi with Stretch do this after login as pi user:

wget http://data.flightairmap.com/scripts/install_flightairmap_lighttpd.sh
chmod u+x install_flightairmap_lighttpd.sh

Edit the file to change MariaDB root password and DB user and pass:

nano install_flightairmap_lighttpd.sh

Run it:

./install_flightairmap_lighttpd.sh

Now go to http://raspberrypi_ip/flightairmap/install/ and use DB user and pass set in install_flightairmap_lighttpd.sh.

On the raspberry run update_db.php:

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

Then run the daemon:

sudo systemctl start flightairmap

Add update_db.php in /etc/crontab:

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

It's all.

Clone this wiki locally