{"id":3761,"date":"2020-08-22T15:51:00","date_gmt":"2020-08-22T22:51:00","guid":{"rendered":"http:\/\/www.hi-alex.com\/?p=3761"},"modified":"2020-08-23T06:22:18","modified_gmt":"2020-08-23T06:22:18","slug":"raspberry-pi-%e7%bb%a7%e7%bb%ad%e6%8a%98%e8%85%beflightairmap","status":"publish","type":"post","link":"http:\/\/www.hi-alex.com\/?p=3761","title":{"rendered":"Raspberry Pi &#8211; \u7ee7\u7eed\u6298\u817eFlightAirMap"},"content":{"rendered":"\n<p>PiAware\u6700\u5927\u7684\u95ee\u9898\u662f\u6ca1\u529e\u6cd5\u8bb0\u5f55\u66fe\u7ecf\u68c0\u6d4b\u8fc7\u7684\u98de\u673a\uff0c\u4e8e\u662f\u6211\u53c8\u5f00\u59cb\u6298\u817e\u8d77\u4e86\u529f\u80fd\u66f4\u5f3a\u5927\u7684<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Ysurac\/FlightAirMap\" target=\"_blank\">FlightAirMap<\/a>\u3002<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Ysurac\/FlightAirMap\/wiki\/Raspbian\" target=\"_blank\">\u5b89\u88c5\u8fc7\u7a0b<\/a>\uff1a<\/h2>\n\n\n\n<p>Install git, mariadb, apache and PHP with needed modules:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install git mariadb-server apache2 php5 php5-curl php5-mysql php5-gd php-pclzip<\/code><\/pre>\n\n\n\n<p>Or this on Stretch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>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<\/code><\/pre>\n\n\n\n<p>Get FlightAirMap from git:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\nsudo git clone --recursive --depth=1 http:\/\/github.com\/ysurac\/flightairmap<\/code><\/pre>\n\n\n\n<p>Edit Apache conf&nbsp;<em>\/etc\/apache2\/site-available\/000-default.conf<\/em>, add this in VirtualHost section:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:8088>\n        ServerName 192.168.68.128\/flightairmap\n        DocumentRoot \"\/var\/www\/flightairmap\"\n        &lt;Directory \/var\/www\/flightairmap>\n                Options Indexes FollowSymLinks\n                AllowOverride All\n                Require all granted\n        &lt;\/Directory>\n&lt;\/VirtualHost>\n<\/code><\/pre>\n\n\n\n<p>Enable mod rewrite:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2enmod rewrite<\/code><\/pre>\n\n\n\n<p>Restart apache2:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service apache2 restart<\/code><\/pre>\n\n\n\n<p>Fix permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/flightairmap\nsudo chmod 666 require\/settings.php\nsudo chmod 777 install\/tmp\nsudo chmod 777 data<\/code><\/pre>\n\n\n\n<p>Create database and user, may skip if already created:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p\nupdate mysql.user set password=password('YOUR_DB_PASSWORD') where user='root';<\/code><\/pre>\n\n\n\n<p>Then:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE `flightairmap`;\nGRANT ALL ON `flightairmap`.* TO 'youruser'@'localhost' IDENTIFIED BY 'yourpass';\nFLUSH PRIVILEGES;<\/code><\/pre>\n\n\n\n<p>Now use your browser to go to&nbsp;<a href=\"http:\/\/127.0.0.1\/install\/\">http:\/\/127.0.0.1\/install\/<\/a>&nbsp;(or ip of your server) Run&nbsp;<em>scripts\/update_db.php<\/em>&nbsp;in a shell.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/flightairmap\/\nphp scripts\/update_db.php<\/code><\/pre>\n\n\n\n<p>Add FlightAirMap service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo cp \/var\/www\/flightairmap\/install\/init\/flightairmap.service.systemd \/etc\/systemd\/system\/flightairmap.service<\/code><\/pre>\n\n\n\n<p>Alter paths to match your path, may skip i no change to the installation folder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/systemd\/system\/flightairmap.service\nsudo chmod 644 \/etc\/systemd\/system\/flightairmap.service<\/code><\/pre>\n\n\n\n<p>Then you can run flightairmap daemon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable flightairmap.service<\/code><\/pre>\n\n\n\n<p>Add&nbsp;<em>update_db.php<\/em>&nbsp;in&nbsp;<em>\/etc\/crontab<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo 5 * * * * root php \/var\/www\/flightairmap\/scripts\/update_db.php >\/dev\/null 2>&amp;1<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u8fd0\u884c\u6548\u679c\uff1a<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"wp-content\/uploads\/2020\/08\/FlightAirMap1-1024x632.jpg\" alt=\"\" class=\"wp-image-3776\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"wp-content\/uploads\/2020\/08\/FlightAirMap2-1024x660.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"wp-content\/uploads\/2020\/08\/FlightAirMap3-1024x683.jpg\" alt=\"\" class=\"wp-image-3778\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"wp-content\/uploads\/2020\/08\/FlightAirMap4-1024x556.jpg\" alt=\"\" class=\"wp-image-3779\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>PiAware\u6700\u5927\u7684\u95ee\u9898\u662f\u6ca1\u529e\u6cd5\u8bb0\u5f55\u66fe\u7ecf\u68c0\u6d4b\u8fc7\u7684\u98de\u673a\uff0c\u4e8e\u662f\u6211\u53c8\u5f00\u59cb\u6298\u817e\u8d77\u4e86\u529f\u80fd\u66f4\u5f3a\u5927\u7684FlightAirMap\u3002 \u5b89\u88c5\u8fc7\u7a0b\uff1a Install git, mariadb, apache and PHP with needed modules: Or this on Stretch: Get FlightAirMap from git: Edit Apache conf&nbsp;\/etc\/apache2\/site-available\/000-default.conf, add this in VirtualHost section: Enable mod rewrite: Restart apache2: Fix permissions: Create database and user, may skip if already created: Then: Now use your browser to go to&nbsp;http:\/\/127.0.0.1\/install\/&nbsp;(or ip of your server) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-3761","post","type-post","status-publish","format-standard","hentry","category-20"],"_links":{"self":[{"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=\/wp\/v2\/posts\/3761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3761"}],"version-history":[{"count":1,"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=\/wp\/v2\/posts\/3761\/revisions"}],"predecessor-version":[{"id":3775,"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=\/wp\/v2\/posts\/3761\/revisions\/3775"}],"wp:attachment":[{"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3761"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hi-alex.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}