ubuntuusers.de

ERROR: Module mod-security2 does not exist! nach Fehlerfreier Installation

Status: Gelöst | Ubuntu-Version: Server 10.04 (Lucid Lynx)
Antworten |

Beneter

Anmeldungsdatum:
5. Dezember 2011

Beiträge: Zähle...

Hallo,

ich nutze einen Strato PowerServer mit Ubuntu-Server 10.04 LTS (und leider) Plesk. Für meinen Auftraggeber sollte ich die Software "moodle" installieren, hat auch alles soweit wunderbar funktioniert.

Jetzt wollte ich wenigstens für ein klein wenig IT-Security sorgen und die mod_security_2.6.2 für Apache 2.2.14 installieren. Leider funktioniert "apt-get install libapache2-mod-security" nicht auf Anhieb:

1
2
3
4
5
root@xxx:~# apt-get install libapache2-mod-security
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut
Status-Informationen einlesen... Fertig
E: Paket libapache2-mod-security konnte nicht gefunden werden

(1.) Kann es sein, dass Strato einige Paketquellen blockt? (2.) Aus welcher Paketquelle kommt libapache2-mod-security?

Da ich hier auf dem Holzweg war, habe ich mod_security_2.6.2 mit wget runtergeladen und mit tar entpackt. Ein anschließendes "./configure" und "make" und "make install" lief ohne jeden Fehler durch. Also bin ich weiter nach http://wiki.tkoeppen.com/display/docs/howto+install+mod_security2+with+apache2+in+Ubuntu vorgegangen. unter Punkt 5 zeigen sich dann erste Fehler:

1
2
root@xxx:/etc/apache2/mods-available# cat mod_security2.load
cat: mod_security2.load: No such file or directory

Per ls entdeckte ich in dem Verzeichnis aber eine "mod_security.load". in dieser steht:

1
2
LoadFile /usr/lib/libxml2.so.2
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so

sieht also gar nicht so schlecht aus....

"ls /etc/apache2/mods-enabled" offenbahrt, dass mod_security sogar enabled ist (eventuell habe ich das irgendwann mal aus Versehen gemacht...).

und nun, noch ein letzter Test..

1
2
root@xxx:~# a2enmod mod_security
ERROR: Module mod_security does not exist!

oO warum denn das jetzt? (3.) Wo ist hier der Fehler?

1
2
3
4
root@xxx:~# cd /etc/apache2/conf.d/mod_security2
-bash: cd: /etc/apache2/conf.d/mod_security2: No such file or directory
root@xxx:~# cd /etc/apache2/conf.d/mod_security
-bash: cd: /etc/apache2/conf.d/mod_security: No such file or directory

Ich werde sehr bald (in den nächsten Tagen) eine komplett saubere Neuinstallation durchführen, bis dahin wüsste ich gerne wo der Fehler liegt, damit ich ihn beim nächsten mal nicht wieder mache.

Falls euch irgendwelche Logs helfen, werde ich sie hier Posten.

Bitte helft mir, ich habe schon ziemlich lange nach einer Lösung gesucht, komme aber überhaupt nicht weiter. Ich habe das Gefühl, dass ich spätestens bei (3.) auf dem Holzweg bin... Am wichtigsten ist mir zunächst einmal die Beantwortung der Frage "(2.)".

LG Beneter

EDIT: Ich habe mal meine /etc/apt/sources.list mit den Standardeinträgen ergänzt:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# See sources.list(5) for more information, especialy
# Remember that you can only use http, ftp or file URIs
# CDROMs are managed through the apt-cdrom tool.

deb ftp://ftp.stratoserver.net/pub/linux/ubuntu lucid main restricted universe
deb-src ftp://ftp.stratoserver.net/pub/linux/ubuntu lucid main restricted universe

deb ftp://ftp.stratoserver.net/pub/linux/ubuntu lucid-updates main restricted universe
deb-src ftp://ftp.stratoserver.net/pub/linux/ubuntu lucid-updates main restricted universe

deb ftp://ftp.stratoserver.net/pub/linux/ubuntu lucid-security main restricted universe
deb-src ftp://ftp.stratoserver.net/pub/linux/ubuntu lucid-security main restricted universe

deb http://de.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid main restricted
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb http://de.archive.ubuntu.com/ubuntu/ lucid universe
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid universe
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb http://de.archive.ubuntu.com/ubuntu/ lucid multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
deb http://de.archive.ubuntu.com/ubuntu/ lucid-backports restricted main multiverse universe

