Pihole sur Hypriot sur PI3B+

Bonsoir à tous,
J’ai monté un pihole avec un ami et tout fonctionnait. N’ayant pas fait de sauvegarde, nous avons sans faire exprès (car nous voulions monter un nextcloud).
J’ai eu des soucis avec le dpkg (j’ai réinitialisé le sources.list) et le problème était résolu.
Aujourd’hui, j’ai mon certificat letsencrypt qui fonctionne mais j’ai une erreur 403 Forbidden quand je lance la page web.
J’ai fait une redirection http => https dans le lighttpd.conf

résultat du lighttpd :

sudo service lighttpd status -l

● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2019-05-25 21:33:50 CEST; 10min ago
Process: 10636 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Main PID: 10647 (lighttpd)
CGroup: /system.slice/lighttpd.service
└─10647 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

mai 25 21:33:50 black-pearl systemd[1]: Starting Lighttpd Daemon…
mai 25 21:33:50 black-pearl systemd[1]: Started Lighttpd Daemon.

puis error.log

cat /var/log/lighttpd/error.log

2019-05-24 06:25:02: (server.c.1534) logfiles cycled UID = 0 PID = 5463
2019-05-24 22:27:44: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-24 22:27:45: (log.c.217) server started
2019-05-24 22:35:33: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-24 22:35:33: (log.c.217) server started
2019-05-24 22:38:52: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-24 22:38:52: (log.c.217) server started
2019-05-24 22:41:06: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-24 22:41:06: (log.c.217) server started
2019-05-25 06:25:02: (server.c.1534) logfiles cycled UID = 0 PID = 28907
2019-05-25 20:39:42: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-25 20:39:43: (log.c.217) server started
2019-05-25 20:44:06: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-25 20:48:34: (log.c.217) server started
2019-05-25 20:53:55: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-25 20:53:55: (log.c.217) server started
2019-05-25 20:56:18: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-25 20:56:19: (log.c.217) server started
2019-05-25 21:23:39: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-25 21:23:39: (log.c.217) server started
2019-05-25 21:33:50: (server.c.1828) server stopped by UID = 0 PID = 1
2019-05-25 21:33:50: (log.c.217) server started

pihole-FTL.log

tail -n 20 /var/log/pihole-FTL.log

[2019-05-25 21:33:52.157 10723] Database successfully initialized
[2019-05-25 21:33:52.158 10723] New forward server: 208.67.220.220 (0/4096)
[2019-05-25 21:33:52.159 10723] New forward server: 208.67.222.222 (1/4096)
[2019-05-25 21:33:52.163 10723] Imported 952 queries from the long-term database
[2019-05-25 21:33:52.163 10723] → Total DNS queries: 952
[2019-05-25 21:33:52.164 10723] → Cached DNS queries: 326
[2019-05-25 21:33:52.164 10723] → Forwarded DNS queries: 615
[2019-05-25 21:33:52.164 10723] → Exactly blocked DNS queries: 11
[2019-05-25 21:33:52.164 10723] → Unknown DNS queries: 0
[2019-05-25 21:33:52.164 10723] → Unique domains: 81
[2019-05-25 21:33:52.164 10723] → Unique clients: 9
[2019-05-25 21:33:52.164 10723] → Known forward destinations: 2
[2019-05-25 21:33:52.164 10723] Successfully accessed setupVars.conf
[2019-05-25 21:33:52.170 10725] PID of FTL process: 10725
[2019-05-25 21:33:52.170 10725] Listening on port 4711 for incoming IPv4 telnet connections
[2019-05-25 21:33:52.171 10725] Listening on port 4711 for incoming IPv6 telnet connections
[2019-05-25 21:33:52.171 10725] Listening on Unix socket
[2019-05-25 21:33:52.173 10725] Compiled 7 Regex filters and 36 whitelisted domains in 0.9 msec (0 errors)
[2019-05-25 21:33:52.175 10725] /etc/pihole/black.list: parsed 416 domains (took 1.4 ms)
[2019-05-25 21:34:26.397 10725] /etc/pihole/gravity.list: parsed 4782373 domains (took 34220.8 ms)

