modsecurity_http_policy.conf file location

atlantis21

Well-Known Member
Sep 18, 2012
49
0
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?
 

HostingH

Well-Known Member
Jan 13, 2008
125
17
68
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,
 

atlantis21

Well-Known Member
Sep 18, 2012
49
0
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 [email protected]
	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 [email protected]
	177ServerName server123.com
	178LogLevel warn
	--- /usr/local/apache/conf/httpd.conf.work.NfYPwtyFanlFSwU7 ---



...Done
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,910
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
(EAI 9)Address family for hostname not supported: alloc_listener: failed to set up sockaddr
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.
 

cPanelPeter

Technical Analyst III
Staff member
Sep 23, 2013
575
20
143
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?