Install REST

From xPL
Revision as of 11:38, 28 February 2019 by Fcorthay (Talk | contribs)

Jump to: navigation, search

Controlling the home from distance can be made via web access methods such as the RESTful API.

Before all, make sure you have installed an xPL hub.

Install a web server

Install lighttpd and PHP:

su
apt install -y lighttpd
apt install -y php-common php-cgi php
lighty-enable-mod fastcgi-php
service lighttpd force-reload
cat /etc/lighttpd/lighttpd.conf

Edit /etc/lighttpd/lighttpd.conf and modify:

index-file.names            = ( "index.html", "index.php" )

Update the changes on the server:

service lighttpd force-reload
mv /var/www/html/index.lighttpd.html var/www/html/index.html

Browse to the PC and check the default web page.

Create a PHP test page /var/www/html/index.php:

<?php phpinfo(); ?>

Browse to the PC and check index.php.