curl -I https://pihole.befindit.com/admin/ (qui est mon nom de domaine)

HTTP/1.1 403 Forbidden
Content-Type: text/html
Content-Length: 345
Date: Sat, 25 May 2019 19:47:53 GMT
Server: lighttpd/1.4.45

lighttpd.conf :

Pi-hole: A black hole for Internet advertisements

(c) 2017 Pi-hole, LLC (https://pi-hole.net)

Network-wide ad blocking via your own hardware.

Lighttpd config for Pi-hole

This file is copyright under the latest version of the EUPL.

Please see LICENSE file for your rights under this license.

###############################################################################

FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE.

ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE

CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE:

/etc/lighttpd/external.conf

###############################################################################

server.modules = (
« mod_access »,
« mod_accesslog »,
« mod_auth »,
« mod_expire »,
« mod_compress »,
« mod_redirect »,
« mod_setenv »,
« mod_rewrite »
)

server.document-root = « /var/www/html »
server.error-handler-404 = « pihole/index.php »
server.upload-dirs = ( « /var/cache/lighttpd/uploads » )
server.errorlog = « /var/log/lighttpd/error.log »
server.pid-file = « /var/run/lighttpd.pid »
server.username = « www-data »
server.groupname = « www-data »
server.port = 80
accesslog.filename = « /var/log/lighttpd/access.log »
accesslog.format = « %{%s}t|%V|%r|%s|%b »

index-file.names = ( « index.php », « index.html », « index.lighttpd.html » )
url.access-deny = ( « ~ », « .inc », « .md », « .yml », « .ini » )
static-file.exclude-extensions = ( « .php », « .pl », « .fcgi » )

compress.cache-dir = « /var/cache/lighttpd/compress/ »
compress.filetype = ( « application/javascript », « text/css », « text/html », « text/plain » )

default listening port for IPv6 falls back to the IPv4 port

include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell « /usr/share/lighttpd/create-mime.assign.pl »

Prevent Lighttpd from enabling Let’s Encrypt SSL for every blocked domain

#include_shell « /usr/share/lighttpd/include-conf-enabled.pl »
include_shell « find /etc/lighttpd/conf-enabled -name ‹ *.conf › -a ! -name ‹ letsencrypt.conf › -printf ‹ include "%p"\n › 2>/dev/null »

If the URL starts with /admin, it is the Web interface

$HTTP[« url »] =~ « ^/admin/ » {
# Create a response header for debugging using curl -I
setenv.add-response-header = (
« X-Pi-hole » => « The Pi-hole Web interface is working! »,
« X-Frame-Options » => « DENY »
)

$HTTP["url"] =~ ".ttf$" {
    # Allow Block Page access to local fonts
    setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
}

}

Block . files from being served, such as .git, .github, .gitignore

$HTTP[« url »] =~ « ^/admin/.(.*) » {
url.access-deny = («  »)
}

Add user chosen options held in external file

This uses include_shell instead of an include wildcard for compatibility

include_shell « cat external.conf 2>/dev/null »

$SERVER[« socket »] == « :443 » {
ssl.engine = « enable »
ssl.engine = « enable »
ssl.use-sslv2 = « enable »
ssl.ca-file = « /etc/letsencrypt/live/pihole.befindit.com/chain.pem »
ssl.pemfile = « /etc/letsencrypt/live/pihole.befindit.com/combined.pem »
}

$HTTP[« scheme »] == « http » {
# capture vhost name with regex conditiona → %0 in redirect pattern
# must be the most inner block to the redirect rule
$HTTP[« host »] =~ « ." {
url.redirect = (".
 » => « https://%0$0 »)
}
}

J’ai l’impression qu’il y a un pb avec le X-header car :
pihole -d

*** [ DIAGNOSING ]: Dashboard and block page
[✗] Block page X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 301 Moved Permanently
Location: https://localhost/
Date: Sat, 25 May 2019 19:54:17 GMT
Server: lighttpd/1.4.45

[✗] Web interface X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 301 Moved Permanently
Location: https://localhost/admin/
Date: Sat, 25 May 2019 19:54:17 GMT
Server: lighttpd/1.4.45

L’erreur de base est : 403 Forbidden
Merci beaucoup de l’aide

En fait de base, après le pihole, nous voulions faire un cloud pour des projets perso, sauf que j’avais un problème de php pour le nextcloud.

pour info si ça peut aider : j’ai du php 5 et du php 7 :

dpkg -l | grep php

rc libapache2-mod-php5 5.6.33+dfsg-0+deb8u1 armhf server-side, HTML-embedded scripting language (Apache 2 module)
ii php-common 1:49 all Common files for PHP packages
ii php-crypt-blowfish 1.1.0~RC2-4 all Allows for quick two-way blowfish encryption without requiring the MCrypt PHP ex tension
ii php-doctrine-annotations 1.2.7-2 all Docblock Annotations Parser - Doctrine component
ii php-doctrine-cache 1.6.1-1 all cache library - Doctrine component
ii php-doctrine-collections 1.4.0-1 all Collections Abstraction library - Doctrine component
ii php-doctrine-common 2.6.1-2 all common extensions for Doctrine
ii php-doctrine-dbal 2.5.4-2 all database abstraction layer for Doctrine
ii php-doctrine-inflector 1.1.0-2 all string manipulations library - Doctrine component
ii php-doctrine-lexer 1.0.1-4 all base lexer library - Doctrine component
ii php-pimple 3.0.2-2 all simple dependency injection container – class
ii php-sqlite3 1:7.0+49 all SQLite3 module for PHP [default]
ii php-symfony-console 2.8.7+dfsg-1.3+deb9u2 all run tasks from the command line
ii php-symfony-event-dispatcher 2.8.7+dfsg-1.3+deb9u2 all dispatch events and listen to them
ii php-symfony-polyfill-mbstring 1.2.0-1 all Symfony polyfill for the Mbstring extension
rc php5-cli 5.6.33+dfsg-0+deb8u1 armhf command-line interpreter for the php5 scripting language
ii php5-common 5.6.33+dfsg-0+deb8u1 armhf Common files for packages built from the php5 source
ii php5-curl 5.6.33+dfsg-0+deb8u1 armhf CURL module for php5
ii php5-gd 5.6.33+dfsg-0+deb8u1 armhf GD module for php5
rc php5-json 1.3.6-1 armhf JSON module for php5
rc php5-ldap 5.6.33+dfsg-0+deb8u1 armhf LDAP module for php5
rc php5-readline 5.6.33+dfsg-0+deb8u1 armhf Readline module for php5
rc php5-sqlite 5.6.33+dfsg-0+deb8u1 armhf SQLite module for php5
iF php7.0-cgi 7.0.33-0+deb9u3 armhf server-side, HTML-embedded scripting language (CGI binary)
ii php7.0-cli 7.0.33-0+deb9u3 armhf command-line interpreter for the PHP scripting language
ii php7.0-common 7.0.33-0+deb9u3 armhf documentation, examples and common module for PHP
rc php7.0-curl 7.0.33-0+deb9u3 armhf CURL module for PHP
ii php7.0-json 7.0.33-0+deb9u3 armhf JSON module for PHP
ii php7.0-opcache 7.0.33-0+deb9u3 armhf Zend OpCache module for PHP
ii php7.0-readline 7.0.33-0+deb9u3 armhf readline module for PHP
ii php7.0-sqlite3 7.0.33-0+deb9u3 armhf SQLite3 module for PHP

Merci d’avance pour l’aide apportée

de base, c’est une version php 5.6. J’ai supprimé toutes les dépendances 7.0 qui servaient au nextcloud.

Le problème, c’est qu’aujourd’hui, je n’arrive plus à accéder à https://pihole.befindit.com/admin, j’ai l’erreur 403 et j’ai besoin d’aide pour réparer tout ça