nach einem "apt-get update" bleibt aber der 1. Fehler ("E: Paket libapache2-mod-security konnte nicht gefunden werden") erhalten.

Moderiert von tomtomtom:

Ins passende Forum verschoben. Bitte beachte die Themenstickies.

Benno-007

Anmeldungsdatum:
28. August 2007

Beiträge: 29240

Wohnort: Germany

Hallo und willkommen.

Per ls entdeckte ich in dem Verzeichnis aber eine "mod_security.load"

Dann muss diese auch für cat erreichbar sein. Zeige bitte mal:

ls -hal /etc/apache2/mods-available

Lasse uns dort auch mal die Dateirechte überprüfen.

Und bei meinem 10.04 habe ich das Paket eben so gefunden:

$ apt-cache search mod-security
libapache-mod-security - Tighten web applications security for Apache
mod-security-common - Tighten web applications security - common files

Ist zwar kein Server, aber die Paketquellen sind dieselben, nur Server-Kernel vorinstalliert usw.. Bei dir war eine "2" zuviel im Namen...

Grüße, Benno

Beneter

(Themenstarter)

Anmeldungsdatum:
5. Dezember 2011

Beiträge: 10

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
root@xxx:~# ls -hal /etc/apache2/mods-available
total 396K
drwxr-xr-x 2 root root 4,0K 2011-12-05 12:17 .
drwxr-xr-x 8 root root 4,0K 2011-12-05 11:39 ..
-rw-r--r-- 1 root root  332 2011-11-03 04:28 actions.conf
-rw-r--r-- 1 root root   66 2011-11-03 04:28 actions.load
-rw-r--r-- 1 root root  815 2011-11-03 04:28 alias.conf
-rw-r--r-- 1 root root   62 2011-11-03 04:28 alias.load
-rw-r--r-- 1 root root   60 2011-11-03 04:28 asis.load
-rw-r--r-- 1 root root   72 2011-11-03 04:28 auth_basic.load
-rw-r--r-- 1 root root   74 2011-11-03 04:28 auth_digest.load
-rw-r--r-- 1 root root   74 2011-11-03 04:28 authn_alias.load
-rw-r--r-- 1 root root   72 2011-11-03 04:28 authn_anon.load
-rw-r--r-- 1 root root   85 2011-11-03 04:28 authn_dbd.load
-rw-r--r-- 1 root root   70 2011-11-03 04:28 authn_dbm.load
-rw-r--r-- 1 root root   78 2011-11-03 04:28 authn_default.load
-rw-r--r-- 1 root root   72 2011-11-03 04:28 authn_file.load
-rw-r--r-- 1 root root   90 2011-11-03 04:28 authnz_ldap.load
-rw-r--r-- 1 root root   70 2011-11-03 04:28 authz_dbm.load
-rw-r--r-- 1 root root   78 2011-11-03 04:28 authz_default.load
-rw-r--r-- 1 root root   82 2011-11-03 04:28 authz_groupfile.load
-rw-r--r-- 1 root root   72 2011-11-03 04:28 authz_host.load
-rw-r--r-- 1 root root   74 2011-11-03 04:28 authz_owner.load
-rw-r--r-- 1 root root   72 2011-11-03 04:28 authz_user.load
-rw-r--r-- 1 root root 3,2K 2011-11-03 04:28 autoindex.conf
-rw-r--r-- 1 root root   70 2011-11-03 04:28 autoindex.load
-rw-r--r-- 1 root root   62 2011-11-03 04:28 cache.load
-rw-r--r-- 1 root root   70 2011-11-03 04:28 cern_meta.load
-rw-r--r-- 1 root root   68 2011-11-03 04:28 cgid.conf
-rw-r--r-- 1 root root   60 2011-11-03 04:28 cgid.load
-rw-r--r-- 1 root root   58 2011-11-03 04:28 cgi.load
-rw-r--r-- 1 root root   76 2011-11-03 04:28 charset_lite.load
-rw-r--r-- 1 root root   36 2011-11-03 04:28 dav_fs.conf
-rw-r--r-- 1 root root   79 2011-11-03 04:28 dav_fs.load
-rw-r--r-- 1 root root   58 2011-11-03 04:28 dav.load
-rw-r--r-- 1 root root   68 2011-11-03 04:28 dav_lock.load
-rw-r--r-- 1 root root   58 2011-11-03 04:28 dbd.load
-rw-r--r-- 1 root root  438 2011-11-03 04:28 deflate.conf
-rw-r--r-- 1 root root   66 2011-11-03 04:28 deflate.load
-rw-r--r-- 1 root root  122 2011-11-03 04:28 dir.conf
-rw-r--r-- 1 root root   58 2011-11-03 04:28 dir.load
-rw-r--r-- 1 root root  604 2011-11-03 04:28 disk_cache.conf
-rw-r--r-- 1 root root   89 2011-11-03 04:28 disk_cache.load
-rw-r--r-- 1 root root   64 2011-11-03 04:28 dump_io.load
-rw-r--r-- 1 root root   58 2011-11-03 04:28 env.load
-rw-r--r-- 1 root root   66 2011-11-03 04:28 expires.load
-rw-r--r-- 1 root root   72 2011-11-03 04:28 ext_filter.load
-rw-r--r-- 1 root root  617 2011-11-29 09:32 fcgid.conf
-rw-r--r-- 1 root root   62 2011-11-29 09:32 fcgid.load
-rw-r--r-- 1 root root   89 2011-11-03 04:28 file_cache.load
-rw-r--r-- 1 root root   64 2011-11-03 04:28 filter.load
-rw-r--r-- 1 root root   66 2011-11-03 04:28 headers.load
-rw-r--r-- 1 root root   62 2011-11-03 04:28 ident.load
-rw-r--r-- 1 root root   68 2011-11-03 04:28 imagemap.load
-rw-r--r-- 1 root root   66 2011-11-03 04:28 include.load
-rw-r--r-- 1 root root  420 2011-11-03 04:28 info.conf
-rw-r--r-- 1 root root   60 2011-11-03 04:28 info.load
-rw-r--r-- 1 root root   60 2011-11-03 04:28 ldap.load
-rw-r--r-- 1 root root   76 2011-11-03 04:28 log_forensic.load
-rw-r--r-- 1 root root  185 2011-11-03 04:28 mem_cache.conf
-rw-r--r-- 1 root root   87 2011-11-03 04:28 mem_cache.load
-rw-r--r-- 1 root root 6,3K 2011-11-03 04:28 mime.conf
-rw-r--r-- 1 root root   60 2011-11-03 04:28 mime.load
-rw-r--r-- 1 root root   81 2011-11-03 04:28 mime_magic.conf
-rw-r--r-- 1 root root   72 2011-11-03 04:28 mime_magic.load
-rw-r--r-- 1 root root   70 2007-11-11 02:48 mod-evasive.load
-rw-r--r-- 1 root root  101 2009-11-25 14:30 mod-security.load
-rw-r--r-- 1 root root  666 2011-11-03 04:28 negotiation.conf
-rw-r--r-- 1 root root   74 2011-11-03 04:28 negotiation.load
-rw-r--r-- 1 root root   60 2011-11-29 09:30 perl.load
-rw-r--r-- 1 root root  546 2011-11-29 09:31 php5.conf
-rw-r--r-- 1 root root   59 2011-11-29 09:31 php5.load
-rw-r--r-- 1 root root   87 2011-11-03 04:28 proxy_ajp.load
-rw-r--r-- 1 root root   97 2011-11-03 04:28 proxy_balancer.load
-rw-r--r-- 1 root root  589 2011-11-03 04:28 proxy.conf
-rw-r--r-- 1 root root   95 2011-11-03 04:28 proxy_connect.load
-rw-r--r-- 1 root root   87 2011-11-03 04:28 proxy_ftp.load
-rw-r--r-- 1 root root   89 2011-11-03 04:28 proxy_http.load
-rw-r--r-- 1 root root   62 2011-11-03 04:28 proxy.load
-rw-r--r-- 1 root root   89 2011-11-03 04:28 proxy_scgi.load
-rw-r--r-- 1 root root   64 2011-11-29 09:30 python.load
-rw-r--r-- 1 root root  429 2011-11-03 04:28 reqtimeout.conf
-rw-r--r-- 1 root root   72 2011-11-03 04:28 reqtimeout.load
-rw-r--r-- 1 root root   66 2011-11-03 04:28 rewrite.load
-rw-r--r-- 1 root root   70 2011-12-05 12:17 security2.load
-rw-r--r-- 1 root root 1,2K 2011-11-03 04:28 setenvif.conf
-rw-r--r-- 1 root root   68 2011-11-03 04:28 setenvif.load
-rw-r--r-- 1 root root   66 2011-11-03 04:28 speling.load
-rw-r--r-- 1 root root 2,4K 2011-11-03 04:28 ssl.conf
-rw-r--r-- 1 root root   58 2011-11-03 04:28 ssl.load
-rw-r--r-- 1 root root  398 2011-11-03 04:28 status.conf
-rw-r--r-- 1 root root   64 2011-11-03 04:28 status.load
-rw-r--r-- 1 root root   72 2011-11-03 04:28 substitute.load
-rw-r--r-- 1 root root   64 2011-11-03 04:28 suexec.load
-rw-r--r-- 1 root root   70 2011-11-03 04:28 unique_id.load
-rw-r--r-- 1 root root  604 2011-11-03 04:28 userdir.conf
-rw-r--r-- 1 root root   66 2011-11-03 04:28 userdir.load
-rw-r--r-- 1 root root   70 2011-11-03 04:28 usertrack.load
-rw-r--r-- 1 root root   66 2011-11-03 04:28 version.load
-rw-r--r-- 1 root root   74 2011-11-03 04:28 vhost_alias.load

Ich glaube ich habe da etwas durcheinander gebracht oO Warum ist denn hier auf einmal eine mod_security und eine security2.load? Die Zugriffsrechte auf security2.load und mod_security.load sehen genau so aus, wie bei anderen, funktionierenden Erweiterungen (z.B. mod_evasive.load).

1
2
3
4
5
root@h1972527:~# cat /etc/apache2/mods-available/security2.load
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so
root@h1972527:~# cat /etc/apache2/mods-available/mod-security.load
LoadFile /usr/lib/libxml2.so.2
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so

Das heisst sie machen beide das gleiche, nur mod-security.load Lädt noch eine Datei mit ein.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
root@xxx:~# a2enmod security2
Enabling module security2.
Run '/etc/init.d/apache2 restart' to activate new configuration!
root@xxx:~# a2enmod mod-security
Module mod-security already enabled
root@xxx:~# /etc/init.d/apache2 restart
 * Restarting web server apache2                                                [Tue Dec 06 08:44:03 2011] [warn] module security2_module is already loaded, skipping
 ... waiting [Tue Dec 06 08:44:05 2011] [warn] module security2_module is already loaded, skipping
                                                                         [ OK ]
root@xxx:~# a2dismod security2
Module security2 disabled.
Run '/etc/init.d/apache2 restart' to activate new configuration!
root@xxx:~# /etc/init.d/apache2 restart
 * Restarting web server apache2                                                 ... waiting                                                             [ OK ]
