Skip to content

thojust/remotepi

Repository files navigation

Compiled by Justin Thomas 2020

Credits

STEP 1

make sure apache is installed s

sudo apt update sudo apt install apache2 -y

STEP 2

make sure php is installed

sudo apt install php libapache2-mod-php -y

STEP 3

make sure flask and pip python libs are installed

pip was already installed for me

sudo apt-get install python-pip sudo pip install psutil flask

STEP 4

##copy /remote/ to /var/www/html/ ### apache documents folder

STEP 5

Make sure our python directory is writable & X (notably reboot.log is writable) ### Find a better way then chmod 777 if possible!!!

sudo chmod 777 /var/www/html/remote/python/ sudo chmod 777 /var/www/html/remote/python/reboot.log

STEP 6

add the following code to bottom of file using sudo visudo to allow apache to execute python scripts that call sudo user

type:

sudo visudo

scroll to bottom

www-data ALL=/sbin/reboot www-data ALL=NOPASSWD: /sbin/reboot www-data ALL=/sbin/shutdown www-data ALL=NOPASSWD: /sbin/shutdown

STEP 6

add the following users to .htpasswd

#admin pw= your choice $fakeuser pw= fake

sudo htpasswd -c /etc/apache2/.htpasswd admin sudo htpasswd /etc/apache2/.htpasswd fakeuser

STEP 7

Now edit Apache config file on my pi its here

sudo nano /etc/apache2/apache2.conf

and edit this part to reflect this:

<Directory /var/www/> AllowOverride All

STEP 8 ### Restart Apache

sudo /etc/init.d/apache2 restart

ALL SET!!! ##### Now browse to hostname.local/remote/ and you should be all set!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published