From 6d0c67af9abc6732702a86b677bb10c8f55d0fa0 Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Tue, 27 Oct 2015 16:16:22 -0500 Subject: [PATCH 1/4] Install and enable PHP Needed to view the admin web interface --- automated install/basic-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9b5ed24b..358cf8ea 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -51,7 +51,7 @@ sudo apt-get -y install dnsmasq sudo update-rc.d dnsmasq enable echo "Installing a Web server" -sudo apt-get -y install lighttpd +sudo apt-get -y install lighttpd php5-common php5-cgi php5 sudo chown www-data:www-data /var/www sudo chmod 775 /var/www sudo usermod -a -G www-data pi @@ -66,6 +66,7 @@ sudo mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig sudo mv /var/www/index.lighttpd.html /var/www/index.lighttpd.orig sudo curl -o /etc/dnsmasq.conf "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/dnsmasq.conf" sudo curl -o /etc/lighttpd/lighttpd.conf "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/lighttpd.conf" +sudo lighty-enable-mod fastcgi fastcgi-php sudo mkdir /var/www/pihole sudo curl -o /var/www/pihole/index.html "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html" From bc3ece778d6d834ba1b2829d8b672b0d710ca2ac Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Tue, 27 Oct 2015 16:19:01 -0500 Subject: [PATCH 2/4] /var/www/html instead of /var/www lighttpd in Jessie uses /var/www/html for the root folder, so in order to only edit one lightpd.conf file, the installer will create the correct directory even if not being run on Jessie. --- automated install/basic-install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 358cf8ea..0249be78 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -52,8 +52,9 @@ sudo update-rc.d dnsmasq enable echo "Installing a Web server" sudo apt-get -y install lighttpd php5-common php5-cgi php5 -sudo chown www-data:www-data /var/www -sudo chmod 775 /var/www +sudo mkdir /var/www/html +sudo chown www-data:www-data /var/www/html +sudo chmod 775 /var/www/html sudo usermod -a -G www-data pi echo "Stopping services to modify them..." @@ -67,8 +68,8 @@ sudo mv /var/www/index.lighttpd.html /var/www/index.lighttpd.orig sudo curl -o /etc/dnsmasq.conf "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/dnsmasq.conf" sudo curl -o /etc/lighttpd/lighttpd.conf "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/lighttpd.conf" sudo lighty-enable-mod fastcgi fastcgi-php -sudo mkdir /var/www/pihole -sudo curl -o /var/www/pihole/index.html "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html" +sudo mkdir /var/www/html/pihole +sudo curl -o /var/www/html/pihole/index.html "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html" echo "Locating the Pi-hole..." sudo curl -o /usr/local/bin/gravity.sh "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/gravity.sh" From cfc469723634293d9b7154dd5005cca23a6c3bc4 Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Tue, 27 Oct 2015 16:21:20 -0500 Subject: [PATCH 3/4] Download and install the Web interface dnsmasq also needs to be able to read the log file to properly display the statistics --- automated install/basic-install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 0249be78..9f4892a6 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -71,6 +71,15 @@ sudo lighty-enable-mod fastcgi fastcgi-php sudo mkdir /var/www/html/pihole sudo curl -o /var/www/html/pihole/index.html "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html" +echo "Installing the Web interface..." +sudo wget https://github.com/jacobsalmela/AdminLTE/archive/master.zip -O /var/www/master.zip +sudo unzip /var/www/master.zip -d /var/www/html/ +sudo mv /var/www/AdminLTE-master /var/www/html/admin +sudo rm /var/www/master.zip 2>/dev/null +sudo touch /var/log/pihole.log +sudo chmod 644 /var/log/pihole.log +sudo chown dnsmasq:root /var/log/pihole.log + echo "Locating the Pi-hole..." sudo curl -o /usr/local/bin/gravity.sh "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/gravity.sh" sudo curl -o /usr/local/bin/chronometer.sh "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/Scripts/chronometer.sh" From 7a0b92d2c1c38043274d0b945e22df82626e5765 Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Tue, 27 Oct 2015 17:03:48 -0500 Subject: [PATCH 4/4] missed a few file paths --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9f4892a6..7c48fdba 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -64,7 +64,7 @@ sudo service lighttpd stop echo "Backing up original config files and downloading Pi-hole ones..." sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig sudo mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig -sudo mv /var/www/index.lighttpd.html /var/www/index.lighttpd.orig +sudo mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig sudo curl -o /etc/dnsmasq.conf "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/dnsmasq.conf" sudo curl -o /etc/lighttpd/lighttpd.conf "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/lighttpd.conf" sudo lighty-enable-mod fastcgi fastcgi-php @@ -74,7 +74,7 @@ sudo curl -o /var/www/html/pihole/index.html "https://raw.githubusercontent.com/ echo "Installing the Web interface..." sudo wget https://github.com/jacobsalmela/AdminLTE/archive/master.zip -O /var/www/master.zip sudo unzip /var/www/master.zip -d /var/www/html/ -sudo mv /var/www/AdminLTE-master /var/www/html/admin +sudo mv /var/www/html/AdminLTE-master /var/www/html/admin sudo rm /var/www/master.zip 2>/dev/null sudo touch /var/log/pihole.log sudo chmod 644 /var/log/pihole.log