Skip to content

Notes regarding Apache

hydrogen602 edited this page Mar 29, 2019 · 6 revisions

Commands

systemctl restart apache2.service -> restart apache2

Locations

/etc/apache2
/var/www/html
/usr/lib/cgi-bin -> moved to /var/www/cgi-bin because of permission errors

Config apache2.conf

AddHandler cgi-script .cgi .py -> Add this to the <Directory /> thing
LoadModule cgid_module modules/mod_cgid.so -> Add this also

Also needs to be added to the config file:

ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
    #Options All
    AllowOverride All
    AddHandler cgi-script .cgi .d .py
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

    Order allow,deny

    Allow from all
</Directory>

On mods

Copy all cgi.\*, cgid.\* from mods-available to mods-enabled
Remeber to do sudo chmod a+rx on the files

Data Feed Page

A python program reads sensor data and writes it to a json every minute.
dataSheet.html calls dataGetter.js which GET requests the json and places it into the table of dataSheet.html. dataSheet.html and dataGetter.js should be in /var/www/html.
The python program will be in /var/www/scripts.

Clone this wiki locally