which mentions to downgrade PH. But I rather not do that.
My end goal is to also turn my RaspPi into a webserver, but I am mainly familiar with Apache and even Nginx. Also, some services I am wanting to reverse proxy into, I have instructions for Apache, but nothing for lighttpd. So the smallest change (I think) is to move PH from lighttpd to apache, rather than move all the services to lighttpd, etc.
Hi,
I am running the apache webserver instead of lighttpd on the pi3 with xbian installed. So yes it is possible to migrate using another webserver.
I did not encounter problems with the functionality of the pi-hole gui.
Only downside is, that if you upgrade pi-hole using the update script, it will automatically install lighttpd.
So after upgrading I run: sudo apt-get remove lighttpd
to uninstall lighttpd.
It has been a long time ago since I installed Apache, but the thing is that I already installed it on the Pi before installing pi-hole. I remember that installing Apache was just a standard default install.
sudo apt-get install apache2
I also installed php5 (but only needed if you use php in webpages)
sudo apt-get install php5
Apache uses /var/www/html as default location for your webpages.
Since pi-hole gets installed in the same directory (in sub-directory pihole), there is nothing extra to be done to use the apache server except from starting it: sudo service apache2 starrt
In the webbrowser I request webpage:
'http://xbian/admin/index.php
or you can use the pi ip-address instead of 'xbian' in the URL.
would be a nice feature for the install script where you could select lighttpd or apache i am not sure if thats possible since there is a lighttpd.conf for the pi-hole /etc/lighttpd/lighttpd.conf. but i am sure it has been already discussed just have to look around the internet.
what is the vhost setup though? iirc (haven't looked at it recently), but it had a setup for the admin, and then another for handling of the DNS queries.
I know there are people who have switched to Apache. You could try looking at the DietPi fork (not maintained by the Pi-hole team) as that uses Apache. It might help give you some clues.
We are working to develop Pi-hole so it can be used with your choice of Web server and/or resolver.
Awesome! I hope you will add NGINX support too. Also I am looking for some info on how to host a website side-by-side with pi-hole. As far as I know it is not possible to host any site on localhost:80 when using pi-hole, or am I wrong? I guess it would be possible to user port 443 for other sites.
Thanks, it works great! I wrote a little script to change the port:
#!/bin/bash
if (whiptail --title "Change Pi-hole port" --yesno "Do you want to change the port pi-hole uses?" 8 78) then
PORT_PIHOLE="89"
PORT_PIHOLE=$(whiptail --inputbox "Which port you do you want to use for Pi-hole?" 8 78 $PORT_PIHOLE --title "Pi-hole Port" 3>&1 1>&2 2>&3)
sed -i "s/server.port = 80/server.port = $PORT_PIHOLE/" /etc/lighttpd/lighttpd.conf
service lighttpd restart
fi
I just installed pihole on ubuntu server and because I already use Apache & PHP I uninstalled lighttpd.
I have several virtual sites on Apache so I added also pihole; all work without problems.
Here it is my config if anybody need to replicate for his use: edit: /etc/apache2/sites-available/000-default.conf
#=== pihole WEBSITE ===
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName pihole
ServerAlias pi.hole
DocumentRoot /var/www/html/dns
<Directory /var/www/html/dns/>
Options FollowSymLinks MultiViews
AllowOverride all
Order deny,allow
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/pihole_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/pihole_access.log combined
</VirtualHost>
#=== site1 WEBSITE ===
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName site1
DocumentRoot /var/www/html/site1
<Directory /var/www/html/site1/>
Options FollowSymLinks MultiViews
AllowOverride all
Order deny,allow
Deny from all
allow from 127.0.0.1
allow from 10.22.22.0/24
</Directory>
ErrorLog ${APACHE_LOG_DIR}/site1_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/site1_access.log combined
</VirtualHost>
#==== site2 WEBSITE ====
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName webtv
DocumentRoot /var/www/html/site2
<Directory /var/www/html/site2/>
Options FollowSymLinks MultiViews
AllowOverride all
Order deny,allow
Deny from all
allow from 10.22.22.0/24
allow from 127.0.0.1
</Directory>
ErrorLog ${APACHE_LOG_DIR}/site2_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/site2_access.log combined
</VirtualHost>
edit your server hosts file so you can access any website you need from server,
( if you host your custom files for blocking):
Something like sudo gedit or what ever your editor is. Looks like Leafpad possibly.
If this is something that needs to be fixed for your project, just change the lighttpd listening port. You will not see the blocking page and you will have to change the address for the admin page to that chosen port but it will still use the DNS blocking.
I dont know what is the command actually, is it true?
I cant edit 000-default.conf file
pi@raspberrypi:/etc/apache2/sites-available $ cd 000-default.conf
-bash: cd: 000-default.conf: Not a directory
pi@raspberrypi:/etc/apache2/sites-available $