AXIOM Beta/Software Installations

From apertus wiki
Revision as of 14:23, 19 July 2020 by Sebastian (talk | contribs) (→‎Installing a Webserver)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page contains guides for installing various software inside the AXIOM Beta that is not part of the AXIOM Beta firmware by default currently. It might find its way into the default firmware in the future though.

1 Installing a Webserver

Note that the webserver is already installed by default in AXIOM Beta Firmware Version 2.0. The following guide is legacy information for Firmware 1.0:

Make sure the AXIOM Beta is connected to the internet and then on the commandline run:

Update mirrors database:

pacman -Syy


Install webserver:

pacman -S lighttpd php php-cgi


Start the webservice:

systemctl start lighttpd


Write any pending changes to the file system:

sync



2 Configuring a Webserver

This follows the guide on the lighttpd archlinux wiki page: https://wiki.archlinux.org/index.php/lighttpd

mkdir /etc/lighttpd/conf.d/
nano /etc/lighttpd/conf.d/cgi.conf


... and place the following content in the file:

server.modules += ( "mod_cgi" )

 cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".cgi" => "/usr/bin/perl",
                               ".rb"  => "/usr/bin/ruby",
                               ".erb" => "/usr/bin/eruby",
                               ".py"  => "/usr/bin/python",
                               ".php" => "/usr/bin/php-cgi" )

 index-file.names           += ( "index.pl",   "default.pl",
                               "index.rb",   "default.rb",
                               "index.erb",  "default.erb",
                               "index.py",   "default.py",
                               "index.php",  "default.php" )


For PHP scripts you will need to make sure the following is set in /etc/php/php.ini

cgi.fix_pathinfo = 1


In your Lighttpd configuration file, /etc/lighttpd/lighttpd.conf add:

include "conf.d/cgi.conf"


... create a new configuration file /etc/lighttpd/conf.d/fastcgi.conf

# Make sure to install php and php-cgi. See:                                                             
# https://wiki.archlinux.org/index.php/Fastcgi_and_lighttpd#PHP

server.modules += ("mod_fastcgi")

# FCGI server
# ===========
#
# Configure a FastCGI server which handles PHP requests.
#
index-file.names += ("index.php")
fastcgi.server = ( 
    # Load-balance requests for this path...
    ".php" => (
        # ... among the following FastCGI servers. The string naming each
        # server is just a label used in the logs to identify the server.
        "localhost" => ( 
            "bin-path" => "/usr/bin/php-cgi",
            "socket" => "/tmp/php-fastcgi.sock",
            # breaks SCRIPT_FILENAME in a way that PHP can extract PATH_INFO
            # from it 
            "broken-scriptfilename" => "enable",
            # Launch (max-procs + (max-procs * PHP_FCGI_CHILDREN)) procs, where
            # max-procs are "watchers" and the rest are "workers". See:
            # https://redmine.lighttpd.net/projects/1/wiki/frequentlyaskedquestions#How-many-php-CGI-processes-will-lighttpd-spawn 
            "max-procs" => 4, # default value
            "bin-environment" => (
                "PHP_FCGI_CHILDREN" => "1" # default value
            )
        )
    )   
)


Make lighttpd use the new configuration file /etc/lighttpd/lighttpd.conf

include "conf.d/fastcgi.conf"


restart lighttpd:

systemctl restart lighttpd


To test php create a file: /srv/http/index.php with content:

<?php
phpinfo();
?>


... and open this IP address of your AXIOM Beta in a browser, if you see the php info status page everything worked successfully.




3 Installing AXIOM Beta Web GUI software

Note this Web GUI software is outdated and should not be used anymore, new version is in development, keeping documentation for reference.

Download this repository:

https://github.com/apertus-open-source-cinema/beta-software
  1. copy all files from the http directory of the repository to your AXIOM Beta /srv/http/ directory.
  2. copy all files from the beta-scripts directory of the repository to your AXIOM Beta /root/ directory.

Edit /etc/sudoers files:

under the line:

root ALL=(ALL) ALL

... add:

http ALL=(ALL) NOPASSWD: ALL

This allows the http user to do anything with the system so it can be considered a security vulnerability - but for development this should not be an issue, later on we will define the http priviledges more securely.

For testing sudoers:

sudo -u http sudo whoami

... if it returns "root" then you are all set.


This should provide you with a working web-based GUI.

Note: lighttpd does not start automatically when the AXIOM Beta boots, this still needs to be configured:

systemctl enable lighttpd

Warning: Opening any websites that read image sensor registers before initializing the image sensor (kick_manual.sh) will freeze/crash the camera.



4 Packet Manager Pacman

Update all package definitions and the database from the Internet:

pacman -Sy

Warning: Careful with upgrading existing packages. For example the Kernel used in the AXIOM Beta is custom developed - if you upgrade Arch Linux to the latest off-the-shelf Kernel you will BRICK your camera firmware.


Install lighttp webserver on the Beta:

pacman -S lighttpd


Install PHP on the Beta:

pacman -S php php-cgi


Follow these instructions: https://wiki.archlinux.org/index.php/lighttpd#PHP


Start the webserver:

systemctl start lighttpd