Nach entfernen des Zertifikats kein Zugriff mehr auf das Monitoring

Hallo,
ich habe offensichtlich erst geklickt und dann nachgedacht :frowning:
Ich hatte http auf https umgelenkt und auch ein Zertifikat eingespielt, was bei 1.6 (CEE) auch super funktioniert hat.
Nach dem Upgrade auf die 2.0.0 gab es aber viele Warnungen bzgl. SSL.
Deshalb wollte ich das Zertifikat nochmal neu einlesen und habe dann das bestehende Zertifikat erst heruntergeladen und dann gelöscht.
Jetzt komme ich aber nicht mehr auf das Monitoring.
Wie kann ich das über den SSH-Zugang wieder lösen?
Dankeschön

Gruß
Wolfgang

Kommt ganz darauf an wie dein System aufgebaut ist.
Ist dies eine CMK Appliance oder ist es ein Debian/Ubuntu oder Redhat/CentOS?
Da du das Zertifikat per Web gelöscht hast tippe ich mal auf eine Appliance oder?

Korrekt - eine virtuelle Appl.

Mmmh dann bleibt erstmal nix anderes übrig wie auf der Shell ein Zertifikat im Apache installieren oder aber manuell dort auf der Shell die Zwangsumleitung nach HTTPS deaktivieren. Dann kannst auch erstmal wieder über HTTP zugreifen.

Ja, das hatte ich befürchtet.
Welche Datei müßte ich dazu wie editieren?

Hallo @andreas-doehler , in welcher Datei muss ich die Zwangsumleitung deaktivieren?
Dankeschön.

Ich kann es gerade nicht genau sagen da keine Appliance zur Hand hier.
Aber schau mal in /etc/apache/ dort sollte es eine Regel geben welche übersetzt lautet “wenn Protokoll nicht HTTPS dann mache HTTPS”.

Hallo wollew,

@andreas-doehler Ich grätsch hier mal gerade rein, da ich eh gerade auf einer Appliance bin

Ich vermute mal, dass du folgende Datei als Softlink in /etc/apache2/conf-enabled hast :

/etc/apache2/conf-enabled
-rw-rw-r-- 1 root root 151 Jan 13 2018 …/cma-http-to-https.conf

In dieser Datei ist der redirect von http nach https konfiguriert.

Wenn du in conf-enabled aktuell noch einen Softlink auf die auf cma-http.conf hast (siehe unten), reicht es wahrscheinlich aus, diese Konfig zu deaktivieren :

a2disconf cma-http-to-https

Danach den Apache neu starten
systemctl restart apache2

Wenn du keinen Softlink in conf-enabled auf /etc/apache2/conf-enabled cma-http.conf hast, kannst du die http Konfig mit dem folgenden Befehl aktivieren:

a2ensite cma-http.conf

ls -al /etc/apache2/sites-available
lrwxrwxrwx 1 root root 32 Jan 28 08:10 cma-http.conf → …/sites-available/cma-http.conf
lrwxrwxrwx 1 root root 33 Nov 16 11:48 cma-https.conf → …/sites-available/cma-https.conf

Im Zweifel vorher mal ein Backup machen, bei Fragen einfach den Inhalt der Verzeichnisse sites-available und sites-enabled posten.

1 Like

Hallo @aeckstein,
meine conf-enabled sieht etwas anders aus. Ich sehe dort keinen softlink auf cma-http-to-https.conf oder cma-http.conf

