Articles in this section

Plesk home page shows error: Configuration files for the Apache web server were not created: /etc/httpd/conf.d/modsec2.imunify.conf

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • RHEL/CentOS/CloudLinux is used on a server with Plesk.

  • The following error is shown in Plesk UI:

    PLESK_ERROR: New configuration files for the Apache web server were not created due to the errors in configuration templates: httpd_ls_bak: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 5 of /etc/httpd/conf.d/zz010_psa_httpd.conf: Syntax error on line 66 of /etc/httpd/conf/plesk.conf.d/server.conf: Syntax error on line 1 of /etc/httpd/conf/plesk.conf.d/modsecurity.conf:
    Could not open configuration file /etc/httpd/conf.d/modsec2.imunify.conf: No such file or directory

Cause

Syntax error in Apache configuration file. Reference to the file 00_mod_security.conf is missing.

Resolution

  1. Connect to the server via SSH as root user.

  2. Create the backup of Apache configuration file:

    # cp -a /etc/httpd/conf/plesk.conf.d/modsecurity.conf{,.bak}

  3. Add the path containing 00_mod_security.conf in configuration file /etc/httpd/conf/plesk.conf.d/modsecurity.conf in the following way, for example:

    # cat /etc/httpd/conf/plesk.conf.d/modsecurity.conf
    Include "/etc/httpd/conf.d/00_mod_security.conf"

  4. Check the configuration of Apache web server:

    # httpd -t
    Syntax OK

  5. Rebuild web server configuration files:

    # plesk repair web

Was this article helpful?

Comments

1 comment
Date Votes
  • I have this issue, and the file "00_mod_security.conf" doesn't exist in my system. 

    $ cat /etc/httpd/conf/plesk.conf.d/modsecurity.conf

    #
    Include "/etc/httpd/conf.d/modsec2.imunify.conf"

    The 'http -t' command reports 'Syntax OK'. However, the Webserver Configurations Troubleshooter reports this:

    Error: New configuration files for the Apache web server were not created due to the errors in configuration templates: httpd: Syntax error on line 356 of /etc/httpd/conf/httpd.conf: Syntax error on line 5 of /etc/httpd/conf.d/zz010_psa_httpd.conf: Syntax error on line 64 of /etc/httpd/conf/plesk.conf.d/server.conf: Syntax error on line 1 of /etc/httpd/conf/plesk.conf.d/modsecurity.conf: Could not open configuration file /etc/httpd/conf.d/modsec2.imunify.conf: No such file or directory.

    The file '/etc/httpd/conf.d/modsec2.imunify.conf' exists and its contents follow:

    $ cat /etc/httpd/conf.d/modsec2.imunify.conf
    # Imunify360 mod_security config patch
    <IfModule security2_module>
      # The following two settings are needed for realtime scanning of uploaded files
      SecRequestBodyAccess On
      SecTmpSaveUploadedFiles On
      SecResponseBodyLimitAction ProcessPartial
      # Warning: custom SecTmpDir/SecUploadDir do not work with cPanel apache jailshell
      SecTmpDir /var/imunify360/tmp_modsec
      SecUploadDir /var/imunify360/tmp_modsec
    </IfModule>

    Any thoughts?

    Thanks!

    0

Please sign in to leave a comment.