Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing port breaks /pihole #2720

Closed
3 tasks done
dom-madrid opened this issue Apr 25, 2019 · 13 comments
Closed
3 tasks done

Changing port breaks /pihole #2720

dom-madrid opened this issue Apr 25, 2019 · 13 comments
Labels
triage: Issue User Filled out Issue Template

Comments

@dom-madrid
Copy link

In raising this issue, I confirm the following: {please fill the checkboxes, e.g: [X]}

How familiar are you with the the source code relevant to this issue?:

1


Expected behaviour:

Install Pihole on a server with an existing web server on port 80/443, change lighttpd port from 80 to 8088 (to restrict access to only lan access - no web), get normal access for both /admin and /pihole

Actual behaviour:

/pihole no longer works (it does under port 80).
/admin works

Steps to reproduce:

Install Pihole
Change lighttpd.conf port from 80 to 8088
Restart lighttpd and pihole
Goto 192.168.1.xx:8088/pihole
get the following error:
[ERROR]: Unable to parse results from queryads.php: Unhandled error message ()

Debug token provided by uploading pihole -d log:

https://tricorder.pi-hole.net/i5wobdlcel!

Troubleshooting undertaken, and/or other relevant information:

Running on existing Ubuntu Server 16.04 LTS with both lighttp and Apache

@dschaper
Copy link
Member

There is no /pihole endpoint in the Pi-hole web server setup. How did you install Pi-hole?

@dschaper dschaper added the triage: Issue User Filled out Issue Template label Apr 25, 2019
@dom-madrid
Copy link
Author

I cloned the git repo as per https://github.com/pi-hole/pi-hole/#one-step-automated-install and followed alternate option 1.
Add'al Info
/var/www/html clearly has a /pihole folder
On a straight install to port 80 (on a different machine - VM or PM - Ubuntu or Raspbian), when accessing 192.168.1.xx/pihole you get the Pihole logo and an invitation to redirect to the /admin page.

@dschaper
Copy link
Member

There is a folder there, but there is no handling for that URL in the lighttpd configuration. That folder holds the 404 page that we use for the soon to be deprecated block page. Any URL will show that page (other than /admin) so 192.168.1.1/pi would redirect to that page.

What blocking mode are you using and do you need or use the block page?

@dom-madrid
Copy link
Author

I do not use block page - maybe I should or I missed a configuration step. I was just surprised it stopped working when changing the lighttpd port from 80 to something else.

@dschaper
Copy link
Member

If you use NULL blocking or NXDOMAIN you'll see a performance increase over IP. The trade off is that the block page is not functional. But with the change of more and more sites moving to TLS / HTTPS for delivery the block page becomes non-functional as well.

@dom-madrid
Copy link
Author

Thanks for the info. Not an issue then. Closing.

@mschoettle
Copy link
Contributor

mschoettle commented Dec 30, 2019

There does seem to be an issue. I changed the port as described above and when accessing http://pi.hole:<port> or http://<ip>:<port> I get the same error message. With the default port 80 it forwards to the admin page.

Appending /admin does work.

@DL6ER
Copy link
Member

DL6ER commented Dec 30, 2019

@mschoettle This means that lighttpd is still listening on port 80. Can you post the config file including your changes?

@mschoettle
Copy link
Contributor

mschoettle commented Dec 30, 2019

Thanks for the quick response @DL6ER. I changed server.port in /etc/lighttpd/lighttpd.conf. I tried changing it in external.conf but it gave me an error due to a duplicate config setting.

The lighttpd error log shows this:

(mod_fastcgi.c.421) FastCGI-stderr: PHP Warning: file(http://127.0.0.1/admin/scripts/pi-hole/php/queryads.php?domain=<ip/domain>:8080&amp;bp): failed to open stream: Connection refused in /var/www/html/pihole/index.php on line 130

http://127.0.0.1/admin/... is hard-coded there.

@DL6ER
Copy link
Member

DL6ER commented Dec 30, 2019

Ah, yes, I see this

$queryAds = file("http://127.0.0.1/admin/scripts/pi-hole/php/queryads.php?domain=$serverName&bp", FILE_IGNORE_NEW_LINES);

I have never used the blocking page, however, we should change this as we probably want to keep the blocking page? Pinging @dschaper and @WaLLy3K

@dschaper
Copy link
Member

Since this issue is about http://pi.hole/pihole please open a new issue, filling out the template with what you see and what you expect to see.

@dschaper
Copy link
Member

And see #2195 (comment)

@mschoettle
Copy link
Contributor

Since this issue is about http://pi.hole/pihole please open a new issue, filling out the template with what you see and what you expect to see.

/ (i.e., no redirect to admin page) and /pihole show the same content (/var/www/html/pihole/index.php) so it is the same problem. But since there is #2195 which is about the same problem I'm fine to continue there.

mschoettle added a commit to mschoettle/pi-hole that referenced this issue Mar 10, 2020
… and/or hostname.

See issues pi-hole#2195 and pi-hole#2720.

Signed-off-by: Matthias Schoettle <git@mattsch.com>
mschoettle added a commit to mschoettle/pi-hole that referenced this issue Apr 10, 2020
… and/or hostname.

See issues pi-hole#2195 and pi-hole#2720.

Signed-off-by: Matthias Schoettle <git@mattsch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage: Issue User Filled out Issue Template
Projects
None yet
Development

No branches or pull requests

4 participants