Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Xenial updating to latest modsecurity2 causes error #714

Closed
gquipster opened this issue Oct 2, 2017 · 7 comments
Closed

On Xenial updating to latest modsecurity2 causes error #714

gquipster opened this issue Oct 2, 2017 · 7 comments

Comments

@gquipster
Copy link

/etc/init.d/apache2 restart

  • Restarting Apache httpd web server apache2 [fail]
  • The apache2 configtest failed.
    Output of config test was:
    apache2: Syntax error on line 147 of /etc/apache2/apache2.conf: Syntax error on line 12 of /etc/apache2/mods-enabled/security2.conf: Could not open configuration file /usr/share/modsecurity-crs/owasp-crs.load: No such file or directory

Had to install Zesty version of modsecurity-crs to resolve: https://packages.ubuntu.com/zesty/modsecurity-crs

@gquipster
Copy link
Author

Also affects trusty

@alexiacobws
Copy link

Confirmed on Trusty

Setting up libapache2-mod-security2 (2.9.2-1+ubuntu14.04.1+deb.sury.org+2) ...
apache2_invoke: Enable module security2
apache2_reload: Your configuration is broken. Not restarting Apache 2
apache2_reload: apache2: Syntax error on line 157 of /etc/apache2/apache2.conf: Syntax error on line 12 of /etc/apache2/mods-enabled/security2.conf: Could not open configuration file /usr/share/modsecurity-crs/owasp-crs.load: No such file or directory
Setting up libapache2-modsecurity (2.9.2-1+ubuntu14.04.1+deb.sury.org+2) ...
Setting up modsecurity-crs (2.2.8-1) ...

@jaydrogers
Copy link
Contributor

I just had this same exact error happen to me on 14.04.5. The error I received was:

apache2: Syntax error on line 147 of /etc/apache2/apache2.conf: Syntax error on line 12 of /etc/apache2/mods-enabled/security2.conf: Could not open configuration file /usr/share/modsecurity-crs/owasp-crs.load: No such file or directory

The only way to get the webserver to start was to remove the config file that was causing it to break:

rm /etc/apache2/mods-enabled/security2.load

Does anyone know of a permanent solution for this?

@gquipster
Copy link
Author

I resolved this by downloading the DEB file for the newest version of modsecurity-crs from the Zesty archive library:

https://packages.ubuntu.com/zesty/all/modsecurity-crs/download

and installing it manually.

The security2.load file then loaded without issue

@jaydrogers
Copy link
Contributor

Awesome, thanks @gquipster!

For anyone landing here from a Google search, I ran these commands thanks to @gquipster:

wget http://mirrors.kernel.org/ubuntu/pool/universe/m/modsecurity-crs/modsecurity-crs_3.0.0-3_all.deb

sudo dpkg -i modsecurity-crs_3.0.0-3_all.deb

I was able to confirm the configuration was okay after install by running sudo apachectl configtest. After that I restarted the service with sudo service apache2 restart and everything came up okay.

@oerdnj
Copy link
Owner

oerdnj commented Dec 1, 2017

I'll fix this as part of #733

@oerdnj
Copy link
Owner

oerdnj commented Jan 14, 2018

Uploaded, so this and #733 should be fixed.

@oerdnj oerdnj closed this as completed Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants