Skip to content

HOW TO CONFIG ModSecurity in Apache2 , i have encountered a error. Can you help me? #1441

@whxloveyrh

Description

@whxloveyrh

root@ubuntu:rules# vim /etc/apache2/mods-available/security2.conf

# Default Debian dir for modsecurity's persistent data SecDataDir /var/cache/modsecurity
    # Include all the *.conf files in /etc/modsecurity.
    # Keeping your local configuration in that directory
    # will allow for an easy upgrade of THIS file and
    # make your life easier
    IncludeOptional /etc/modsecurity/*.conf
    IncludeOptional /usr/share/modsecurity-crs/rules/*.conf
    #IncludeOptional /usr/share/modsecurity-crs/activated_rules/*.conf
    # Include OWASP ModSecurity CRS rules if installed
    IncludeOptional /usr/share/modsecurity-crs/owasp-crs.load
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "/etc/apache2/mods-available/security2.conf" 14L, 613C written root@ubuntu:rules# service apache2 reload Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. root@ubuntu:rules# systemctl status apache2.service * apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Drop-In: /lib/systemd/system/apache2.service.d `-apache2-systemd.conf Active: active (running) (Result: exit-code) since Mon 2017-06-05 19:55:01 CST; 2min 35s ago Process: 4291 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE) Process: 4936 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=1/FAILURE) Process: 4846 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 4865 (apache2) Tasks: 55 (limit: 4915) Memory: 37.8M CPU: 355ms CGroup: /system.slice/apache2.service |-4865 /usr/sbin/apache2 -k start |-4868 /usr/sbin/apache2 -k start `-4869 /usr/sbin/apache2 -k start

Jun 05 19:54:53 ubuntu systemd[1]: Starting The Apache HTTP Server...
Jun 05 19:54:53 ubuntu apachectl[4846]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directJun 05 19:55:01 ubuntu systemd[1]: Started The Apache HTTP Server.
Jun 05 19:57:23 ubuntu systemd[1]: Reloading The Apache HTTP Server.
Jun 05 19:57:23 ubuntu apachectl[4936]: AH00526: Syntax error on line 62 of /usr/share/modsecurity-crs/rules/REQUEST-901-INITIALIZATION.conf:
Jun 05 19:57:23 ubuntu apachectl[4936]: ModSecurity: Found another rule with the same id
Jun 05 19:57:23 ubuntu apachectl[4936]: Action 'graceful' failed.
Jun 05 19:57:23 ubuntu apachectl[4936]: The Apache error log may have more information.
Jun 05 19:57:23 ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Jun 05 19:57:23 ubuntu systemd[1]: Reload failed for The Apache HTTP Server.
root@ubuntu:rules#

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions