Uninstall Pihole

I would like to delete pi hole but when detailing what to delete I get critical things like "sudo" I would like to know how to do it.

Expected Behaviour:

The problem arose when I updated the latest version of pi hole, first it came out 403 forbidden and I looked for help in the forum, but the solution only made everything worse. I use nginx proxy manager and pi hole was working on 8082, but it also stopped working and the port change was not affected.
-operating system Raspberry pi

Actual Behaviour:

putty_4CY51SnpkE

Debug Token:

https://tricorder.pi-hole.net/4kMjOgBx/

Accessing the web interface using http://<IP_adress>/admin usually works.

If you are using port 8082, http://<IP_adress>:8082/admin should work.

image
I've this problem
image

Try this:

curl -I http://192.168.1.2:8082/admin/

image

Just to be sure:
did you reinstalled pi-hole after executing pihole uninstall?

(I'm not sure if you uninstalled or not)

The problem appeared after upgrading, I used the pihole -r command, but the problem remained, I tried to uninstall pi hole, but I almost took the operating system in the progress of not having read "delete sudo".

You said pi-hole was working using port 8082 before the update.

The only thing changed is:
there is no more redirection page on the root. You now need to add /admin/ (http://192.168.1.2:8082/admin/).

No other changes should be needed.

That is right, before the update. I just used pihole -r > reconfigure, and it let me log in with http://192.168.1.2/admin/, but the port does not change.
image

The port is not added automatically. You need to use http://192.168.1.2:8082/admin/.

Is there any config on the nginx to redirect to this port?

nginx cannot start because port 80 is in use. I try to use http://192.168.1.2:8082/admin/ but it does not work.
image

We can try to check the final lighttpd config, after reading all config files.

What is the output of lighttpd -p -f /etc/lighttpd/lighttpd.conf?

EDIT:

If you don't find the port config on the output of the command above, it means lighttpd is not reading your external.conf.

If that's the case, the solution is simple.














Is tooo long

You can paste only the part after all those file extensions.

my bad

server.document-root           = "/var/www/html"
    server.upload-dirs             = ("/var/cache/lighttpd/uploads")
    server.errorlog                = "/var/log/lighttpd/error-pihole.log"
    server.pid-file                = "/run/lighttpd.pid"
    server.username                = "www-data"
    server.groupname               = "www-data"
    server.port                    = 80
    server.feature-flags           = (
        "server.h2proto"                   => "enable",
        "server.h2c"                       => "enable",
        "server.graceful-shutdown-timeout" => 5,
        # 3
    )
    server.http-parseopts          = (
        "header-strict"            => "enable",
        "host-strict"              => "enable",
        "host-normalize"           => "enable",
        "url-normalize-unreserved" => "enable",
        "url-normalize-required"   => "enable",
        # 5
        "url-ctrls-reject"         => "enable",
        "url-path-2f-decode"       => "enable",
        "url-path-dotseg-remove"   => "enable",
        # 8
    )
    index-file.names               = ("index.php", "index.html")
    url.access-deny                = ("~", ".inc")
    static-file.exclude-extensions = (".php", ".pl", ".fcgi")
    alias.url                      = (
        "/javascript" => "/usr/share/javascript",
    )
    server.modules                 = (
        "mod_indexfile",
        "mod_access",
        "mod_alias",
        "mod_redirect",
        "mod_setenv",
        "mod_fastcgi",
        "mod_dirlisting",
        "mod_staticfile",
        # 8
    )


    $SERVER["socket"] == "[::]:80" {
        # block 1

    } # end of $SERVER["socket"] == "[::]:80"

    $HTTP["url"] =~ "^/admin/" {
        # block 2
        server.document-root        = "/var/www/html"
        server.stream-response-body = 1
        accesslog.filename          = "/var/log/lighttpd/access-pihole.log"
        accesslog.format            = "%{%s}t|%h|%V|%r|%s|%b"
        fastcgi.server              = (
            ".php" => (
                "localhost" => (
                    "socket"                => "/tmp/pihole-php-fastcgi.socket",
                    "bin-path"              => "/usr/bin/php-cgi",
                    "min-procs"             => 0,
                    "max-procs"             => 1,
                    "bin-environment"       => (
                        "PHP_FCGI_CHILDREN"     => "4",
                        "PHP_FCGI_MAX_REQUESTS" => "10000",
                        # 2
                    ),
                    # 5
                    "bin-copy-environment"  => ("PATH", "SHELL", "USER"),
                    "broken-scriptfilename" => "enable",
                    # 7
                ),
            ),
        )
        setenv.add-response-header  = (
            "X-Pi-hole"                         => "The Pi-hole Web interface is working!",
            "X-Frame-Options"                   => "DENY",
            "X-XSS-Protection"                  => "0",
            "X-Content-Type-Options"            => "nosniff",
            "Content-Security-Policy"           => "default-src 'self' 'unsafe-inline';",
            # 5
            "X-Permitted-Cross-Domain-Policies" => "none",
            "Referrer-Policy"                   => "same-origin",
            # 7
        )


        $HTTP["url"] =~ "^/admin/\." {
            # block 3
            url.access-deny = ("")

        } # end of $HTTP["url"] =~ "^/admin/\."

        $HTTP["url"] =~ "/(teleporter|api_token)\.php$" {
            # block 4


            $HTTP["referer"] =~ "/admin/settings\.php" {
                # block 5
                setenv.set-response-header = (
                    "X-Frame-Options" => "SAMEORIGIN",
                )

            } # end of $HTTP["referer"] =~ "/admin/settings\.php"
        } # end of $HTTP["url"] =~ "/(teleporter|api_token)\.php$"
    } # end of $HTTP["url"] =~ "^/admin/"
    else $HTTP["url"] == "/admin" {
        # block 6
        url.redirect = (
            "" => "/admin/",
        )

    } # end of $HTTP["url"] == "/admin"

    $HTTP["host"] == "pi.hole" {
        # block 7


        $HTTP["url"] == "/" {
            # block 8
            url.redirect = (
                "" => "/admin/",
            )

        } # end of $HTTP["url"] == "/"
    } # end of $HTTP["host"] == "pi.hole"

The exernal.conf is not there... there is no 8082 port.

To fix this, we need to move the contents of external.conf to the correct directory.

You can create a new file (for example: 20-pihole-external.conf) using the contents of the old external.conf.

After that try the previous command again, to check if the port is being used.

I have 2 lighttpd
image
about the move the contents of external.conf... Where do I move it to?

Sorry, I forgot to add the path.

Create a new file /etc/lighttpd/conf-enabled/20-pihole-external.conf using the same content of your previous external.conf.


Done

Let's check the new config.

What is the output of lighttpd -p -f /etc/lighttpd/lighttpd.conf (you can paste only the last part again)?