<?xml version="1.0" encoding="utf-8"?><!-- generator="b2evolution/7.2.3-stable" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>TheCrimsonHorror</title>
		<link>http://thecrimsonhorror.com/blog1.php</link>
		<atom:link rel="self" type="application/rss+xml" href="http://thecrimsonhorror.com/blog1.php?tempskin=_rss2" />
		<description></description>
		<language>en-US</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=7.2.3-stable"/>
		<ttl>60</ttl>
				<item>
			<title>Locating Spammers</title>
			<link>http://thecrimsonhorror.com/blog1.php/locating-spammers</link>
			<pubDate>Sat, 07 Jan 2017 08:14:00 +0000</pubDate>			<dc:creator>Mr.Seiko</dc:creator>
			<category domain="main">Uncategorized</category>			<guid isPermaLink="false">21@http://thecrimsonhorror.com/</guid>
						<description>&lt;p&gt;So I&#039;m working on a guys server today, and he&#039;s been having issues with this server generating SPAM.  Not a lot, just like a couple hundred a day. &lt;/p&gt;
&lt;p&gt;A small enough to not really be noticed at first, so it goes on long enough that the server gets blakclisted everywhere. &lt;/p&gt;
&lt;p&gt;The thing with this, is that it wasn&#039;t a standard SPAM script that was getting hit, and generating spam, or a hacked email account.&lt;br /&gt;This was basically EVERY domain on the server (Almost all owned by one reseller on the server) all sending one or two pieces of spam here and there from info@&amp;lt;customerdomain&amp;gt;&lt;/p&gt;
&lt;p&gt;The mail logs would just show generic information like&lt;/p&gt;
&lt;p&gt;Mail Control Data:&lt;/p&gt;
&lt;pre&gt;mailnull 47 12
&amp;lt;info@(customerdomain)&amp;gt;
1483750320 0
-helo_name (customerdomain)
-host_address 127.0.0.1.57428
-interface_address 127.0.0.1.25
-received_protocol esmtp
-aclc _authenticated_local_user 6
nobody
-body_linecount 16
-max_received_linelength 390
-host_lookup_failed
XX
1
(someRandom)@aol.com&lt;/pre&gt;
&lt;p&gt;This was really annoying me. &lt;/p&gt;
&lt;p&gt;I exhausted all of my usual Spam hunting tactics, using things like Maldet and ClamAV to look for known spam scrips and hacks and came up empty. &lt;br /&gt;So I started looking at the traffic to the server as a whole, looking for patterns. &lt;br /&gt;Eventually I started seeing that xmlrpc POSTs was really the only pattern happening to all sites. &lt;/p&gt;
&lt;pre&gt;tail -f /usr/local/apache/domlogs/*.com | grep POST | grep xmlrpc&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;91.197.232.105 - - [07/Jan/2017:06:15:55 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;91.197.232.105 - - [07/Jan/2017:06:16:53 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;91.197.232.105 - - [07/Jan/2017:06:17:04 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;91.197.232.105 - - [07/Jan/2017:06:17:14 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;91.197.232.105 - - [07/Jan/2017:06:17:16 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;51.15.43.32 - - [07/Jan/2017:06:21:53 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;51.15.43.58 - - [07/Jan/2017:06:26:10 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;51.15.43.58 - - [07/Jan/2017:06:27:05 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;51.15.43.58 - - [07/Jan/2017:06:28:40 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 301 - &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;51.15.43.58 - - [07/Jan/2017:06:28:35 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 384 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;212.47.230.108 - - [07/Jan/2017:06:28:59 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;212.47.230.108 - - [07/Jan/2017:06:30:43 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 384 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;212.47.230.108 - - [07/Jan/2017:06:31:15 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 301 - &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;51.15.43.32 - - [07/Jan/2017:06:31:40 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;br /&gt;89.144.12.15 - - [07/Jan/2017:06:31:47 +0000] &quot;POST /xmlrpc.php HTTP/1.1&quot; 200 403 &quot;-&quot; &quot;User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; uk; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13&quot;&lt;br /&gt;163.172.132.253 - - [07/Jan/2017:06:31:44 +0000] &quot;POST /xmlrpc.php HTTP/1.0&quot; 200 370 &quot;-&quot; &quot;Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;So I started comparing the POSTs to the info@ spam in the Queue&lt;br /&gt;Tossed this into the server command line &lt;/p&gt;
&lt;pre&gt;sed -i &#039;1i &amp;lt;Files xmlrpc.php&amp;gt;\norder deny,allow\ndeny from all\n&amp;lt;/Files&amp;gt;\n &#039; /home/*/public_html/.htaccess&lt;/pre&gt;
&lt;p&gt;And now every domain has a block  that kills access to xmlrpc.php, and prevents this ongoing spam ordeal for this customer. &lt;/p&gt;
&lt;p&gt;FUN!!&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://thecrimsonhorror.com/blog1.php/locating-spammers&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>So I'm working on a guys server today, and he's been having issues with this server generating SPAM.  Not a lot, just like a couple hundred a day. </p>
<p>A small enough to not really be noticed at first, so it goes on long enough that the server gets blakclisted everywhere. </p>
<p>The thing with this, is that it wasn't a standard SPAM script that was getting hit, and generating spam, or a hacked email account.<br />This was basically EVERY domain on the server (Almost all owned by one reseller on the server) all sending one or two pieces of spam here and there from info@&lt;customerdomain&gt;</p>
<p>The mail logs would just show generic information like</p>
<p>Mail Control Data:</p>
<pre>mailnull 47 12
&lt;info@(customerdomain)&gt;
1483750320 0
-helo_name (customerdomain)
-host_address 127.0.0.1.57428
-interface_address 127.0.0.1.25
-received_protocol esmtp
-aclc _authenticated_local_user 6
nobody
-body_linecount 16
-max_received_linelength 390
-host_lookup_failed
XX
1
(someRandom)@aol.com</pre>
<p>This was really annoying me. </p>
<p>I exhausted all of my usual Spam hunting tactics, using things like Maldet and ClamAV to look for known spam scrips and hacks and came up empty. <br />So I started looking at the traffic to the server as a whole, looking for patterns. <br />Eventually I started seeing that xmlrpc POSTs was really the only pattern happening to all sites. </p>
<pre>tail -f /usr/local/apache/domlogs/*.com | grep POST | grep xmlrpc</pre>
<p> </p>
<pre>91.197.232.105 - - [07/Jan/2017:06:15:55 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />91.197.232.105 - - [07/Jan/2017:06:16:53 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />91.197.232.105 - - [07/Jan/2017:06:17:04 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />91.197.232.105 - - [07/Jan/2017:06:17:14 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />91.197.232.105 - - [07/Jan/2017:06:17:16 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />51.15.43.32 - - [07/Jan/2017:06:21:53 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />51.15.43.58 - - [07/Jan/2017:06:26:10 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />51.15.43.58 - - [07/Jan/2017:06:27:05 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />51.15.43.58 - - [07/Jan/2017:06:28:40 +0000] "POST /xmlrpc.php HTTP/1.0" 301 - "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />51.15.43.58 - - [07/Jan/2017:06:28:35 +0000] "POST /xmlrpc.php HTTP/1.0" 200 384 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />212.47.230.108 - - [07/Jan/2017:06:28:59 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />212.47.230.108 - - [07/Jan/2017:06:30:43 +0000] "POST /xmlrpc.php HTTP/1.0" 200 384 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />212.47.230.108 - - [07/Jan/2017:06:31:15 +0000] "POST /xmlrpc.php HTTP/1.0" 301 - "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />51.15.43.32 - - [07/Jan/2017:06:31:40 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"<br />89.144.12.15 - - [07/Jan/2017:06:31:47 +0000] "POST /xmlrpc.php HTTP/1.1" 200 403 "-" "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; uk; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"<br />163.172.132.253 - - [07/Jan/2017:06:31:44 +0000] "POST /xmlrpc.php HTTP/1.0" 200 370 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"</pre>
<p><br />So I started comparing the POSTs to the info@ spam in the Queue<br />Tossed this into the server command line </p>
<pre>sed -i '1i &lt;Files xmlrpc.php&gt;\norder deny,allow\ndeny from all\n&lt;/Files&gt;\n ' /home/*/public_html/.htaccess</pre>
<p>And now every domain has a block  that kills access to xmlrpc.php, and prevents this ongoing spam ordeal for this customer. </p>
<p>FUN!!</p><div class="item_footer"><p><small><a href="http://thecrimsonhorror.com/blog1.php/locating-spammers">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://thecrimsonhorror.com/blog1.php/locating-spammers#comments</comments>
			<wfw:commentRss>http://thecrimsonhorror.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=21</wfw:commentRss>
		</item>
				<item>
			<title>Blocking an account from sending mail in WHM</title>
			<link>http://thecrimsonhorror.com/blog1.php/blocking-an-account-from-sending</link>
			<pubDate>Fri, 14 Oct 2016 03:51:00 +0000</pubDate>			<dc:creator>Mr.Seiko</dc:creator>
			<category domain="main">Uncategorized</category>			<guid isPermaLink="false">20@http://thecrimsonhorror.com/</guid>
						<description>&lt;p&gt;I had a customer today that wanted to block an account from being able to send email because they were dealing with a hacked website that was spamming. &lt;/p&gt;
