The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

modsecurity_http_policy.conf file location

Discussion in 'Security' started by atlantis21, Jan 28, 2014.

  1. atlantis21

    atlantis21 Well-Known Member

    Joined:
    Sep 18, 2012
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello,

    I have problem with WordPress:
    Method Not Implemented POST to /wp-admin/post.php not supported.

    So, I figured that mod security cause this problem.
    And solution on wp forum is:
    Code:
    Modified one rule in the modsecurity_http_policy.conf file located @ /etc/httpd/modsecurity.d/modsecurity_crs_30_http_policy.conf
    
    FROM:
    
    SecRule REQUEST_HEADERS:Content-Type "!(?:^(?:application/x-www-form-urlencoded$|multipart/form-data;)|text/xml)"
    
    TO:
    
    SecRule REQUEST_HEADERS:Content-Type "!(?:^(?:application/x-www-form-urlencoded$|application/x-www-form-urlencoded; charset=UTF-8$|multipart/form-data;)|text/xml)"
    But I cannot find location of modsecurity_http_policy.conf file.
    Can anybody help me?
     
  2. HostingH

    HostingH Well-Known Member

    Joined:
    Jan 13, 2008
    Messages:
    73
    Likes Received:
    3
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello,

    All modsecurity conf files are located under : /etc/httpd/conf dir. If its related with modsec, check apache logs there you can see it.
    Or for testing purpose, disable modsecurity for that domain only.

    Thanks,
     
  3. atlantis21

    atlantis21 Well-Known Member

    Joined:
    Sep 18, 2012
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I cant disable for domain. I have this error:
    Code:
    Rebuilding and restarting Apache:
    Initial configuration generation failed with the following message:
    
    [Tue Jan 28 16:25:37 2014] [crit] (EAI 9)Address family for hostname not supported: alloc_listener: failed to set up sockaddr for ::
    
    Configuration problem detected on line 172 of file /usr/local/apache/conf/httpd.conf.work.NfYPwtyFanlFSwU7:	Listen setup failed
    
    	--- /usr/local/apache/conf/httpd.conf.work.NfYPwtyFanlFSwU7 ---
    	166# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    	167
    	168
    	169PidFile logs/httpd.pid
    	170LockFile logs/accept.lock
    	171Listen 0.0.0.0:80
    	172 ===> Listen [::]:80 <===
    	173User nobody
    	174Group nobody
    	175ExtendedStatus On
    	176ServerAdmin mail123@domain.com
    	177ServerName server123.com
    	178LogLevel warn
    	--- /usr/local/apache/conf/httpd.conf.work.NfYPwtyFanlFSwU7 ---
    
    
    Rebuilding configuration without any local modifications.
    
    Failed to generate a syntactically correct Apache configuration.
    Bad configuration file located at /usr/local/apache/conf/httpd.conf.work.NfYPwtyFanlFSwU7
    Error:
    [Tue Jan 28 16:25:38 2014] [crit] (EAI 9)Address family for hostname not supported: alloc_listener: failed to set up sockaddr for ::
    
    Configuration problem detected on line 172 of file /usr/local/apache/conf/httpd.conf.work.NfYPwtyFanlFSwU7:	Listen setup failed
    
    	--- /usr/local/apache/conf/httpd.conf.work.NfYPwtyFanlFSwU7 ---
    	166# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    	167
    	168
    	169PidFile logs/httpd.pid
    	170LockFile logs/accept.lock
    	171Listen 0.0.0.0:80
    	172 ===> Listen [::]:80 <===
    	173User nobody
    	174Group nobody
    	175ExtendedStatus On
    	176ServerAdmin mail123@domain.com
    	177ServerName server123.com
    	178LogLevel warn
    	--- /usr/local/apache/conf/httpd.conf.work.NfYPwtyFanlFSwU7 ---
    
    
    
    ...Done
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. atlantis21

    atlantis21 Well-Known Member

    Joined:
    Sep 18, 2012
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I alredy have CSF Mod_Security Control, and that error is from there.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I have seen several instances where rebuilding Apache via EasyApache has resolved this issue. If that does not help, feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  7. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    So you're stating that when you disable mod security for one domain that it fails to rebuild with the above error?
    Have you contacted support for CMC (ConfigServer ModSecurity Control) or posted this on their forums yet?

    Is Apache running at all right now?
     
  8. atlantis21

    atlantis21 Well-Known Member

    Joined:
    Sep 18, 2012
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I think there is problem with Apache. I will update apache later and report back.
     
Loading...

Share This Page