<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>/proc/sys/net/blog &#187; script</title>
	<atom:link href="http://momotonic.com/category/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://momotonic.com</link>
	<description>rants, tutorials and documents about everything server related</description>
	<lastBuildDate>Tue, 14 Jul 2009 15:55:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Small application for disabling mod_security for specific domains on cPanel server</title>
		<link>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/</link>
		<comments>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 15:30:29 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[disable mod_security2]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[small script]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=46</guid>
		<description><![CDATA[Alright, I&#8217;m lazy so I always make a script/utility for anything and everything. Another fine piece of lazygineering.
This little script disables mod_security on specific domains that you pick, mod_security2 does not allow disabling it from .htaccess and it&#8217;s pretty annoying to do the same work all over and over again, why not make it one [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, I&#8217;m lazy so I always make a script/utility for anything and everything. Another fine piece of lazygineering.</p>
<p>This little script disables mod_security on specific domains that you pick, mod_security2 does not allow disabling it from .htaccess and it&#8217;s pretty annoying to do the same work all over and over again, why not make it one line only. <img src='http://momotonic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Introducing, disable_modsec &#8212; Enjoy lazy cPanel server admins.</p>
<p><code>#!/usr/bin/perl</p>
<p>use strict;<br />
use lib qw(/usr/local/cpanel);<br />
use Cpanel::AcctUtils::DomainOwner;</p>
<p>if ($ARGV[0])<br />
{<br />
  # Get username<br />
  my $username = Cpanel::AcctUtils::DomainOwner::getdomainowner($ARGV[0]);<br />
  my $domain = $ARGV[0];</p>
<p>  # Create directory for config<br />
  system ('mkdir -p /usr/local/apache/conf/userdata/std/2/'.$username.'/'.$domain);</p>
<p>  # Create config file<br />
  open (CONFIG, ">>/usr/local/apache/conf/userdata/std/2/".$username.'/'.$domain.'/modsec.conf');<br />
  print CONFIG "<IfModule mod_security2.c>\nSecRuleEngine Off\n</IfModule>";<br />
  close CONFIG;</p>
<p>  # Enable vHost includes<br />
  system ('/scripts/ensure_vhost_includes --user='.$username);<br />
} else {<br />
  print("Usage: disable_modsec [domain]\n");<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