&lt;p&gt;There is no specific feature in WHM/cPanel to just block a complete domain from being able to send mail, so I used the following process:&lt;/p&gt;
&lt;p&gt;Created a new file called blockeddomains with the domain that I wanted to block &lt;/p&gt;
&lt;pre&gt;&lt;span class=&quot;crayon-i&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;crayon-s&quot;&gt;&quot;domain.com&quot;&lt;/span&gt; &lt;span class=&quot;crayon-o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;crayon-o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;crayon-v&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;crayon-o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;crayon-v&quot;&gt;blockeddomains&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now setting the proper permissions / ownership for the file:&lt;/p&gt;
&lt;pre&gt;&lt;span class=&quot;crayon-e&quot;&gt;chown &lt;/span&gt;&lt;span class=&quot;crayon-v&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;crayon-sy&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;crayon-v&quot;&gt;mail&lt;/span&gt; &lt;span class=&quot;crayon-o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;crayon-v&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;crayon-o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;crayon-v&quot;&gt;blockeddomains&lt;/span&gt; &lt;span class=&quot;crayon-o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;crayon-i&quot;&gt;chmod&lt;/span&gt; &lt;span class=&quot;crayon-cn&quot;&gt;640&lt;/span&gt; &lt;span class=&quot;crayon-o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;crayon-v&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;crayon-o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;crayon-v&quot;&gt;blockeddomains&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now I have to tell EXIM to look at this file, and use it to deny email from the domains listed in it. &lt;/p&gt;
&lt;p&gt;Open WHM, and Browse to WHM &amp;gt;&amp;gt; Service Configuration &amp;gt;&amp;gt; EXIM Configuration Manager &amp;gt;&amp;gt; Advanced Editor&lt;br /&gt;Scroll down to the Add additional configuration setting button, and click on it, and add the following: &lt;/p&gt;
&lt;pre&gt;domainlist blocked_domains = lsearch;/etc/blockeddomains&lt;/pre&gt;
&lt;p&gt;Scroll down further to the ROUTERSTART section and add the following:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;reject_domains:&lt;/p&gt;
&lt;p&gt;driver = redirect&lt;br /&gt;domains = +blocked_domains&lt;br /&gt;allow_fail&lt;br /&gt;data = :fail: SPAM Source rejected: $domain is manually blacklisted.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Now you can block/unblock any domains simply by editing the /etc/blockeddomains file.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://thecrimsonhorror.com/blog1.php/blocking-an-account-from-sending&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>I had a customer today that wanted to block an account from being able to send email because they were dealing with a hacked website that was spamming. </p>
<p>There is no specific feature in WHM/cPanel to just block a complete domain from being able to send mail, so I used the following process:</p>
<p>Created a new file called blockeddomains with the domain that I wanted to block </p>
<pre><span class="crayon-i">echo</span> <span class="crayon-s">"domain.com"</span> <span class="crayon-o">&gt;</span> <span class="crayon-o">/</span><span class="crayon-v">etc</span><span class="crayon-o">/</span><span class="crayon-v">blockeddomains</span></pre>
<p>Now setting the proper permissions / ownership for the file:</p>
<pre><span class="crayon-e">chown </span><span class="crayon-v">root</span><span class="crayon-sy">.</span><span class="crayon-v">mail</span> <span class="crayon-o">/</span><span class="crayon-v">etc</span><span class="crayon-o">/</span><span class="crayon-v">blockeddomains</span> <span class="crayon-o">&amp;&amp;</span> <span class="crayon-i">chmod</span> <span class="crayon-cn">640</span> <span class="crayon-o">/</span><span class="crayon-v">etc</span><span class="crayon-o">/</span><span class="crayon-v">blockeddomains</span></pre>
<p>Now I have to tell EXIM to look at this file, and use it to deny email from the domains listed in it. </p>
<p>Open WHM, and Browse to WHM &gt;&gt; Service Configuration &gt;&gt; EXIM Configuration Manager &gt;&gt; Advanced Editor<br />Scroll down to the Add additional configuration setting button, and click on it, and add the following: </p>
<pre>domainlist blocked_domains = lsearch;/etc/blockeddomains</pre>
<p>Scroll down further to the ROUTERSTART section and add the following:</p>
<p> </p>
<p>reject_domains:</p>
<p>driver = redirect<br />domains = +blocked_domains<br />allow_fail<br />data = :fail: SPAM Source rejected: $domain is manually blacklisted.</p>
<p> </p>
<p>Now you can block/unblock any domains simply by editing the /etc/blockeddomains file.</p>
<p> </p><div class="item_footer"><p><small><a href="http://thecrimsonhorror.com/blog1.php/blocking-an-account-from-sending">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://thecrimsonhorror.com/blog1.php/blocking-an-account-from-sending#comments</comments>
			<wfw:commentRss>http://thecrimsonhorror.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=20</wfw:commentRss>
		</item>
				<item>
			<title>Making WordPress more secure</title>
			<link>http://thecrimsonhorror.com/blog1.php/making-wordpress-more-secure</link>
			<pubDate>Thu, 28 Apr 2016 08:01:00 +0000</pubDate>			<dc:creator>Mr.Seiko</dc:creator>
			<category domain="main">Uncategorized</category>			<guid isPermaLink="false">19@http://thecrimsonhorror.com/</guid>
						<description>&lt;p&gt;WordPress is popular, Free software that can be used to quickly and easily build websites. It has great community support and a tonne of plugins that can extend it&#039;s capabilities. &lt;/p&gt;
