<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by The cPanel Guy on Medium]]></title>
        <description><![CDATA[Stories by The cPanel Guy on Medium]]></description>
        <link>https://medium.com/@thecpanelguy?source=rss-913c78b3a4e6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8U4U9BikSyph8Scqg1vHsw.png</url>
            <title>Stories by The cPanel Guy on Medium</title>
            <link>https://medium.com/@thecpanelguy?source=rss-913c78b3a4e6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:48:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thecpanelguy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fixing ModSecurity Content-Length Error (cPanel)]]></title>
            <link>https://medium.com/thecpanelguy/fixing-modsecurity-content-length-error-cpanel-c0ee013025ed?source=rss-913c78b3a4e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0ee013025ed</guid>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[modsecurity]]></category>
            <category><![CDATA[cpanel]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <dc:creator><![CDATA[The cPanel Guy]]></dc:creator>
            <pubDate>Fri, 24 Aug 2018 01:12:39 GMT</pubDate>
            <atom:updated>2018-08-24T01:12:39.920Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Example Error for example-domain.com:</strong></p><blockquote>[Thu Aug 23 18:01:11.459498 2018] [:error] [pid 8526:tid 140198008489728] [client 192.168.10.10:54024] [client 192.168.10.10] ModSecurity: Output filter: Content-Length (537916) over the limit (524288). [hostname “example-domain.com”] [uri “/index.html”] [unique_id “W388tyFbFEDGjr1xisBO@wAAANc”]</blockquote><p>In order to fix a Modsecurity Content-Length exceeded Limit errors, we need to increase the ModSecurity <strong>SecResponseBodyLimit</strong> directive within Apache. This restriction is in place to prevent large content-length attack vectors on the server. It is safe to increase this limit for larger sites, but should be done only on a site by site basis as well as incremental increases so as not to set a value that is too large..</p><p>In order to increase the directive we need to utilize the cPanel<a href="https://documentation.cpanel.net/display/EA4/Modify+Apache+Virtual+Hosts+with+Include+Files"> <strong>Modify Apache Virtual Hosts with Include Files</strong></a> feature. These files do not automatically exist, so you may need to create directories and files as well as rebuild your <strong>httpd.conf</strong> to get the necessary changes in working order.</p><p><strong>Note: </strong>If the server is running <a href="https://www.configserver.com/cp/cmc.html"><strong>ConfigServer ModSecurity Control</strong></a><strong> </strong>(<strong>CMC</strong>) <strong>WHM</strong> plugin, there is a good chance the necessary directories have already been created. However, these instructions assume the directories do not exist, as that is their default state when running <strong>cPanel</strong>.</p><p>Step 1. Create Necessary Directories</p><p>We will need to make sure two directories are in place, one for Standard HTTP traffic and the other for secure HTTPS traffic. These directories are derived from both the username of the cPanel account as well as the domain name of the site that needs the setting updated.</p><p>Before we can create the directory, we must first substitute the needed information in the path:</p><ul><li><strong>example-domain.com:</strong> <em>The fully qualified domain name of the site in question.</em></li><li><strong>cpanel-username:</strong> <em>The cPanel username of the account owner for the domain in question.</em></li></ul><p>Once we know the above details, we can use the following template create the right directories.</p><p><strong>HTTP</strong>:</p><blockquote>mkdir -p /etc/apache2/conf.d/userdata/<strong>std</strong>/2_4/<strong>cpanel-username</strong>/<strong>example-domain.com</strong></blockquote><p><strong>HTTPS:</strong></p><blockquote>mkdir -p /etc/apache2/conf.d/userdata/<strong>ssl</strong>/2_4/<strong>cpanel-username</strong>/<strong>example-domain.com</strong></blockquote><p><strong>Note: </strong>This is only for Apache 2.4 servers. When using another version of Apache, adjust the version number (2_4) from above to the appropriate version for your installation.</p><h3>Step 2. Create Include File</h3><p>The filename in the above directories must end with the <strong>.conf</strong> extension. That is the only rule. Any files without a <strong>.conf</strong> extension will be ignored. In most cases, you will be creating two copies of the same file in both HTTP and HTTPS directories created in the previous step. It is good practice to name the filename something appropriate to its purpose. In this example, I have selected the name <strong>content-length.conf</strong> as it pertains to the error in question. The following, command will create the file within the std (HTTP) directory, with the contents necessary for adjusting the <strong>SecResponseBodyLimit</strong> directive.</p><blockquote>cat &lt;&lt;EOF&gt; /etc/apache2/conf.d/userdata/std/2_4/cpanel-username/example-domain.com/content-length.conf<br>#Increase for content-length or content limit errors<br>&lt;IfModule mod_security2.c&gt;<br>SecResponseBodyLimit 546870912<br>&lt;/IfModule&gt;<br>EOF</blockquote><p>Now we simply need to copy the file from the std (HTTP) directory over to its ssl (HTTPS) counterpart. The command below takes advantage of a Bash substitution technique to make the line shorter.</p><blockquote>cp /etc/apache2/conf.d/userdata/{std,ssl}/2_4/cpanel-username/example-domain.com/content-length.conf</blockquote><h3>Step 3. Rebuild Apache Configuration</h3><p>Now that the files have been created, we need to make sure that Apache will include them. If the files did not exist prior to the last time Apache rebuilt the httpd.conf file, a rebuild will be necessary.</p><blockquote>/scripts/rebuildhttpdconf</blockquote><h3>Step 4. Restart Apache</h3><p>Apache will need to be reloaded to read the new configuration. This is simply done by running:</p><blockquote>/scripts/restartsrv_apache</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0ee013025ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thecpanelguy/fixing-modsecurity-content-length-error-cpanel-c0ee013025ed">Fixing ModSecurity Content-Length Error (cPanel)</a> was originally published in <a href="https://medium.com/thecpanelguy">The cPanel Guy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Medium]]></title>
            <link>https://medium.com/thecpanelguy/introduction-to-medium-e2aabcb58b6e?source=rss-913c78b3a4e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2aabcb58b6e</guid>
            <category><![CDATA[web-hosting]]></category>
            <dc:creator><![CDATA[The cPanel Guy]]></dc:creator>
            <pubDate>Sat, 30 Jun 2018 01:08:23 GMT</pubDate>
            <atom:updated>2018-06-30T01:08:23.220Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*DkKAz0sSPMPnKV7V050eIQ.png" /><figcaption>The cPanel Guy</figcaption></figure><p>Hello Medium community. I am incorporating your interesting platform into my social media assets so bare with me while I get used to how things work in the Medium space. I will not be simply parroting content onto Medium, it will have it’s own unique twists to make it stand apart from my other social media accounts.</p><p>I also wanted to introduce myself and my publication with you so you know what to expect from here. As my summary indicates, I am a life long IT Professional. I was introduced to computers in my teen years back in the 80s and owned my own 386 system in the 90s. So I’ve been around a while.</p><p>I started with dial-up technical support in the early 2000s where I advanced on to web hosting support and then into systems administration. This is where I first came into contact with cPanel and was responsible for setting up and migrating our over 3,000 customer sites from proprietary hosting platforms over to cPanel running a cPanel DNS cluster which was integrated into our Windows Plesk servers as well. Ever since then, I’ve been dealing with cPanel and have grown along with it.</p><p>For the past several years, I’ve been working more closely with cPanel servers on a daily basis providing fully managed cPanel support to my customers. I’ve picked up many tricks and written many scripts in this time frame that I want to share with the world.</p><p>I recently got the chance to write a technical article for my employer and it ignited a fire in my heart. I’ve discovered a new passion for technical writing and this is going to be the focus of my endeavors moving forward.</p><p>This is the birth of The cPanel Guy brand, but it is not only limited to cPanel users. I will be providing my insights into both cPanel and Linux Systems Administration. I’ve picked up a few tricks with WordPress and other popular web hosting software as well that permeate the hosting landscape in these modern days.</p><p>I hope you find what you need from this end of the Internet. I’ll do my best to provide accurate and effective information.</p><p>Sincerely,<br>Jason M Potter<br>The cPanel Guy,<a href="http://cpguy.com/"> cpguy.com</a><br><a href="https://linkedin.com/in/JasonMPotter">https://linkedin.com/in/JasonMPotter</a><br><a href="https://www.minds.com/thecpanelguy">https://minds.com/thecpanelguy</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2aabcb58b6e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thecpanelguy/introduction-to-medium-e2aabcb58b6e">Introduction to Medium</a> was originally published in <a href="https://medium.com/thecpanelguy">The cPanel Guy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The nightmare that is wp-cron.php]]></title>
            <link>https://medium.com/@thecpanelguy/the-nightmare-that-is-wpcron-php-ae31c1d3ae30?source=rss-913c78b3a4e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae31c1d3ae30</guid>
            <category><![CDATA[cron]]></category>
            <category><![CDATA[rant]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[web-hosting]]></category>
            <category><![CDATA[cpanel]]></category>
            <dc:creator><![CDATA[The cPanel Guy]]></dc:creator>
            <pubDate>Fri, 08 Jun 2018 02:38:35 GMT</pubDate>
            <atom:updated>2018-10-04T00:35:12.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*V8305Lnz2Ga0wP7yxuLm-w.png" /></figure><p>One major gripe I have with WordPress is the default wp-cron.php implementation. If you are familiar with how WordPress uses wp-cron.php by default, you may want to skip ahead to the next section of this article.</p><h3>What is wp-cron.php &amp; How does it work?</h3><p>The file wp-cron.php is the portion of WordPress that handles scheduled events within a WordPress site. Anything that has to do with scheduling posts or publications and really anything date/time oriented is governed by the wp-cron.php file.</p><p>In order for wp-cron.php to work properly, it needs to be executed frequently, but no more than once per minute. However, the default behavior does not require you to set up a real system level cron job on your server. Instead, it uses a piggyback method on every incoming request. When a request comes into the site, WordPress will generate an additional request from itself to the wp-cron.php file over HTTP(S). That sounds pretty innocuous, right?</p><h3>Why is the default wp-cron.php behavior a nightmare?</h3><p>The default method works perfectly fine on a small site with very few visitors per hour. However, when implemented on a medium or larger site or even a site that is being scanned by bots (which is very common these days), this means you get twice fold whatever traffic you are currently handling. It becomes a rudimentary DDoS attack against yourself. This is because the cron is being executed multiple times a minute using an HTTP request. The HTTP request generates additional overhead by having to generate, negotiate and establish the connection over a network socket. It even impacts the effective capacity of your underlying web server. This solution does not fare well in most situations, and honestly, it should be removed as the default behavior due to its propensity to be abused or turned into an attack vector on a server just from regular traffic.</p><h3>Well, what are the alternatives?</h3><p>The only real alternative and the much better solution is to configure a regular system cronjob that executes the wp-cron.php script directly through PHP every minute. This ensures that any scheduled tasks are indeed executed at their scheduled time. It also should not be done via an HTTP request but a direct execution of PHP to avoid hindering the web server’s capacity or generating additional memory overhead on the network layer.</p><h3>How do I disable the default wp-cron.php behavior?</h3><p>This is pretty universal and simple to do. You need to update your <strong>wp-cronfig.php</strong> file to include the following setting:</p><pre>define(&#39;DISABLE_WP_CRON&#39;, true);</pre><ul><li><em>You can typically find your </em><strong><em>wp-config.php</em></strong><em> file in your site’s </em><strong><em>public_html</em></strong><em> directory.</em></li><li><em>This new setting should be put in the file just after the DB_COLLATE database line which looks like the following</em></li></ul><pre>define(&#39;DB_COLLATE&#39;, &#39;&#39;);</pre><h3>How do I set up a system cron job?</h3><p>This is simple in cPanel, assuming your hosting provider has enabled the cron job feature on your account. The <a href="https://documentation.cpanel.net/display/70Docs/Cron+Jobs">cPanel Cron Jobs Documentation</a> goes into greater details but essentially you do:</p><ol><li>Login to cPanel for your domain: <em>yourdomain.tld/</em>cpanel</li><li>Input “cron” in the quick search box near the top of the page.</li><li>Click “Cron Jobs” icon that appears.</li></ol><ul><li>If it does not appear, your account does not have the Cron Jobs feature enabled and you will need to talk to your hosting provider for help setting up the cron or switching to a package that includes the Cron Jobs feature.</li></ul><ol><li>Pay attention to the Cron Jobs page, it will provide you the exact location of your PHP binary. You will need to copy that path into the command box at the bottom of the page and alter the file being executed by PHP to be your <em>/home/username/public_html/wp-cron.php</em> file instead. Using the full path.</li><li>Select the first entry (“*”) for each parameter. This will execute the <strong>wp-cron.php</strong> file every minute.</li><li>Click that add cron button and you’re done.</li></ol><h3>Why are you so harsh on this practice, it seems reasonable and easy to fix?</h3><p>I believe it is up to the software engineers that develop our digital world to impress upon themselves a sense of responsibility for their products. WordPress is ubiquitous these days and with auto installer software, like Softaculous, WordPress gets installed on a very large majority of sites. They are installed with the default behavior enabled, which is essentially an attack vector on any server. Now with the hosting industry being so prevalent in our lives, many people have WordPress sites and do not know about this issue until it cripples their site. The default integration is sorely inadequate and should be removed. Today on one server alone, I found over 500 different installs of WordPress and watched as a bot hit each site on the server. Every one of those sites suddenly became a liability for the server’s stability.</p><p>I realize that this problem is handled on a case by case basis. However, with so many installs around the world, it would be better addressed by WordPress rather than every single hosting provider who has to set up special conditions on their server to protect against the hole this software generates. The cost of removing this behavior and forcing site owners to generate a system cron should be baseline and a notice placed within the WordPress admin interface that scheduled tasks will not be executed until a system cron job is created properly. This is within my programming skills, so I know it’s well within theirs.</p><p>WordPress aims for ease of use, so their target consumers are those that typically know little about hosting caveats. I believe the responsibility here lies entirely with WordPress to fix and they have taken the stance against it. In the meantime, the System Admins in the hosting industry have to suffer through this terrible “feature” when examining servers that have fallen out of control due to a bot running over a default WordPress install.</p><h3>Visualize The Insanity</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8unPoVpLp_knYlk87zqXg.png" /><figcaption>Each visitor in the default wp-cron.php setup spawns a secondary connection originating from the server over a network socket to wp-cron.php. Ergo each visitor in this setup reduces the overall available network sockets by half and increases the load contribution of a single visitor to double that of a single visit. The solution is running wp-cron.php through PHP via a regularly scheduled system cronjob. This eliminates the problem entirely and, in my opinion, should be the default implementation to prevent abuse of derelict default WordPress installations.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae31c1d3ae30" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>