How to install PIHome

Be sure before you install PIHome, you need to install wiringPI and rcswitch-pi

instal wiringPI in this directory "/home/div/wiringPI/",
rcswitch-pi in this directory "/home/div/rcswitch-pi/" and
the apache webserver directory must have this path "/home/www/".


Install wiringPI & rcswitch-pi

# Preparation for wiringPI and rcswitch-pi
cd /home
mkdir div
cd /home/div

# Install wiringPI
git clone git://git.drogon.net/wiringPi
cd wiringPi
sudo ./build

# Testing wiringPI
gpio -v
gpio readall

# Install rcswitch-pi
cd /home/div
git clone https://github.com/r10r/rcswitch-pi.git
cd rcswitch-pi
make

# Test rcswitch-pi
sudo ./send 10000 1 1


Install Apache Webserver

# Install Apache webserver
apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2-suexec libexpat1 ssl-cert php5 php5-common php5-curl php5-cli php5-dev php5-gd php5-idn php5-imagick php5-mysql php5-xcache libapache2-mod-php5

a2enmod suexec rewrite ssl actions include

# Instal Mysql and phpMyAdmin (recommendation user:root pass:root).
apt-get install mysql-server phpmyadmin

# Make directory
cd /home/ && mkdir www

# change webserver directory
nano /etc/apache2/sites-available/default
# DocumentRoot /var/www         ->    DocumentRoot /home/www
# <Directory /var/www/>         ->   <Directory /home/www/>

# change for mod_rewrite
# AllowOverride None            ->   AllowOverride FileInfo

# "ctrl + o" = save  
# "ctrl + x" = close
 
# Restart Apache2
/etc/init.d/apache2 restart
# [ Apache installation fertig ]



Install PIHome

# [ Install PIHome ]

# Change directory
cd /home/pi/

# Download PIHome from GitHub
git clone https://github.com/cerosx/RPI.PIHome2.0-GUI-Frontend/

# Copy all files in the web server directory
cp -r /home/pi/RPI.PIHome2.0-GUI-Frontend/pihome/* /home/www/
cp /home/pi/RPI.PIHome2.0-GUI-Frontend/pihome/.htaccess /home/www/

# awarded rights
sudo chown www-data:www-data /home/www
sudo chmod 775 /home/www
sudo usermod -a -G www-data pi

# rights for use rcswitch per website
sudo visudo
# add the following line
www-data ALL=NOPASSWD: /home/div/rcswitch-pi/send
# CTRL + O -> save
# CTRL + X -> close



Install Cronjobs

# open crontab editor
sudo crontab -e

# add the following lines
*/5 * * * * php /home/www/cron/weather.php 
* * * * * php /home/www/cron/sunrise_sunset.php
* * * * * php /home/www/cron/gcal.php
* * * * * php /home/www/cron/caldav.php

# CTRL + O -> save
# CTRL + X -> close


Install PIHome database

Go to: http://rpi-ip/phpmyadmin/

Create a database and name it "pihome"

Click on pihome database. Now you are in the pihome database? Check it at the breadcrump navigation " localhost -> pihome "

Then click on the SQL tab.

Copy the content from the pihome.sql file, and paste it into the SQL field
and click " ok " for create tables.
pihome.sql

you are now ready for login

http://rpi-ip/
# username: admin
# password: pihome


#### DONE & HAVE FUN ####


Donate for PIHome