root@xxx:~#

Okay... anscheinend ist mod-security schon aktiv... 😳 Ich werde jetzt weiter in der Anleitung gehen und mich nochmal hier melden.

Und bei meinem 10.04 habe ich das Paket eben so gefunden:

$ apt-cache search mod-security libapache-mod-security - Tighten web applications security for Apache mod-security-common - Tighten web applications security - common files

Ist zwar kein Server, aber die Paketquellen sind dieselben, nur Server-Kernel vorinstalliert usw.. Bei dir war eine "2" zuviel im Namen...

Ich meine die libapache-mod-security ist eine ältere Version, lasse mich aber sehr gerne korrigieren (würde bei der Neuinsatllation etwas Arbeit sparen).

Vielen Dank Benno-007! Entschuldigung dass ich hier so einen Schwachsinn verzapfe :S

LG Beneter

Beneter

(Themenstarter)

Anmeldungsdatum:
5. Dezember 2011

Beiträge: 10

Nach einigem Herumkonfigurieren und Editieren der Regeln ist es mir endlich gelungen mod-security zu nutzen.

Leider ist moodle nicht kompatibel zu mod-security ("Die Webserver-Software ( ) wird nicht unterstützt"). Nach dem Deaktivieren von mod-security funktioniert moodle wieder einwandfrei. Bei meinem nächsten, eigenen Projekt wird die mod_security aber eingebunden!

Vielen Dank nochmal für die Unterstützung!

LG Stefan

Benno-007

Anmeldungsdatum:
28. August 2007

Beiträge: 29240

Wohnort: Germany

Gut, dass sich das irgendwie geklärt hat.

Antworten |