root@SHOMON:/# ls -al /etc/apache2/conf-enabled/
total 8
drwxrwxr-x 2 root root 4096 Mar 22 10:26 .
drwxrwxr-x 19 root root 4096 Mar 22 10:44 …
lrwxrwxrwx 1 root root 30 Jan 28 08:09 charset.conf → …/conf-available/charset.conf
lrwxrwxrwx 1 root root 38 Jan 23 2019 cma-default-gui.conf → …/conf-available/cma-default-gui.conf
lrwxrwxrwx 1 root root 30 Jan 23 2019 cma-omd.conf → …/conf-available/cma-omd.conf
lrwxrwxrwx 1 root root 37 Jan 23 2019 cma-servername.conf → …/conf-available/cma-servername.conf
lrwxrwxrwx 1 root root 34 Jan 23 2019 cma-webconf.conf → …/conf-available/cma-webconf.conf
lrwxrwxrwx 1 root root 44 Jan 28 08:09 localized-error-pages.conf → …/conf-available/localized-error-pages.conf
lrwxrwxrwx 1 root root 46 Jan 28 08:09 other-vhosts-access-log.conf → …/conf-available/other-vhosts-access-log.conf
lrwxrwxrwx 1 root root 31 Jan 28 08:09 security.conf → …/conf-available/security.conf
lrwxrwxrwx 1 root root 36 Jan 28 08:09 serve-cgi-bin.conf → …/conf-available/serve-cgi-bin.conf

root@SHOMON:/# ls -al /etc/apache2/sites-enabled/
total 8
drwxr-xr-x 2 root root 4096 Mar 18 12:55 .
drwxrwxr-x 19 root root 4096 Mar 22 10:44 …
lrwxrwxrwx 1 root root 32 Jan 28 08:10 cma-http.conf → …/sites-available/cma-http.conf

root@SHOMON:/# ls -al /etc/apache2/sites-available/
total 32
drwxrwxr-x 2 root root 4096 Mar 22 12:28 .
drwxrwxr-x 19 root root 4096 Mar 22 10:44 …
-rw-r–r-- 1 root root 1332 Nov 3 2018 000-default.conf
-rw-rw-r-- 1 root root 525 Jan 23 2019 cma-http.conf
-rw-rw-r-- 1 root root 4109 Dec 18 13:28 cma-https.conf
-rw-r–r-- 1 root root 6338 Jun 16 2019 default-ssl.conf
root@SHOMON:/# a2ensite cma-http.conf
Site cma-http already enabled
root@SHOMON:/# systemctl restart apache2
root@SHOMON:/#

Funktioniert leider noch immer nicht.

Hi,

so wie das jetzt aussieht, würde ich vermuten, dass nur http aktiviert ist, ohne Umleitung auf https.
Sicher, dass du mit http://servername/webconf nicht drauf kommst ?

Was sagt ein

systemctl status apache2 ?

Alternativ mal probieren, ob du die alte SSL Konfig noch mal Online nehmen kannst mit

a2ensite cma-https.conf

root@SHOMON:/# systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-03-22 12:34:42 CET; 17min ago
Process: 1750 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
Process: 16443 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Process: 1761 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 1765 (apache2)
Tasks: 7 (limit: 4915)
CGroup: /system.slice/apache2.service
├─1765 /usr/sbin/apache2 -k start
├─1766 /usr/sbin/apache2 -k start
├─1767 /usr/sbin/apache2 -k start
├─1768 /usr/sbin/apache2 -k start
├─1769 /usr/sbin/apache2 -k start
├─1770 /usr/sbin/apache2 -k start
└─1771 /usr/sbin/apache2 -k start

Mar 22 12:34:42 SHOMON systemd[1]: Starting The Apache HTTP Server…
Mar 22 12:34:42 SHOMON systemd[1]: Started The Apache HTTP Server.

root@SHOMON:/# a2ensite cma-https.conf
Enabling site cma-https.
To activate the new configuration, you need to run:
systemctl reload apache2
root@SHOMON:/# systemctl reload apache2

root@SHOMON:/# ls -al /etc/apache2/sites-enabled/
total 8
drwxr-xr-x 2 root root 4096 Mar 22 12:53 .
drwxrwxr-x 19 root root 4096 Mar 22 10:44 …
lrwxrwxrwx 1 root root 32 Jan 28 08:10 cma-http.conf → …/sites-available/cma-http.conf
lrwxrwxrwx 1 root root 33 Mar 22 12:53 cma-https.conf → …/sites-available/cma-https.conf