&lt;p&gt;The problem is that it gets fucking hacked all the time, and abused to send billions of spam around the world. &lt;br /&gt;Don&#039;t be an idiot and let yours get abused.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;Securing wp-includes&lt;/h2&gt;
&lt;p&gt;A second layer of protection can be added where scripts are generally not intended to be accessed by any user. One way to do that is to block those scripts using mod_rewrite in the .htaccess file. &lt;strong&gt;Note:&lt;/strong&gt; to ensure the code below is not overwritten by WordPress, place it outside the &lt;tt&gt;# BEGIN WordPress&lt;/tt&gt; and &lt;tt&gt;# END WordPress&lt;/tt&gt; tags in the .htaccess file. WordPress can overwrite anything between these tags.&lt;/p&gt;
&lt;pre&gt;# Block the include-only files.&lt;br /&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteRule ^wp-admin/includes/ - [F,L]&lt;br /&gt;RewriteRule !^wp-includes/ - [S=3]&lt;br /&gt;RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]&lt;br /&gt;RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]&lt;br /&gt;RewriteRule ^wp-includes/theme-compat/ - [F,L]&lt;br /&gt;&amp;lt;/IfModule&amp;gt;&lt;/pre&gt;
&lt;pre&gt;# BEGIN WordPress&lt;/pre&gt;
&lt;p&gt;Note that this won&#039;t work well on Multisite, as &lt;tt&gt;RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]&lt;/tt&gt; would prevent the ms-files.php file from generating images. Omitting that line will allow the code to work, but offers less security.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;Securing wp-config.php&lt;/h2&gt;
&lt;p&gt;You can move the &lt;tt&gt;wp-config.php&lt;/tt&gt; file to the directory above your WordPress install. This means for a site installed in the root of your webspace, you can store &lt;tt&gt;wp-config.php&lt;/tt&gt; outside the web-root folder.&lt;/p&gt;
&lt;p&gt;Note that &lt;tt&gt;wp-config.php&lt;/tt&gt; can be stored ONE directory level above the WordPress (where wp-includes resides) installation. Also, make sure that only you (and the web server) can read this file (it generally means a 400 or 440 permission).&lt;/p&gt;
&lt;p&gt;If you use a server with .htaccess, you can put this in that file (at the very top) to deny access to anyone surfing for it:&lt;/p&gt;
&lt;pre&gt;&amp;lt;files wp-config.php&amp;gt;&lt;br /&gt;order allow,deny&lt;br /&gt;deny from all&lt;br /&gt;&amp;lt;/files&amp;gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;Securing uploads&lt;/h2&gt;
&lt;p&gt;If file uploads are enabled, people can upload, and execute any arbitrary code, and use this to gain access to unintended areas of your site, or generate spam.&lt;br /&gt;Creating a .htaccess file in the uploads folder with the following will prevent that.&lt;/p&gt;
&lt;pre&gt;&amp;lt;Files *.php&amp;gt;&lt;br /&gt;deny from all&lt;br /&gt;&amp;lt;/Files&amp;gt;&lt;/pre&gt;
&lt;h2&gt;Disable File Editing&lt;/h2&gt;
&lt;p&gt;The WordPress Dashboard by default allows administrators to edit PHP files, such as plugin and theme files. This is often the first tool an attacker will use if able to login, since it allows code execution. WordPress has a constant to disable editing from Dashboard. Placing this line in wp-config.php is equivalent to removing the &#039;edit_themes&#039;, &#039;edit_plugins&#039; and &#039;edit_files&#039; capabilities of all users:&lt;/p&gt;
&lt;pre&gt;define(&#039;DISALLOW_FILE_EDIT&#039;, true);
&lt;/pre&gt;
&lt;p&gt;This will not prevent an attacker from uploading malicious files to your site, but might stop some attacks.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;These are a few good places to start in securing your WP install. Of course keeping all updates applied to WordPress Core and any Plugins and Themes is very important as well. &lt;/p&gt;
&lt;h2&gt; &lt;/h2&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://thecrimsonhorror.com/blog1.php/making-wordpress-more-secure&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>WordPress is popular, Free software that can be used to quickly and easily build websites. It has great community support and a tonne of plugins that can extend it's capabilities. </p>
<p>The problem is that it gets fucking hacked all the time, and abused to send billions of spam around the world. <br />Don't be an idiot and let yours get abused.</p>
<p> </p>
<p> </p>
<h2>Securing wp-includes</h2>
<p>A second layer of protection can be added where scripts are generally not intended to be accessed by any user. One way to do that is to block those scripts using mod_rewrite in the .htaccess file. <strong>Note:</strong> to ensure the code below is not overwritten by WordPress, place it outside the <tt># BEGIN WordPress</tt> and <tt># END WordPress</tt> tags in the .htaccess file. WordPress can overwrite anything between these tags.</p>
<pre># Block the include-only files.<br />&lt;IfModule mod_rewrite.c&gt;<br />RewriteEngine On<br />RewriteBase /<br />RewriteRule ^wp-admin/includes/ - [F,L]<br />RewriteRule !^wp-includes/ - [S=3]<br />RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]<br />RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]<br />RewriteRule ^wp-includes/theme-compat/ - [F,L]<br />&lt;/IfModule&gt;</pre>
<pre># BEGIN WordPress</pre>
<p>Note that this won't work well on Multisite, as <tt>RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]</tt> would prevent the ms-files.php file from generating images. Omitting that line will allow the code to work, but offers less security.</p>
<p> </p>
<h2>Securing wp-config.php</h2>
<p>You can move the <tt>wp-config.php</tt> file to the directory above your WordPress install. This means for a site installed in the root of your webspace, you can store <tt>wp-config.php</tt> outside the web-root folder.</p>
<p>Note that <tt>wp-config.php</tt> can be stored ONE directory level above the WordPress (where wp-includes resides) installation. Also, make sure that only you (and the web server) can read this file (it generally means a 400 or 440 permission).</p>
<p>If you use a server with .htaccess, you can put this in that file (at the very top) to deny access to anyone surfing for it:</p>
<pre>&lt;files wp-config.php&gt;<br />order allow,deny<br />deny from all<br />&lt;/files&gt;</pre>
<p> </p>
<h2>Securing uploads</h2>
<p>If file uploads are enabled, people can upload, and execute any arbitrary code, and use this to gain access to unintended areas of your site, or generate spam.<br />Creating a .htaccess file in the uploads folder with the following will prevent that.</p>
<pre>&lt;Files *.php&gt;<br />deny from all<br />&lt;/Files&gt;</pre>
<h2>Disable File Editing</h2>
<p>The WordPress Dashboard by default allows administrators to edit PHP files, such as plugin and theme files. This is often the first tool an attacker will use if able to login, since it allows code execution. WordPress has a constant to disable editing from Dashboard. Placing this line in wp-config.php is equivalent to removing the 'edit_themes', 'edit_plugins' and 'edit_files' capabilities of all users:</p>
<pre>define('DISALLOW_FILE_EDIT', true);
</pre>
<p>This will not prevent an attacker from uploading malicious files to your site, but might stop some attacks.</p>
<p> </p>
<p>These are a few good places to start in securing your WP install. Of course keeping all updates applied to WordPress Core and any Plugins and Themes is very important as well. </p>
<h2> </h2><div class="item_footer"><p><small><a href="http://thecrimsonhorror.com/blog1.php/making-wordpress-more-secure">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://thecrimsonhorror.com/blog1.php/making-wordpress-more-secure#comments</comments>
			<wfw:commentRss>http://thecrimsonhorror.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=19</wfw:commentRss>
		</item>
				<item>
			<title>Injecting a WP-Admin User for testing</title>
			<link>http://thecrimsonhorror.com/blog1.php/injecting-a-wp-admin-user</link>
			<pubDate>Fri, 22 Apr 2016 09:13:00 +0000</pubDate>			<dc:creator>Mr.Seiko</dc:creator>
			<category domain="main">Uncategorized</category>			<guid isPermaLink="false">18@http://thecrimsonhorror.com/</guid>
						<description>&lt;p&gt;So sometimes we have a WordPress User that doesn&#039;t want to share Login Credentials over email because of possible Security issues with emailing passwords. &lt;/p&gt;
&lt;p&gt;One of the easiest ways around this request is just to Inject a new Admin User, Do what you need to do, then delete it. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;INSERT INTO `user_db`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (&#039;1337&#039;, &#039;techsupport&#039;, MD5(&#039;password&#039;), &#039;Technical Support&#039;, &#039;tech@thecrimsonhorror.com&#039;, &#039;&#039;, &#039;0000-00-00 00:00:00&#039;, &#039;&#039;, &#039;0&#039;, &#039;Tech Support&#039;);&lt;br /&gt;INSERT INTO `user_db`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, &#039;1337&#039;, &#039;wp_capabilities&#039;, &#039;a:1:{s:13:&quot;administrator&quot;;s:1:&quot;1&quot;;}&#039;), (NULL, &#039;1337&#039;, &#039;wp_user_level&#039;, &#039;10&#039;);&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The obvious changes to this would be depending on the specifics of the Database at hand.  After the INSERT INTO you would modify the user_db to be the actual Database name &lt;br /&gt;The next parts are the wp_users and wp_usermeta These would only change if the customer has modified their Database Prefix (If this is the case, then the wp_capabilities and wp_user_level would also have the wp_ replaced with the Database Prefix)  Modify the Username/Password and email address as needed and just run as an SQL Statement in phpMyAdmin. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;After you&#039;re done doing the testing, you want to clean up your User so it&#039;s not another entry point for hackers&lt;/p&gt;
&lt;div class=&quot;wide_scroll&quot;&gt;DELETE FROM `user_db`.`wp_users` WHERE `wp_users`.`ID` = 1337&lt;br /&gt;DELETE FROM `user_db`.`wp_usermeta` WHERE `wp_usermeta`.`user_id` = 1337&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Of course, the same things for this, change the Database name and Table Prefix to match the database you&#039;re working with, and all will be good. &lt;br /&gt;The UserID set to 1337 is an easy way to ensure that there are no conflicts, it&#039;s very unlikely that a user would have that many WP users.  &lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://thecrimsonhorror.com/blog1.php/injecting-a-wp-admin-user&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>So sometimes we have a WordPress User that doesn't want to share Login Credentials over email because of possible Security issues with emailing passwords. </p>
<p>One of the easiest ways around this request is just to Inject a new Admin User, Do what you need to do, then delete it. </p>
<p> </p>
<p> </p>
<p>INSERT INTO `user_db`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('1337', 'techsupport', MD5('password'), 'Technical Support', 'tech@thecrimsonhorror.com', '', '0000-00-00 00:00:00', '', '0', 'Tech Support');<br />INSERT INTO `user_db`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '1337', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'), (NULL, '1337', 'wp_user_level', '10');</p>
<p> </p>
<p><code></code></p>
<p>The obvious changes to this would be depending on the specifics of the Database at hand.  After the INSERT INTO you would modify the user_db to be the actual Database name <br />The next parts are the wp_users and wp_usermeta These would only change if the customer has modified their Database Prefix (If this is the case, then the wp_capabilities and wp_user_level would also have the wp_ replaced with the Database Prefix)  Modify the Username/Password and email address as needed and just run as an SQL Statement in phpMyAdmin. </p>
<p> </p>
<p>After you're done doing the testing, you want to clean up your User so it's not another entry point for hackers</p>
<div class="wide_scroll">DELETE FROM `user_db`.`wp_users` WHERE `wp_users`.`ID` = 1337<br />DELETE FROM `user_db`.`wp_usermeta` WHERE `wp_usermeta`.`user_id` = 1337</div>
<p> </p>
<p>Of course, the same things for this, change the Database name and Table Prefix to match the database you're working with, and all will be good. <br />The UserID set to 1337 is an easy way to ensure that there are no conflicts, it's very unlikely that a user would have that many WP users.  </p><div class="item_footer"><p><small><a href="http://thecrimsonhorror.com/blog1.php/injecting-a-wp-admin-user">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://thecrimsonhorror.com/blog1.php/injecting-a-wp-admin-user#comments</comments>
			<wfw:commentRss>http://thecrimsonhorror.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=18</wfw:commentRss>
		</item>
				<item>
			<title>SQL Updates for WP</title>
			<link>http://thecrimsonhorror.com/blog1.php/sql-updates-for-wp</link>
			<pubDate>Thu, 07 Apr 2016 06:20:00 +0000</pubDate>			<dc:creator>Mr.Seiko</dc:creator>
			<category domain="main">Uncategorized</category>			<guid isPermaLink="false">17@http://thecrimsonhorror.com/</guid>
						<description>&lt;p&gt;Had a customer today that fucked up his WP install. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;He moved from newsite.&amp;lt;domain&amp;gt; to &amp;lt;domain&amp;gt; and didn&#039;t make any updates in the WP Admin to account for the move to the new URL as per the Moving WordPress article on Codex. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Figured I would repair the DB manually to get rid of all the &#039;newsite.&#039; references. &lt;/p&gt;
&lt;p&gt;There were over 1600 references to the site name in the DB&lt;/p&gt;
&lt;p&gt;Figured I would write up a little SQL Script that would make the update:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;UPDATE wpjc_posts set guid=REPLACE(guid, &#039;newsite.customerdomain.com&#039;, &#039;customerdomain.com&#039;)&lt;br /&gt;UPDATE wpjc_posts set post_content=REPLACE(post_content, &#039;newsite.customerdomain.com&#039;, &#039;customerdomain.com&#039;)&lt;br /&gt;UPDATE wpjc_postmeta set meta_value=REPLACE(meta_value, &#039;newsite.customerdomain.com&#039;, &#039;customerdomain.com&#039;)&lt;br /&gt;UPDATE wpjc_options set option_value=REPLACE(option_value, &#039;newsite.customerdomain.com&#039;, &#039;customerdomain.com&#039;)&lt;/pre&gt;
&lt;p&gt;Running this, updated 2000+ records referring to the old URL in a few seconds, and was literally the quickest resolution to this issue. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://thecrimsonhorror.com/blog1.php/sql-updates-for-wp&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Had a customer today that fucked up his WP install. </p>
<p> </p>
<p>He moved from newsite.&lt;domain&gt; to &lt;domain&gt; and didn't make any updates in the WP Admin to account for the move to the new URL as per the Moving WordPress article on Codex. </p>
<p> </p>
<p>Figured I would repair the DB manually to get rid of all the 'newsite.' references. </p>
<p>There were over 1600 references to the site name in the DB</p>
<p>Figured I would write up a little SQL Script that would make the update:<br /><br /></p>
<pre>UPDATE wpjc_posts set guid=REPLACE(guid, 'newsite.customerdomain.com', 'customerdomain.com')<br />UPDATE wpjc_posts set post_content=REPLACE(post_content, 'newsite.customerdomain.com', 'customerdomain.com')<br />UPDATE wpjc_postmeta set meta_value=REPLACE(meta_value, 'newsite.customerdomain.com', 'customerdomain.com')<br />UPDATE wpjc_options set option_value=REPLACE(option_value, 'newsite.customerdomain.com', 'customerdomain.com')</pre>
<p>Running this, updated 2000+ records referring to the old URL in a few seconds, and was literally the quickest resolution to this issue. </p>
<p> </p><div class="item_footer"><p><small><a href="http://thecrimsonhorror.com/blog1.php/sql-updates-for-wp">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://thecrimsonhorror.com/blog1.php/sql-updates-for-wp#comments</comments>
			<wfw:commentRss>http://thecrimsonhorror.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=17</wfw:commentRss>
		</item>
				<item>
			<title>cPanel Default Page</title>
			<link>http://thecrimsonhorror.com/blog1.php/cpanel-default-page</link>
			<pubDate>Thu, 31 Mar 2016 11:13:00 +0000</pubDate>			<dc:creator>Mr.Seiko</dc:creator>
			<category domain="main">Uncategorized</category>			<guid isPermaLink="false">16@http://thecrimsonhorror.com/</guid>
						<description>&lt;p&gt;Had a user today that added a new domain to his reseller account. &lt;/p&gt;
&lt;p&gt;Apparently he had this domain with us before, and transferred it over to GoDaddy for hosting, then was bringing it back. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I&#039;ve seen this happen a few times when the IP address they were pointing to was incorrect, or the httpd.conf was pointing to the home folder or IP incorrectly. &lt;/p&gt;
&lt;p&gt;I tried the basics like rebuilding the httpdconf and still getting issues. &lt;/p&gt;
&lt;p&gt;Had a look at the Zone file for the domain, and saw that on our side, the authoratative nameserver were set to his previous host. &lt;br /&gt;Rebuilt the Zone file, and it appears that the site started working. &lt;/p&gt;
&lt;p&gt;Probably something I should have thought of earlier, but at least I got to the bottom of it. &lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://thecrimsonhorror.com/blog1.php/cpanel-default-page&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Had a user today that added a new domain to his reseller account. </p>
<p>Apparently he had this domain with us before, and transferred it over to GoDaddy for hosting, then was bringing it back. </p>
<p> </p>
<p>I've seen this happen a few times when the IP address they were pointing to was incorrect, or the httpd.conf was pointing to the home folder or IP incorrectly. </p>
<p>I tried the basics like rebuilding the httpdconf and still getting issues. </p>
<p>Had a look at the Zone file for the domain, and saw that on our side, the authoratative nameserver were set to his previous host. <br />Rebuilt the Zone file, and it appears that the site started working. </p>
<p>Probably something I should have thought of earlier, but at least I got to the bottom of it. </p><div class="item_footer"><p><small><a href="http://thecrimsonhorror.com/blog1.php/cpanel-default-page">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://thecrimsonhorror.com/blog1.php/cpanel-default-page#comments</comments>
			<wfw:commentRss>http://thecrimsonhorror.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=16</wfw:commentRss>
		</item>
				<item>
			<title>MySQL Optimizations</title>
			<link>http://thecrimsonhorror.com/blog1.php/mysql-optimizations</link>
			<pubDate>Thu, 24 Mar 2016 11:39:00 +0000</pubDate>			<dc:creator>Mr.Seiko</dc:creator>
			<category domain="main">Uncategorized</category>			<guid isPermaLink="false">15@http://thecrimsonhorror.com/</guid>
						<description>&lt;p&gt;cPanel/WHM come with a pretty decent all-around configuration, but when you&#039;re running a more powerful box, you can beef up your settings to get a little better performance. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Today, I&#039;ll cover a few Tweaks that can be done to Apache and MySQL to get that little extra bang out of your server that&#039;s not just a little VPS running 4-5 sites. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;For Easy Apache, I went with the following, to keep up with new features, but not be &#039;bleeding edge&#039;&lt;/p&gt;
&lt;p&gt;In the first stage we run the Easy Apache and selected the following:&lt;/p&gt;
&lt;p&gt;Apache Version 2.4&lt;br /&gt;PHP Version 5.5&lt;br /&gt; In step 5 “Exhaustive Options List” selected – Deflate – Expires – MPM Prefork and – MPM Worker&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Next item to review is the Apache Global Configuration limits&lt;br /&gt;WHM » Service Configuration » Apache Configuration » “Global Configuration”&lt;br /&gt;These are pretty generic numbers based on how many GB&#039;s of ram on the server, these can still be tweaked a little further based on your usage, &lt;/p&gt;
&lt;pre&gt; &lt;/pre&gt;
&lt;div class=&quot;wide_scroll&quot;&gt; &lt;/div&gt;
&lt;pre&gt;Apache Directive 	 	2GB             6GB             12GB 	 	

StartServers 	 	 	4 	 	8 	 	16 	
MinSpareServers 	 	4 	 	8 	 	16 	
MaxSpareServers 	 	8 	 	16 	 	32 	
ServerLimit 	 	 	64 	 	128 	 	256 	
MaxRequestWorkers 	 	50 	 	120 	 	250 	
MaxConnectionsPerChild 	 	1000 	 	2500 	 	5000 
Keep-Alive			On		On		On
Keep-Alive Timeout	 	5	 	5	 	 5
Max Keep-Alive Requests		50	 	120	 	120
Timeout				30		60		60&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;From here, I wanted to add in some basic Caching to Apache by default, so even is users don&#039;t specify Cache lifetimes, this will override.&lt;br /&gt;WHM » Service Configuration » Apache Configuration » Include Editor » “Pre VirtualHost Include” &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre&gt;# Cache Control Settings for one hour cache
&amp;lt;FilesMatch &quot;.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$&quot;&amp;gt;
Header set Cache-Control &quot;max-age=86400, public&quot;
&amp;lt;/FilesMatch&amp;gt;

&amp;lt;FilesMatch &quot;.(xml|txt)$&quot;&amp;gt;
Header set Cache-Control &quot;max-age=86400, public, must-revalidate&quot;
&amp;lt;/FilesMatch&amp;gt;

&amp;lt;FilesMatch &quot;.(html|htm)$&quot;&amp;gt;
Header set Cache-Control &quot;max-age=3600, must-revalidate&quot;
&amp;lt;/FilesMatch&amp;gt;

# Mod Deflate performs data compression
&amp;lt;IfModule mod_deflate.c&amp;gt;
&amp;lt;FilesMatch &quot;.(js|css|html|php|xml|jpg|png|gif)$&quot;&amp;gt;
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE no-gzip
&amp;lt;/FilesMatch&amp;gt;
&amp;lt;/IfModule&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&lt;br /&gt;With this, basic media files, such as images and flash vids are forcibly browser cached for a day, and html files for an hour. &lt;br /&gt;This helps to account for the inaction of clients, and ensure that basic caches are in place. Making page loads a little faster, and server loads a little slower for repeat visitors. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In /etc/my.cnf I made the following additions to optimize the connections and buffering. &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre&gt;[mysqld]
local-infile=0
max_connections = 600
max_user_connections=1000
key_buffer_size = 512M
myisam_sort_buffer_size = 64M
read_buffer_size = 1M
table_open_cache = 5000
thread_cache_size = 384
wait_timeout = 20
connect_timeout = 10
tmp_table_size = 256M
max_heap_table_size = 128M
max_allowed_packet = 64M
net_buffer_length = 16384
max_connect_errors = 10
concurrent_insert = 2
read_rnd_buffer_size = 786432
bulk_insert_buffer_size = 8M
query_cache_limit = 5M
query_cache_size = 128M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65535
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
max_write_lock_count = 8
slow_query_log
log-error
external-locking=FALSE
open_files_limit=50000

[mysqld_safe]

[mysqldump]
quick
max_allowed_packet = 16M

[isamchk]
key_buffer = 384M
sort_buffer = 384M
read_buffer = 256M
write_buffer = 256M

[myisamchk]
key_buffer = 384M
sort_buffer = 384M
read_buffer = 256M
write_buffer = 256M

#### Per connection configuration ####
sort_buffer_size = 1M
join_buffer_size = 1M
thread_stack = 192K&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;Then ran a Repair &amp;amp; optimize on the databases and restarted MySQL:&lt;/p&gt;
&lt;pre&gt;mysqlcheck --check --auto-repair --all-databases
mysqlcheck --optimize --all-databases
/etc/init.d/mysql restart&lt;/pre&gt;
&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://thecrimsonhorror.com/blog1.php/mysql-optimizations&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>cPanel/WHM come with a pretty decent all-around configuration, but when you're running a more powerful box, you can beef up your settings to get a little better performance. </p>
<p> </p>
<p>Today, I'll cover a few Tweaks that can be done to Apache and MySQL to get that little extra bang out of your server that's not just a little VPS running 4-5 sites. </p>
<p> </p>
<p>For Easy Apache, I went with the following, to keep up with new features, but not be 'bleeding edge'</p>
<p>In the first stage we run the Easy Apache and selected the following:</p>
<p>Apache Version 2.4<br />PHP Version 5.5<br /> In step 5 “Exhaustive Options List” selected – Deflate – Expires – MPM Prefork and – MPM Worker</p>
<p> </p>
<p>Next item to review is the Apache Global Configuration limits<br />WHM » Service Configuration » Apache Configuration » “Global Configuration”<br />These are pretty generic numbers based on how many GB's of ram on the server, these can still be tweaked a little further based on your usage, </p>
<pre> </pre>
<div class="wide_scroll"> </div>
<pre>Apache Directive 	 	2GB             6GB             12GB 	 	

StartServers 	 	 	4 	 	8 	 	16 	
MinSpareServers 	 	4 	 	8 	 	16 	
MaxSpareServers 	 	8 	 	16 	 	32 	
ServerLimit 	 	 	64 	 	128 	 	256 	
MaxRequestWorkers 	 	50 	 	120 	 	250 	
MaxConnectionsPerChild 	 	1000 	 	2500 	 	5000 
Keep-Alive			On		On		On
Keep-Alive Timeout	 	5	 	5	 	 5
Max Keep-Alive Requests		50	 	120	 	120
Timeout				30		60		60<br /><br /><br />From here, I wanted to add in some basic Caching to Apache by default, so even is users don't specify Cache lifetimes, this will override.<br />WHM » Service Configuration » Apache Configuration » Include Editor » “Pre VirtualHost Include” <br /><br /></pre>
<pre># Cache Control Settings for one hour cache
&lt;FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"&gt;
Header set Cache-Control "max-age=86400, public"
&lt;/FilesMatch&gt;

&lt;FilesMatch ".(xml|txt)$"&gt;
Header set Cache-Control "max-age=86400, public, must-revalidate"
&lt;/FilesMatch&gt;

&lt;FilesMatch ".(html|htm)$"&gt;
Header set Cache-Control "max-age=3600, must-revalidate"
&lt;/FilesMatch&gt;

# Mod Deflate performs data compression
&lt;IfModule mod_deflate.c&gt;
&lt;FilesMatch ".(js|css|html|php|xml|jpg|png|gif)$"&gt;
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE no-gzip
&lt;/FilesMatch&gt;
&lt;/IfModule&gt;</pre>
<pre><br />With this, basic media files, such as images and flash vids are forcibly browser cached for a day, and html files for an hour. <br />This helps to account for the inaction of clients, and ensure that basic caches are in place. Making page loads a little faster, and server loads a little slower for repeat visitors. <br /><br /><br /><br />In /etc/my.cnf I made the following additions to optimize the connections and buffering. <br /><br /></pre>
<pre>[mysqld]
local-infile=0
max_connections = 600
max_user_connections=1000
key_buffer_size = 512M
myisam_sort_buffer_size = 64M
read_buffer_size = 1M
table_open_cache = 5000
thread_cache_size = 384
wait_timeout = 20
connect_timeout = 10
tmp_table_size = 256M
max_heap_table_size = 128M
max_allowed_packet = 64M
net_buffer_length = 16384
max_connect_errors = 10
concurrent_insert = 2
read_rnd_buffer_size = 786432
bulk_insert_buffer_size = 8M
query_cache_limit = 5M
query_cache_size = 128M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65535
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
max_write_lock_count = 8
slow_query_log
log-error
external-locking=FALSE
open_files_limit=50000

[mysqld_safe]

[mysqldump]
quick
max_allowed_packet = 16M

[isamchk]
key_buffer = 384M
sort_buffer = 384M
read_buffer = 256M
write_buffer = 256M

[myisamchk]
key_buffer = 384M
sort_buffer = 384M
read_buffer = 256M
write_buffer = 256M

#### Per connection configuration ####
sort_buffer_size = 1M
join_buffer_size = 1M
thread_stack = 192K<br /><br /></pre>
<p>Then ran a Repair &amp; optimize on the databases and restarted MySQL:</p>
<pre>mysqlcheck --check --auto-repair --all-databases
mysqlcheck --optimize --all-databases
/etc/init.d/mysql restart</pre>
<pre><br /><br /></pre>
<p> </p>
<p> </p><div class="item_footer"><p><small><a href="http://thecrimsonhorror.com/blog1.php/mysql-optimizations">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://thecrimsonhorror.com/blog1.php/mysql-optimizations#comments</comments>
			<wfw:commentRss>http://thecrimsonhorror.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=15</wfw:commentRss>
		</item>
				<item>
			<title>Preventing Outgoing Spam</title>
			<link>http://thecrimsonhorror.com/blog1.php/preventing-outgoing-spam</link>
			<pubDate>Tue, 23 Feb 2016 03:53:00 +0000</pubDate>			<dc:creator>Mr.Seiko</dc:creator>
			<category domain="main">Uncategorized</category>			<guid isPermaLink="false">14@http://thecrimsonhorror.com/</guid>
						<description>&lt;p&gt;We all know that Spam is fucking annoying, That being the case, when a user is compromized, either in a web script, or a hacked/cracked/socially engineered password, the spammers most likely avenue is to Spoof a random email address from the same domain or spoof something completely different. &lt;/p&gt;
&lt;p&gt;Here is how I had learned to combat this, by preventing my servers from sending outgoing spoofed mail, I know that I&#039;m ensure that my domains are not part of the problem. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;By taking advantage of the EXIM Configuration Editor, we can effectively stop outgoing spoofing. &lt;/p&gt;
&lt;p&gt;I. Blocking all un-authenticated spoofed outbound emails&lt;/p&gt;
&lt;p&gt;1. Login to WHM &amp;gt;&amp;gt; EXIM CONFIGURATION MANAGER &amp;gt;&amp;gt; ADVANCED EDITOR&lt;/p&gt;
&lt;p&gt;2. Add the following entry in the top using Add additional configuration setting:&lt;br /&gt;domainlist remote_domains = lsearch;/etc/remotedomains&lt;/p&gt;
&lt;p&gt; &lt;br /&gt;3. Add the following code under &lt;strong&gt;acl_not_smtp&lt;/strong&gt; &amp;gt;&amp;gt; &lt;strong&gt;custom_begin_outgoing_notsmtp_checkall&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;deny&lt;br /&gt;condition = ${if ! match_domain{${domain:${address:$h_From:}}}{ +local_domains : +remote_domains}}&lt;br /&gt;message = Sorry, you don&#039;t have \&lt;br /&gt;permission to send email from this server with a header that \&lt;br /&gt;states the email is from ${lc:${domain:${address:$h_from:}}}.&lt;br /&gt;accept&lt;/pre&gt;
&lt;p&gt; &lt;br /&gt;Here, the ACL will check for the presence of domain name part of the from address in either of the files – /etc/localdomains or /etc/remotedomains. If there is a mismatch, server will reject the email.&lt;/p&gt;
&lt;p&gt;II. Blocking all authenticated spoofed outbound emails&lt;/p&gt;
&lt;p&gt;1. WHM &amp;gt;&amp;gt; EXIM CONFIGURATION MANAGER &amp;gt;&amp;gt; ADVANCED EXIM EDITOR&lt;/p&gt;
&lt;p&gt;2. Search for &lt;strong&gt;acl_smtp_data&lt;/strong&gt; &amp;gt;&amp;gt; &lt;strong&gt;custom_begin_outgoing_smtp_checkall&lt;/strong&gt; and add the following lines under it:&lt;/p&gt;
&lt;pre&gt;deny&lt;br /&gt;authenticated = *&lt;br /&gt;condition = ${if or {{ !eqi{$authenticated_id} {$sender_address} } \&lt;br /&gt;{ !eqi{$authenticated_id} {${address:$header_From:}} } \&lt;br /&gt;} \&lt;br /&gt;}&lt;br /&gt;message = Your FROM address ( $sender_address , $header_From ) &lt;br /&gt;must match your authenticated email user ( $authenticated_id ).&lt;br /&gt;Treating this as a spoofed email.&lt;/pre&gt;
&lt;p&gt; &lt;br /&gt;Here, for all authenticated users, the rule will check whether the authenticated userid matches with the from address. If it matches, it will allow the email. Else, it will display the message “Your FROM must match your authenticated email user. Treating this as spoofed email”&lt;/p&gt;
&lt;p&gt;PS: If the acl_smtp_data is mentioned as something else(like acl_smtp_data = check_message), locate check_message and add the above lines just under it.&lt;/p&gt;
&lt;p&gt;IMPORTANT points to keep in mind&lt;/p&gt;
&lt;p&gt;a. POP before SMTP won’t work with this setting. You will have to ask your customers to use the option – “My Server Requires Authentication” in the SMTP settings of their email client.&lt;br /&gt;b. Username in the format user+domain.com will not work. They have to use &lt;a href=&quot;mailto:user@domain.com&quot;&gt;user@domain.com&lt;/a&gt; instead.&lt;/p&gt;
&lt;p&gt;These solutions have been tested on my personal cPanel server, and in a limited set of production servers. We have found it to be working in 100% of cases. However, using the above solution should be at your own risk. If you do not understand the ACLs posted above, always ask for expert opinion.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://thecrimsonhorror.com/blog1.php/preventing-outgoing-spam&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>We all know that Spam is fucking annoying, That being the case, when a user is compromized, either in a web script, or a hacked/cracked/socially engineered password, the spammers most likely avenue is to Spoof a random email address from the same domain or spoof something completely different. </p>
<p>Here is how I had learned to combat this, by preventing my servers from sending outgoing spoofed mail, I know that I'm ensure that my domains are not part of the problem. </p>
<p> </p>
<p>By taking advantage of the EXIM Configuration Editor, we can effectively stop outgoing spoofing. </p>
<p>I. Blocking all un-authenticated spoofed outbound emails</p>
<p>1. Login to WHM &gt;&gt; EXIM CONFIGURATION MANAGER &gt;&gt; ADVANCED EDITOR</p>
<p>2. Add the following entry in the top using Add additional configuration setting:<br />domainlist remote_domains = lsearch;/etc/remotedomains</p>
<p> <br />3. Add the following code under <strong>acl_not_smtp</strong> &gt;&gt; <strong>custom_begin_outgoing_notsmtp_checkall</strong>:</p>
<pre>deny<br />condition = ${if ! match_domain{${domain:${address:$h_From:}}}{ +local_domains : +remote_domains}}<br />message = Sorry, you don't have \<br />permission to send email from this server with a header that \<br />states the email is from ${lc:${domain:${address:$h_from:}}}.<br />accept</pre>
<p> <br />Here, the ACL will check for the presence of domain name part of the from address in either of the files – /etc/localdomains or /etc/remotedomains. If there is a mismatch, server will reject the email.</p>
<p>II. Blocking all authenticated spoofed outbound emails</p>
<p>1. WHM &gt;&gt; EXIM CONFIGURATION MANAGER &gt;&gt; ADVANCED EXIM EDITOR</p>
<p>2. Search for <strong>acl_smtp_data</strong> &gt;&gt; <strong>custom_begin_outgoing_smtp_checkall</strong> and add the following lines under it:</p>
<pre>deny<br />authenticated = *<br />condition = ${if or {{ !eqi{$authenticated_id} {$sender_address} } \<br />{ !eqi{$authenticated_id} {${address:$header_From:}} } \<br />} \<br />}<br />message = Your FROM address ( $sender_address , $header_From ) <br />must match your authenticated email user ( $authenticated_id ).<br />Treating this as a spoofed email.</pre>
<p> <br />Here, for all authenticated users, the rule will check whether the authenticated userid matches with the from address. If it matches, it will allow the email. Else, it will display the message “Your FROM must match your authenticated email user. Treating this as spoofed email”</p>
<p>PS: If the acl_smtp_data is mentioned as something else(like acl_smtp_data = check_message), locate check_message and add the above lines just under it.</p>
<p>IMPORTANT points to keep in mind</p>
<p>a. POP before SMTP won’t work with this setting. You will have to ask your customers to use the option – “My Server Requires Authentication” in the SMTP settings of their email client.<br />b. Username in the format user+domain.com will not work. They have to use <a href="mailto:user@domain.com">user@domain.com</a> instead.</p>
<p>These solutions have been tested on my personal cPanel server, and in a limited set of production servers. We have found it to be working in 100% of cases. However, using the above solution should be at your own risk. If you do not understand the ACLs posted above, always ask for expert opinion.</p><div class="item_footer"><p><small><a href="http://thecrimsonhorror.com/blog1.php/preventing-outgoing-spam">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://thecrimsonhorror.com/blog1.php/preventing-outgoing-spam#comments</comments>
			<wfw:commentRss>http://thecrimsonhorror.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=14</wfw:commentRss>
		</item>
			</channel>
</rss>
