- You need to have PHP7.0+ with Apache and MySQL installed.
- You already have this if you have successfully run the SUPLA on the server.
- Create database for supla-scripts
- Enter the MySQL command prompt as
root
.Note: if you are on RaspberryPI based on SUPLA image, the root password is probably
raspberry
. I strongly encourage to change it to something else after successful installation of supla-scripts. - Create new schema:
CREATE SCHEMA suplascripts;
- Generate a strong password for example with http://passwordsgenerator.net
- Create a new database user and assign it to the created database:
CREATE USER 'suplascripts'@'localhost' IDENTIFIED BY 'THE_strong_PASSWORD'; GRANT ALL ON suplascripts.* TO 'suplascripts'@'localhost'; FLUSH PRIVILEGES;
- Exit the MySQL command prompt with
\q
.
- Enter the MySQL command prompt as
- Download and extract the latest supla-scripts release archive
to
/var/www/supla-scripts
.mkdir /var/www/supla-scripts tar -zxf supla-scripts-2.0.0.tar.gz -C /var/www/supla-scripts
- Enter this directory and create a configuration file
cd /var/www/supla-scripts cp var/config/config.sample.json var/config/config.json
- Open the
var/config/config.json
and- Set the
db/host
tolocalhost
. - Set the
db/password
to the password you have generated for MySQL. - Change
jwt/key
to something strong, different than MySQL password (generate a different value with any generator). - Set the
phpPath
to where yourphp
executable can be found, e.g./usr/bin/php
. Find it withwhich php
.
- Set the
- Initialize the application
php /var/www/supla-scripts/supla-scripts init
- As root (or with
sudo
privileges), create a virtual host configurationcp var/config/supla-scripts.vhost.sample.conf /etc/apache2/sites-available/supla-scripts.conf
- Adjust the
/etc/apache2/sites-available/supla-scripts.conf
to match your needs- Change the port the scripts should run on (the
*:1234
means that it will run on port1234
). - Uncomment and set the
ServerName
if the server has a domain name for the app. - Change
ServerAdmin
to something meaningful. - Fix paths to the SSL certificates (the default configuration uses the same certificates as SUPLA-Cloud).
- Change the port the scripts should run on (the
- Enable the virtual host and enable mod_rewrite
a2ensite supla-scripts a2enmod rewrite service apache2 restart
- Change the owner of the
/var/www/supla-scripts
directory towww-data
chown -R www-data:www-data /var/www/supla-scripts
- Check if the application is available on your server address and configured port.
- Install necessary crontabs by executing:
/var/www/supla-scripts/var/config/install-crontab.sh
- Download and extract the latest supla-scripts release archive
to the same directory as before.
tar -zxf supla-scripts-2.0.0.tar.gz -C /var/www/supla-scripts
php /var/www/supla-scripts/supla-scripts init
- Change the owner of the
/var/www/supla-scripts
directory towww-data
chown -R www-data:www-data /var/www/supla-scripts
Or use update script:
./sudo update.sh
Once before using the script, download it to your server:
wget https://github.com/fracz/supla-scripts/classic/update.sh