Danach habe ich dann nochmal a2ensite cma-http.conf ausgeführt und den Dienst neu gestartet. Aber leider geht es weiterhin auf die https-Seite, die aber weiterhin den Fehler “ERR_CONNECTION_REFUSED” zeigt.

Kannst du mal die Ausgabe der beiden Kommandos posten :

a2query -s
a2query -c

root@SHOMON:/# a2query -s
cma-https (enabled by site administrator)
cma-http (enabled by site administrator)
root@SHOMON:/# a2query -c
other-vhosts-access-log (enabled by maintainer script)
charset (enabled by maintainer script)
serve-cgi-bin (enabled by maintainer script)
cma-servername (enabled by unknown)
cma-default-gui (enabled by unknown)
localized-error-pages (enabled by maintainer script)
cma-webconf (enabled by unknown)
cma-omd (enabled by unknown)
security (enabled by maintainer script)

Ich seh da so keinen Fehler :slight_smile:

Was sagt :
curl -vL http://localhost/webconf

Sensitive Infos einfach rauslöschen…

Danke für die Unterstützung!
Ist ja echt zum verzweifeln. Einmal ohne Überlegung etwas geklickt - und gleich so ein Mist :wink:

root@SHOMON:/# curl -vL http://localhost/webconf
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /webconf HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 302 Found
< Date: Mon, 22 Mar 2021 12:17:08 GMT
< Server: Apache/2.4.25 (Debian)
< Location: http://localhost/webconf/
< Content-Length: 284
< Content-Type: text/html; charset=iso-8859-1
<
* Ignoring the response-body
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact
* Issue another request to this URL: 'http://localhost/webconf/'
* Found bundle for host localhost: 0x55a4330677c0 [can pipeline]
* Re-using existing connection! (#0) with host localhost
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /webconf/ HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Mon, 22 Mar 2021 12:17:08 GMT
< Server: webconfd
< Content-type: text/html; charset=UTF-8
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
<
<!DOCTYPE HTML>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/ico">
<title>SHOMON - Weboberfläche - Check_MK virt1 Mark I - v1.4.13</title>
<link rel="stylesheet" type="text/css" href="check_mk.css" />
<link rel="stylesheet" type="text/css" href="cma_facelift.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->
<script type="text/javascript" src="js/checkmk.js"></script>
</head>
<body class="main login"><div id=login><div id=login_window><div id=version>v1.4.13</div><form id="form_login" name="login" class="login" action="login.py" method="POST" enctype="multipart/form-data">
<input type="hidden" name="filled_in" value="login" /><input type="hidden" name="_login" value="1" /><label id=label_pass class=legend for=_password style="top: 105px;">Passwort:</label><br /><input type="password" class="text" value="" name="_password" style="top: 100px;" id="input_pass"  />
<div id=button_text><input onfocus="if (this.blur) this.blur();" type="submit" name="_login" id="_login" value="Login" class="button " style="bottom: 54px;"/>
</div></div><div id=foot>Check_MK virt1 Mark I - Version: 1.4.13 - &copy; <a href="https://checkmk.com">tribe29 GmbH</a><br><br></div></div></form>
<script language="javascript" type="text/javascript">
<!--
if (document.login._password) {    document.login._password.focus();
    document.login._password.select();
}
// -->
</script>
</body></html>
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact
root@SHOMON:/#

Gerne :slight_smile:

Also lokal kann curl die Verbindung zu Port 80 aufbauen und die Anmeldeseite erscheint ohne redirect auf https.
Kann es sein, dass da ein Proxy oder dein Browser auf https wechseln ?
Oder http in der Firewall geblockt ?

Oh je, es ist tatsächlich der Browser (Edge). Mit dem IE komme ich auf korrekt auf das Dashboard.
Tausend Dank für die Unterstützung!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.