-
Notifications
You must be signed in to change notification settings - Fork 12
Instruction guide (Archlinux)
Once you finish with Arch Linux, log in ssh and change the root password
- [root@plugpc ~]# passwd
Configure your system
- [root@plugpc ~]# timedatectl set-timezone Europe/Brussels
- [root@plugpc ~]# localectl set-keymap be-latin1
- [root@plugpc ~]# hostnamectl set-hostname Plugbox
To list available zones use: timedatectl list-timezones and set-keymap
Add you hosts name in hosts list,it should match the one you previously set
- [root@plugpc ~]# nano /etc/hosts
eg: 127.0.0.1 localhost.localdomain localhost Plugbox Update the whole things and install converter drivers (may takes a while)
- [root@plugpc ~]# pacman -Suy linux-firmware wget
- [root@plugpc ~]# sync
- [root@plugpc ~]# systemctl reboot
Your system will reboot. Login in using your new password.
Installing nginx and PHP
- [root@plugpc ~]# pacman -Sy nginx php php-cgi php-fpm
Put this nginx config file, this fastcgi_params and this fastcgi.conf file in /etc/nginx/ Configuring php :
- [root@plugpc ~]# nano /etc/php/php.ini
uncomment (remove the ;) extension=calendar.so and curl.so Enable nginx and php-fpm service on boot and start it :
- [root@plugpc ~]# systemctl enable php-fpm
- [root@plugpc ~]# systemctl start php-fpm
- [root@plugpc ~]# systemctl enable nginx
- [root@plugpc ~]# systemctl start nginx
At this stage you should be able to see your empty webserver running
Since PHP 7.4 there is hardening options. You must allow to use your com. devices by setting PrivateDevices=false in php-fpm.service. Check your version with "php -v", do "systemctl status php-fpm" for details
- [root@plugpc ~]# php -v
- [root@plugpc ~]# systemctl edit --full php-fpm.service
- [root@plugpc ~]# systemctl daemon-reload
- [root@plugpc ~]# systemctl restart php-fpm
- [root@plugpc ~]# systemctl status php-fpm
Check /var/lock permissions, some distros have 755 by default. If so, change it to 777 because application like aurora need to write port lock in there as http user.
- [root@plugpc ~]# ls -al /var/lock
- [root@plugpc ~]# cp /usr/lib/tmpfiles.d/legacy.conf /etc/tmpfiles.d/
- [root@plugpc ~]# nano /etc/tmpfiles.d/legacy.conf
- [root@plugpc ~]# systemctl reboot
Download the Aurora inverter communication application from here and compilators
- [root@plugpc ~]# pacman -Sy make gcc
Put aurora in your /home folder
then extract
- [root@plugpc ~]# tar -xzvf aurora*.tar.gz
- [root@plugpc ~]# cd aurora*
- [root@plugpc ~]# make
- [root@plugpc ~]# make install
Make sure the communication with the inverter(s) work and is reliable ! (eg: aurora -a2 -T -d0 -e /dev/ttyUSB0)
Allow the http user to run aurora and use the com ports :
- [root@plugpc ~]# chmod a+x /usr/local/bin/aurora
- [root@plugpc ~]# usermod -a -G uucp http
If you wish to received email notification from 123Solar, install msmtp (Easy and simple SMTP client)
- [root@plugpc ~]# pacman -Sy msmtp ca-certificates
edit the configuration file /etc/msmtprc, if you use gmail, you better generate an application password.
eg :
# Accounts will inherit settings from this section
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# Gmail address
account gmail
host smtp.gmail.com
port 587
from [email protected]
user [email protected]
password spoutnik
# Set a default account
account default : gmail
The permission and ownership of /etc/msmtprc should be set -precisely- to -rw------- 1 http root
- [root@plugpc ~]# chmod 600 /etc/msmtprc
- [root@plugpc ~]# chown http:root /etc/msmtprc
Look for sendmail_path option in /etc/php/php.ini and edit it like this : sendmail_path = "/usr/bin/msmtp -C /etc/msmtprc -t"
Restart nginx
- [root@plugpc ~]# systemctl restart nginx php-fpm
Put the archive on your web server's folder then extract.
- [root@plugpc ~]# tar -xzvf 123solar*.tar.gz Go then in your browser for configuration (eg: http://yourIP/123solar/).
Once the http authentication files have been setup, you need to uncomment the lines "Uncomment those lines" in the /etc/nginx/nginx.conf example.
- [root@plugpc ~]# systemctl restart nginx