Difference between revisions of "Install REST"

From xPL
Jump to: navigation, search
(Replaced content with "Controlling the home from distance can be made via web access methods such as the [http://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_APIs RESTful] A...")
(Install a web server)
Line 4: Line 4:
  
 
= Install a web server =
 
= Install a web server =
 +
Install [https://www.lighttpd.net/ lighttpd] and [http://www.php.net/ 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 <code>/etc/lighttpd/lighttpd.conf</code> 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 <code>/var/www/html/index.php</code>:
 +
<?php phpinfo(); ?>
 +
 +
Browse to the PC and check <code>index.php</code>.
  
 
[[Category: all]] [[Category: install]] [[Category: web]]
 
[[Category: all]] [[Category: install]] [[Category: web]]

Revision as of 11:38, 28 February 2019

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.